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
/export (TUI) and opencode export (CLI) are unrelated commands with the same name — causes silent-looking import failures #48105
/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
In the TUI, run /export on a session → get session.md.
opencode import session.md
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.
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.
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the clear write-up, @gberdal! You're asking us to make it obvious that a Markdown
/exportis a readable transcript thatopencode importcan't use: rename the command, give it a clearer description, or haveopencode importexplain the problem when it gets a non-JSON file.Which version are you on (
opencode --version)? Opening the export in$EDITORis how v1 behaved. In v2 (2.x),/exportopens a dialog where you choose the format, Markdown or JSON. The JSON export is the same transcript thatopencode exportproduces, soopencode importshould accept it. Choosing JSON in/exportshould work for handing a session to a colleague.The import side could still be clearer:
opencode importgives a generic parse error on a Markdown file instead of pointing you to the JSON export. Maintainers will consider your suggestions.Related issues:
/exportoffers only JSON and asks for the TUI's Markdown option tooexport/importCLI commands