You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug:
According to the official documentation on opencode.ai/docs/agents/ and opencode.ai/docs/cli/, running opencode agent create should launch an interactive prompt to create a new custom agent.However, when executing this command on OpenCode v2.1.0, the CLI throws an unexpected positional argument error.To ReproduceOpen terminal on Ubuntu.Run the command: Bashopencode agent create
Observe the error output.Expected behavior:
The CLI should execute the interactive creation prompt for custom agents as described in the official documentation.Actual behavior / OutputPlaintextERROR
Unexpected positional argument: "create"
Environment:
OpenCode Version: v2.1.0OS: Ubuntu 26.04.1 LTS
Plugins
none
OpenCode version
v2.1.0
Steps to reproduce
Open the WSL terminal and run opencode agent create
Thanks for the report! I can confirm this on v2.1.0: opencode agent create (and opencode agent list) fail with Unexpected positional argument: "create" / "list", and the CLI help lists no agent subcommand. It still happens on the latest dev (133b1eb). The v2 CLI has no agent command, but the CLI and Agents docs still describe one. The script below reproduces it.
Until this is sorted out, you can create an agent by hand as a markdown file in .opencode/agents/ (project) or your global config's agents directory, as described in the Agents docs. opencode debug agents lists the agents OpenCode has loaded.
Reproduction script (repro.sh)
#!/usr/bin/env bash# Reproduces #57406: `opencode agent create` (documented in docs/cli and docs/agents) is not a v2 command.# Usage: ./repro.sh -> uses `opencode` on PATH (e.g. bun add -g @opencode/[email protected])# OC_DEV=/path/to/repo ./repro.sh -> runs the CLI from a source checkoutset -u
dir=$(mktemp -d);cd"$dir"if [ -n"${OC_DEV:-}" ];thenoc() { bun --conditions=browser --preload="$OC_DEV/packages/tui/node_modules/@opentui/solid/scripts/preload.js""$OC_DEV/packages/cli/src/index.ts""$@"; }
elseoc() { opencode "$@"; }
fiecho"version: $(oc --version)"forsubin create list;doecho"== opencode agent $sub"
oc agent $sub2>&1| grep -A1 '^ERROR'echo"exit=${PIPESTATUS[0]}"done
Activity
opencode-agent commentedon Oct 20, 2026
Thanks for the report! I can confirm this on v2.1.0:
opencode agent create(andopencode agent list) fail withUnexpected positional argument: "create"/"list", and the CLI help lists noagentsubcommand. It still happens on the latestdev(133b1eb). The v2 CLI has noagentcommand, but the CLI and Agents docs still describe one. The script below reproduces it.Until this is sorted out, you can create an agent by hand as a markdown file in
.opencode/agents/(project) or your global config's agents directory, as described in the Agents docs.opencode debug agentslists the agents OpenCode has loaded.Reproduction script (repro.sh)
Run it:
bash repro.sh