Throughout these years, I have found that cross-compiling is the most challenging part of creating a CLI. When you are building a web back-end, you control the execution environment (usually linux). For CLIs, your users could be on Linux, macOS or Windows. You need to get three x2 binaries (so a total of 6) to have a fair coverage.
I’ve tried cross, but for Windows and macOS you need licenses. There is no straightforward way to give your users Docker images and have them running in a few commands. You can compile on GitHub action machines, but that’s a very slow feedback loop. I wonder if things are better in Go land.
(Hello from Charm! I’m one of the authors of this library.)
ETA since I just saw Christian chime in: the Goreleaser author works at Charm.sh =)
And actually Carlos, who builds GoReleaser, is the true author of Fang and took it from concept to execution.
I started a similar thing, although not as feature-rich as yours. My goal was to follow CLI best practices and add all the boilerplate one needs to build a Rust CLI.
That said, I am unfamiliar with any licensing for Windows builds.
MacOS has some niche (usually discarded) technicalities like you can only use the SDK on Apple hardware.
Definitely won't look as pretty as the parent project though but I prefer kong in terms of the actual code you need to write.
One of the downsides of a lot of these tools is that's exactly what they don't do well: many things don't align or wrap nicely.
For example, here's a comparison of this fang library vs one where I just raw-dogged the usage text: https://imgur.com/a/QWh9TLD – the nice alignment does a lot more than colours. Especially for larger programs with a bunch of flags it can be such a pain. For example from an otherwise quite nice tool: https://imgur.com/a/RELL9Gk – you just completely lose any "overview".
I did spend some time on some better tooling to improve all of this, because manually writing these isn't super-fun either, but not so straight-forward to do well (or at least: not in a way that I like).
Similar work: https://github.com/chriskiehl/Gooey and https://github.com/Sorcerio/Argparse-Interface
I've wanted to do TUI form generation for my own CLI framework since 2023 ( https://github.com/bbkane/warg/issues/71 ), but I still haven't gotten around to it
johnisgood•3h ago
They have a TUI framework, too, among a lot of other related things. Some of their projects are Go libraries, some are a CLI tool, such as gum.
[1] https://github.com/charmbracelet/gum
nodesocket•3h ago