smallstep / step-kms-plugin

🔐 step plugin to manage keys and certificates on a cloud KMSs and HSMs
Apache License 2.0
47 stars 6 forks source link

Support usage text as plugin #109

Open hslatman opened 10 months ago

hslatman commented 10 months ago

See https://github.com/spf13/cobra/pull/2018. This was added to v1.8.0. Might be useful for our plugin structure too.

E.g. usage text becomes step kms plugin if ran as step-kms-plugin, if I understand correctly. Also applies to autocompletion and other related functionalities.

nirs commented 10 months ago

You can control the usage text and completions dynamically by annotating the root command. If the host command provide a hint when it runs the plugin (e.g. environment variable) you can annotate the root command only when running as a plugin.