You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm proposing a change to cobra-cli that would allow this command to find some way to make the tpl package more customizable.
Use case:
We have a CLI that our dozen+ person team all contributes to in order to be more effective at our jobs. This has made this cobra CLI to become incredibly complex through organic growth. The way we declare our arguments has deviated from the base template that's provided, and we have extended the Command interface to better suit our use case through inheritance. With those changes (which are slowly being rolled out to our codebase) I think it would be nice to be able to use this command utility with a custom template defined within our codebase for how a "new empty command" should look like, compared to our current workflow of copying a "simpler" command file, and trying to change all of the things to get it working.
Ideally - there would be some pre-defined directory or file within the root of a cobra-based project that would declare the templates, and then only if that file is present the cobra-cli tool would automatically default to using that template for new commands rather than the one defined within the tpl package inside this repo.
I'm more than happy to work on building out this feature, if you like the idea.
Thanks for your consideration,
Kirk
The text was updated successfully, but these errors were encountered:
I'm not sure if it's worth expanding this to the project initialization or the main command templates - mostly because I don't see those being used after a project has significantly grown. I'd be happy to extend this functionality in the PR to those other flows though, if desired for more advanced users and use-cases.
Hi there!
I'm proposing a change to cobra-cli that would allow this command to find some way to make the
tpl
package more customizable.Use case:
We have a CLI that our dozen+ person team all contributes to in order to be more effective at our jobs. This has made this cobra CLI to become incredibly complex through organic growth. The way we declare our arguments has deviated from the base template that's provided, and we have extended the
Command
interface to better suit our use case through inheritance. With those changes (which are slowly being rolled out to our codebase) I think it would be nice to be able to use this command utility with a custom template defined within our codebase for how a "new empty command" should look like, compared to our current workflow of copying a "simpler" command file, and trying to change all of the things to get it working.Ideally - there would be some pre-defined directory or file within the root of a cobra-based project that would declare the templates, and then only if that file is present the
cobra-cli
tool would automatically default to using that template for new commands rather than the one defined within the tpl package inside this repo.I'm more than happy to work on building out this feature, if you like the idea.
Thanks for your consideration,
Kirk
The text was updated successfully, but these errors were encountered: