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
{{ message }}
Repository navigation
docs: the /docs page still documents seven v1 commands that do not exist in v2 #57957
The /docs page is being brought in line with the v2 CLI (as #56922 and #57419 started). Seven of its command sections still document v1 commands that no longer exist in v2, so a reader who follows them gets a command that errors.
This is a checklist, not a request to change anything in particular — the right resolution for each row is a maintainer's call (replace with the v2 equivalent, or drop the section). What would help is the mapping, which I worked out from the v2 sources:
Section on the page
v1 command
In v2
The v2 way
### attach
opencode attach <url>
gone
the root flag --server <url> ("Connect to a server URL instead of the background service"), or opencode pair to sign a browser in
### web
opencode web
gone
the web UI is served by the same server as the TUI — see Web; opencode serve and opencode pair
### db
opencode db [query]
gone
opencode debug paths db prints the database path; there is no query shell
### export
opencode export [sessionID]
gone
API only, and experimental: GET /api/experimental/session/{sessionID}/export
### import
opencode import <file>
gone
API only, and experimental: POST /api/experimental/session/import
### github
opencode github
gone
no v2 command; the equivalent would be a plugin or an MCP server
### pr
opencode pr <number>
gone
no v2 command; the equivalent would be a plugin or an MCP server
And the other direction, for completeness — the v2 commands that had no section on the page:
The sources for the mapping are packages/cli/src/commands/commands.ts (the v2 command registry, including the root --server / --standalone flags), packages/protocol/openapi.json (the experimental export/import paths) and services/www/src/docs/content/cli/web.mdx (the web UI is served by the same server as the TUI).
If the page is mid-migration and this is already on someone's list, pointing at it is all I need.
Thanks for the careful mapping. I can confirm this.
I ran each of the seven commands the CLI page documents from an empty directory on v2.1.2 and on the latest dev (f0200df8e, run from source):
opencode web, opencode db, opencode export and opencode github fail with Error: ENOENT: no such file or directory, chdir '<cwd>' -> '<word>', because the word is read as the project directory.
opencode attach <url>, opencode import <file> and opencode pr <number> just print the root usage text.
On that commit, packages/web/src/content/docs/cli.mdx still has the attach, github, export, import, web, pr and db sections. None of them are registered in packages/cli/src/commands/commands.ts. The script below runs all seven commands and lists the matching sections in the docs.
Whether each section should be replaced or dropped is up to the maintainers. Related:
#!/usr/bin/env bash# Runs each v1 command documented on packages/web/src/content/docs/cli.mdx against the v2 CLI.# OC defaults to `opencode`; set OC="bun ... packages/cli/src/index.ts" to run from source.
OC=${OC:-opencode}
DIR=$(mktemp -d);cd"$DIR"$OC --version
forcmdin"attach http://localhost:4096""web""db""export""import x.json""github""pr 1";doecho"=== opencode $cmd"
timeout 20 $OC$cmd</dev/null 2>&1| grep -v '^\s*$'| head -4
done# The docs page (in a checkout given by REPO) still has these sections:if [ -n"$REPO" ];then grep -nE '^### (attach|web|db|export|import|github|pr)$'"$REPO/packages/web/src/content/docs/cli.mdx";fi
Taking the attach row: #58204. The section is gone from every locale, and the root --server / --standalone flags are in the flag table now, which is what that section was really about.
One mapping in the checklist is out of date as of dev (cdf1c200a6): export and import are no longer API-only. Both are subcommands now — opencode session export and opencode session import, confirmed with session --help. Those two rows only need to point at the new home instead of the experimental endpoints.
Left out of that PR, if anyone wants to pick them up: the run flag table also lists --command, --dir, --port, --variant, --password and --username, none of which exist on dev, and web.mdx still has an "Attaching a Terminal" section that runs opencode attach.
Activity
opencode-agent commentedon Oct 21, 2026
Thanks for the careful mapping. I can confirm this.
I ran each of the seven commands the CLI page documents from an empty directory on v2.1.2 and on the latest
dev(f0200df8e, run from source):opencode web,opencode db,opencode exportandopencode githubfail withError: ENOENT: no such file or directory, chdir '<cwd>' -> '<word>', because the word is read as the project directory.opencode attach <url>,opencode import <file>andopencode pr <number>just print the root usage text.On that commit,
packages/web/src/content/docs/cli.mdxstill has theattach,github,export,import,web,pranddbsections. None of them are registered inpackages/cli/src/commands/commands.ts. The script below runs all seven commands and lists the matching sections in the docs.Whether each section should be replaced or dropped is up to the maintainers. Related:
opencode webneeds to be added to theopencodeV2 doc #51574:opencode webis missing from the v2 docs (same chdir error)agentcommandservicesectionReproduction script (repro.sh)
Run it:
bash repro.shLuisAlbertoMK commentedon Oct 22, 2026
Taking the
attachrow: #58204. The section is gone from every locale, and the root--server/--standaloneflags are in the flag table now, which is what that section was really about.One mapping in the checklist is out of date as of
dev(cdf1c200a6):exportandimportare no longer API-only. Both are subcommands now —opencode session exportandopencode session import, confirmed withsession --help. Those two rows only need to point at the new home instead of the experimental endpoints.Left out of that PR, if anyone wants to pick them up: the
runflag table also lists--command,--dir,--port,--variant,--passwordand--username, none of which exist ondev, andweb.mdxstill has an "Attaching a Terminal" section that runsopencode attach.Tarquinen commentedon Nov 2, 2026
Thanks for the careful mapping! The
/docspages are the legacy docs for OpenCode 1 users, so they describe the 1.x CLI, where these commands still exist. The OpenCode 2 CLI is documented at https://opencode.ai/v2/docs/cli. Closing this issue.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊