Cobra scaffold, credentials store, Connect client, device-flow login, whoami/logout, plugin init (creates + adds git remote), publish (tag + push + registry RPC), and status (list scopes/plugins). Proto copied from orchestrator with buf codegen for client stubs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
563 B
Go
19 lines
563 B
Go
package cmd
|
|
|
|
import "github.com/spf13/cobra"
|
|
|
|
func NewRoot() *cobra.Command {
|
|
root := &cobra.Command{
|
|
Use: "ninja",
|
|
Short: "BlockNinja developer CLI",
|
|
Long: "ninja is the developer-facing CLI for BlockNinja. First subcommand group: plugin.",
|
|
}
|
|
root.PersistentFlags().String("host", "", "Orchestrator base URL (default: from credentials or https://my.blockninjacms.com)")
|
|
root.AddCommand(newVersionCmd())
|
|
root.AddCommand(newLoginCmd())
|
|
root.AddCommand(newLogoutCmd())
|
|
root.AddCommand(newWhoamiCmd())
|
|
root.AddCommand(newPluginCmd())
|
|
return root
|
|
}
|