(deps commandDeps)
| 35 | } |
| 36 | |
| 37 | func 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 | |
| 61 | func registerSpawnFlags(cmd *cobra.Command, flags *spawnCommandFlags) { |
| 62 | cmd.Flags().StringVar(&flags.agentName, "agent", "", "Child agent name") |
no test coverage detected