Skip to content

/export (TUI) and opencode export (CLI) are unrelated commands with the same name — causes silent-looking import failures #48105

Open

Description

@gberdal

Description

/export in the TUI and opencode export on the CLI share a name but do completely different things:

/export (TUI) opencode export (CLI)
Output Human-readable Markdown, opened in $EDITOR Structured JSON
Purpose Read/archive the conversation Re-importable session backup
Works with opencode import? No Yes

Nothing about /export indicates it's not the counterpart to opencode import. A user trying to hand a session to a colleague to continue naturally reaches for /export (it's discoverable in the TUI; the CLI command isn't visible unless you already know to look for it), gets a .md file, and only discovers it's the wrong format when opencode import rejects it.

Steps to reproduce

  1. In the TUI, run /export on a session → get session.md.
  2. opencode import session.md
  3. Import fails (not valid JSON).

Suggested fixes (any one of these would help; happy to see other approaches)

  • Rename /export to something that doesn't imply session-portability, e.g. /transcript or /export-md.
  • Or, have opencode import detect a Markdown/non-JSON file and fail with a specific message pointing at opencode export instead of a generic parse error.
  • Or, document the distinction inline — e.g. /export's TUI description could say "for reading only; use opencode export/opencode import to transfer a session."

Why it matters

Right now the only way to learn these are unrelated is to hit the failure and go read the CLI docs page separately from the TUI docs page — there's no signal at the point of using either command.

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the clear write-up, @gberdal! You're asking us to make it obvious that a Markdown /export is a readable transcript that opencode import can't use: rename the command, give it a clearer description, or have opencode import explain the problem when it gets a non-JSON file.

    Which version are you on (opencode --version)? Opening the export in $EDITOR is how v1 behaved. In v2 (2.x), /export opens a dialog where you choose the format, Markdown or JSON. The JSON export is the same transcript that opencode export produces, so opencode import should accept it. Choosing JSON in /export should work for handing a session to a colleague.

    The import side could still be clearer: opencode import gives a generic parse error on a Markdown file instead of pointing you to the JSON export. Maintainers will consider your suggestions.

    Related issues:

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions