A starter for self installing, self completing CLI using the amazing opts
library.
You ask why's it amazing;
- No Flag Parsing, reflection based
struct
stuffing (field attributes turn flags intoargs
). - Did I mentioned the binaries are self completers, add a sub-command or field, recompile and walla it's in the tab completion.
Terminal Recording similar to below commands.
git clone https://github.com/gmwxio/acli.git mycli
cd mycli
go build
./acli cli rename wxio/acli freddo/mycli
go build
./mycli --install
# from zsh, differs for bash and fish
source ~/.zshrc
# tab completion now active
./mycli cl<tab> new<tab> --par<tab> testing sample >> main.go
# edit main.go
go build
./mycli te<tab> sa<tab>