Skip to content

feat: add CLI arguments to agent create command for scripting#5157

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
Timorleiderman:feature/agent-create-cli-args
Dec 10, 2025
Merged

feat: add CLI arguments to agent create command for scripting#5157
rekram1-node merged 1 commit into
anomalyco:devfrom
Timorleiderman:feature/agent-create-cli-args

Conversation

@Timorleiderman

Copy link
Copy Markdown
Contributor

Summary

  • Add --path, --description, and --mode CLI options to opencode agent create command
  • Enables non-interactive agent creation for scripting and automation use cases

Usage

opencode agent create --path ./my-project --description "Review TypeScript code" --mode subagent

When all three arguments are provided, the command runs non-interactively and outputs only the created file path. When any argument is missing, it falls back to interactive prompts.

@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

Comment thread packages/opencode/src/cli/cmd/agent.ts Outdated
Comment thread packages/opencode/src/cli/cmd/agent.ts Outdated
@Timorleiderman

Copy link
Copy Markdown
Contributor Author

/review

@rekram1-node

Copy link
Copy Markdown
Collaborator

only I can trigger them haha

@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

Comment thread packages/opencode/src/cli/cmd/agent.ts Outdated
Comment thread packages/opencode/src/cli/cmd/agent.ts Outdated
- Add --path, --description, --mode, and --tools CLI options
- Each option independently skips its corresponding prompt (autofill behavior)
- Fully non-interactive when all options are provided
- Fix generateObject to use messages instead of prompt parameter
- Show available tools in help text for easy copying
Comment thread packages/opencode/src/agent/agent.ts Outdated
@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

@github-actions

github-actions Bot commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

lgtm

@rekram1-node
rekram1-node merged commit b205779 into anomalyco:dev Dec 10, 2025
2 of 4 checks passed
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 10, 2025
Merged additional commits from sst/opencode:dev after v1.0.141:
- feat: add CLI arguments to agent create command for scripting (anomalyco#5157)
- fix: use project references for desktop typecheck
- tauri: update macos icon
- tauri: don't ask to restart separately in updater
- tauri: comment out restart server dialog
- Various CI improvements

Resolved conflicts:
- .github/workflows/publish.yml: removed (fork-specific)
- .github/workflows/snapshot.yml: kept ours (fork-specific)
- packages/desktop/src/context/global-sync.tsx: merged with catch handler
- packages/sdk/openapi.json: accepted upstream
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants