MCPcopy Create free account
hub / github.com/compozy/agh / newRootCommand

Function newRootCommand

internal/cli/root.go:87–149  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

85}
86
87func 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))

Calls 15

newVersionCommandFunction · 0.85
newInstallCommandFunction · 0.85
newConfigCommandFunction · 0.85
newSupportCommandFunction · 0.85
newUpdateCommandFunction · 0.85
newUninstallCommandFunction · 0.85
newStatusCommandFunction · 0.85
newDoctorCommandFunction · 0.85
newOnboardingCommandFunction · 0.85
newDaemonCommandFunction · 0.85
newNetworkCommandFunction · 0.85
newMeCommandFunction · 0.85