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

Function newSpawnCommand

internal/cli/spawn.go:37–59  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

35}
36
37func newSpawnCommand(deps commandDeps) *cobra.Command {
38 flags := &spawnCommandFlags{}
39 cmd := &cobra.Command{
40 Use: "spawn",
41 Short: "Spawn a bounded child agent session",
42 Args: cobra.NoArgs,
43 Example: ` # Spawn a worker child with a required TTL
44 agh spawn --agent reviewer --ttl-seconds 1800
45
46 # Spawn with a role, prompt overlay, and narrowed permission atoms
47 agh spawn \
48 --agent reviewer \
49 --role reviewer \
50 --ttl-seconds 1800 \
51 --prompt-overlay "Review only the implementation diff." \
52 --tool read \
53 --skill code-review \
54 --channel coord-run-123`,
55 RunE: runSpawnCommand(deps, flags),
56 }
57 registerSpawnFlags(cmd, flags)
58 return cmd
59}
60
61func registerSpawnFlags(cmd *cobra.Command, flags *spawnCommandFlags) {
62 cmd.Flags().StringVar(&flags.agentName, "agent", "", "Child agent name")

Callers 1

newRootCommandFunction · 0.85

Calls 2

runSpawnCommandFunction · 0.85
registerSpawnFlagsFunction · 0.85

Tested by

no test coverage detected