Skip to content

docs: the /docs page still documents seven v1 commands that do not exist in v2 #57957

Closed as not planned

Description

@oke3

Description

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:

v2 command Status
opencode service #57909 (open)
opencode mini section written, PR pending
opencode api section written, PR pending
opencode pair section written, PR pending
opencode reload section written, PR pending

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.

Steps to reproduce

  1. Open https://opencode.ai/docs/cli/.
  2. Follow opencode web, opencode attach, opencode db, opencode export, opencode import, opencode github or opencode pr from the page.
  3. Each one is not a v2 command, and v2 prints ENOENT: chdir ... -> 'web' (the word is read as a project directory).

OpenCode version

dev (checked at a7a508b8).

Activity

  1. opencode-agent commented on Oct 21, 2026

    @opencode-agent
    Contributor

    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:

    Reproduction script (repro.sh)
    #!/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
    for cmd in "attach http://localhost:4096" "web" "db" "export" "import x.json" "github" "pr 1"; do
      echo "=== 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

    Run it: bash repro.sh

  2. LuisAlbertoMK commented on Oct 22, 2026

    @LuisAlbertoMK

    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.

  3. Tarquinen commented on Nov 2, 2026

    @Tarquinen
    Member

    Thanks for the careful mapping! The /docs pages 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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions