diff --git a/cmd/zrok/agent.go b/cmd/zrok/agent.go index 8cc6bd04..1a040864 100644 --- a/cmd/zrok/agent.go +++ b/cmd/zrok/agent.go @@ -8,25 +8,25 @@ import ( ) func init() { - rootCmd.AddCommand(newAgentCommand().cmd) + agentCmd.AddCommand(newAgentStartCommand().cmd) } -type agentCommand struct { +type agentStartCommand struct { cmd *cobra.Command } -func newAgentCommand() *agentCommand { +func newAgentStartCommand() *agentStartCommand { cmd := &cobra.Command{ - Use: "agent", + Use: "start", Short: "Launch a zrok agent", Args: cobra.NoArgs, } - command := &agentCommand{cmd: cmd} + command := &agentStartCommand{cmd: cmd} cmd.Run = command.run return command } -func (cmd *agentCommand) run(_ *cobra.Command, _ []string) { +func (cmd *agentStartCommand) run(_ *cobra.Command, _ []string) { root, err := environment.LoadRoot() if err != nil { tui.Error("error loading zrokdir", err) diff --git a/cmd/zrok/main.go b/cmd/zrok/main.go index 750c71da..9fe7eb4a 100644 --- a/cmd/zrok/main.go +++ b/cmd/zrok/main.go @@ -23,6 +23,7 @@ func init() { adminCmd.AddCommand(adminDeleteCmd) adminCmd.AddCommand(adminListCmd) adminCmd.AddCommand(adminUpdateCmd) + rootCmd.AddCommand(agentCmd) testCmd.AddCommand(loopCmd) rootCmd.AddCommand(adminCmd) rootCmd.AddCommand(configCmd) @@ -75,6 +76,12 @@ var adminUpdateCmd = &cobra.Command{ Short: "Update global resources", } +var agentCmd = &cobra.Command{ + Use: "agent", + Short: "zrok Agent commands", + Aliases: []string{"daemon"}, +} + var configCmd = &cobra.Command{ Use: "config", Short: "Configure your zrok environment",