Are you ready for Fang v2?
The second major release of Fang is here!
❤️ Charm Land Import Path
We've updated our import paths to use vanity domains and use our domain to import Go packages.
// Before
import "github.com/charmbracelet/fang"
// After
import "charm.land/fang/v2"💄 Lip Gloss v2
Fang v2 now uses Lip Gloss v2, which brings a host of improvements and performance enhancements. The new version of Lip Gloss is pure and declarative, which means better rendering, more consistent styling, and fewer surprises.
🎨 Built-in Color Downsampling
Fang now automatically detects your terminal's color profile and downsamples colors to match. This means your CLI will look great everywhere — from full TrueColor terminals to basic 16-color TTYs. No configuration needed; it just works.
🌈 Light/Dark Theme Support
The default theme now adapts to your terminal's background color. Light terminal? You get the light theme. Dark terminal? Dark theme. You can also create your own adaptive themes using WithColorSchemeFunc:
fang.Execute(ctx, cmd, fang.WithColorSchemeFunc(func(ld lipgloss.LightDarkFunc) fang.ColorScheme {
return fang.ColorScheme{
Primary: ld(lipgloss.Color("#FF6B6B"), lipgloss.Color("#4ECDC4")),
Secondary: ld(lipgloss.Color("#95E1D3"), lipgloss.Color("#F38181")),
// ...
}
}))For backwards compatibility, the old WithTheme option still works but is now deprecated.
🪟 Better Windows Support
Windows users rejoice! Fang v2 ensures VT processing is always enabled on Windows, so ANSI colors and styling work correctly without any extra configuration.
🛠️ Bug Fixes and Polish
Fang v2 includes several quality-of-life improvements:
- Multiline flag descriptions are now preserved and formatted correctly
- Command aliases are styled consistently
- Default values in help output have better spacing
- Terminal checks are now done in the right place, preventing panics in non-TTY environments
Changelog
Other stuff
- c78f5f219e3a104d19fc975111cf6d9e8d60a9ea: docs(readme,license): update footer banner, copyright date (@meowgorithm)
- f2331283c3007f71c86b66fd4389a7e8a02f73d2: refactor: migrate to charm.land module path (#81) (@aymanbagabas)
Feedback
Have thoughts on Fang v2? We'd love to hear about it. Let us know on…
Part of Charm.
Charm热爱开源 • Charm loves open source