diff options
| author | Erick Christian <[email protected]> | 2025-08-09 07:07:20 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-08 20:07:20 -0400 |
| commit | b789844b9ca4f9943e6b1bc711fcd568512211f1 (patch) | |
| tree | 62cbfa369fb2c216fd23b8854a49f4ee65b86719 | |
| parent | 9b6ef074f0a13883e49d491c4f24f467f2d17ca3 (diff) | |
| download | opencode-b789844b9ca4f9943e6b1bc711fcd568512211f1.tar.gz opencode-b789844b9ca4f9943e6b1bc711fcd568512211f1.zip | |
feat(agent): allow mode selection during creation (#1699)
| -rw-r--r-- | packages/opencode/src/cli/cmd/agent.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/opencode/src/cli/cmd/agent.ts b/packages/opencode/src/cli/cmd/agent.ts index e929c3a8f..f96da6cfd 100644 --- a/packages/opencode/src/cli/cmd/agent.ts +++ b/packages/opencode/src/cli/cmd/agent.ts @@ -73,6 +73,29 @@ const AgentCreateCommand = cmd({ }) if (prompts.isCancel(selectedTools)) throw new UI.CancelledError() + const modeResult = await prompts.select({ + message: "Agent mode", + options: [ + { + label: "All", + value: "all" as const, + hint: "Can function in both primary and subagent roles", + }, + { + label: "Primary", + value: "primary" as const, + hint: "Acts as a primary/main agent", + }, + { + label: "Subagent", + value: "subagent" as const, + hint: "Can be used as a subagent by other agents", + }, + ], + initialValue: "all", + }) + if (prompts.isCancel(modeResult)) throw new UI.CancelledError() + const tools: Record<string, boolean> = {} for (const tool of availableTools) { if (!selectedTools.includes(tool)) { @@ -82,6 +105,7 @@ const AgentCreateCommand = cmd({ const frontmatter: any = { description: generated.whenToUse, + mode: modeResult, } if (Object.keys(tools).length > 0) { frontmatter.tools = tools |
