4 ms·
Just the other day I added completion support for our cli build with cobra and it was <10m work. So I’m not convinced this is still a hard thing to do. (The ui
by spockz 6y ago
Just the other day I added completion support for our cli build with cobra and it was <10m work.
So I’m not convinced this is still a hard thing to do. (The ui of fig does look slick though.)
- mschrage 6y agoGlad you like the UI! Cobra and other CLI libraries, like oclif, can help you generate the skeleton of the CLI, stuff like subcommands, options, etc. (I'm in the process of writing the integration so you can generate a Fig completion spec the same way!) The difference is that with Fig you can add richer completions as well. For instance, Fig's completion for `npm install` allows you to search across all npm packages: https://twitter.com/fig/status/1385401292193865731 https://twitter.com/fig/status/1385401292193865731
- spockz 6y agoCobra has also support for completion. Through defining a ValidArgsFunction. This seems the same level as the completion shown for npm install.