| 85 | } |
| 86 | |
| 87 | func newRootCommand(deps commandDeps) *cobra.Command { |
| 88 | deps = deps.withDefaults() |
| 89 | |
| 90 | cmd := &cobra.Command{ |
| 91 | Use: rootAghKey, |
| 92 | Short: "AGH — Artificial General Hivemind", |
| 93 | Example: ` # Start the daemon and create a session in the current workspace |
| 94 | agh daemon start |
| 95 | agh session new --agent general |
| 96 | |
| 97 | # Print machine-readable output for automation |
| 98 | agh session list -o json`, |
| 99 | SilenceUsage: true, |
| 100 | SilenceErrors: true, |
| 101 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 102 | return cmd.Help() |
| 103 | }, |
| 104 | } |
| 105 | |
| 106 | cmd.PersistentFlags(). |
| 107 | StringP(outputFlagName, "o", string(OutputHuman), "Output format: human, json, jsonl, or toon") |
| 108 | cmd.PersistentFlags().Bool(jsonFlagName, false, "Emit JSON output") |
| 109 | |
| 110 | cmd.AddCommand(newVersionCommand()) |
| 111 | cmd.AddCommand(newInstallCommand(deps)) |
| 112 | cmd.AddCommand(newConfigCommand(deps)) |
| 113 | cmd.AddCommand(newSupportCommand(deps)) |
| 114 | cmd.AddCommand(newUpdateCommand(deps)) |
| 115 | cmd.AddCommand(newUninstallCommand(deps)) |
| 116 | cmd.AddCommand(newStatusCommand(deps)) |
| 117 | cmd.AddCommand(newDoctorCommand(deps)) |
| 118 | cmd.AddCommand(newOnboardingCommand(deps)) |
| 119 | cmd.AddCommand(newDaemonCommand(deps)) |
| 120 | cmd.AddCommand(newNetworkCommand(deps)) |
| 121 | cmd.AddCommand(newMeCommand(deps)) |
| 122 | cmd.AddCommand(newSpawnCommand(deps)) |
| 123 | cmd.AddCommand(newChannelCommand(deps)) |
| 124 | cmd.AddCommand(newSessionCommand(deps)) |
| 125 | cmd.AddCommand(newProviderCommand(deps)) |
| 126 | cmd.AddCommand(newBridgeCommand(deps)) |
| 127 | cmd.AddCommand(newNotificationsCommand(deps)) |
| 128 | cmd.AddCommand(newBundleCommand(deps)) |
| 129 | cmd.AddCommand(newWorkspaceCommand(deps)) |
| 130 | cmd.AddCommand(newAgentCommand(deps)) |
| 131 | cmd.AddCommand(newExtensionCommand(deps)) |
| 132 | cmd.AddCommand(newHooksCommand(deps)) |
| 133 | cmd.AddCommand(newAutomationCommand(deps)) |
| 134 | cmd.AddCommand(newSchedulerCommand(deps)) |
| 135 | cmd.AddCommand(newTaskCommand(deps)) |
| 136 | cmd.AddCommand(newSkillCommand(deps)) |
| 137 | cmd.AddCommand(newResourceCommand(deps)) |
| 138 | cmd.AddCommand(newMemoryCommand(deps)) |
| 139 | cmd.AddCommand(newVaultCommand(deps)) |
| 140 | cmd.AddCommand(newToolCommand(deps)) |
| 141 | cmd.AddCommand(newToolsetsCommand(deps)) |
| 142 | cmd.AddCommand(newMCPCommand(deps)) |
| 143 | cmd.AddCommand(newLogsCommand(deps)) |
| 144 | cmd.AddCommand(newWhoamiCommand(deps)) |