Skip to content

feat: add session export cli command#5426

Open
paralin wants to merge 2 commits intoanomalyco:devfrom
paralin:add-session-export
Open

feat: add session export cli command#5426
paralin wants to merge 2 commits intoanomalyco:devfrom
paralin:add-session-export

Conversation

@paralin
Copy link
Contributor

@paralin paralin commented Dec 12, 2025

opencode session export [sessionID]

export session transcript to file

Positionals:
sessionID session id to export

Options:
-o, --output output file path
-f, --format output format
[string] [choices: "markdown", "json"] [default: "markdown"]

Fixes: #5426

@paralin paralin force-pushed the add-session-export branch 2 times, most recently from 88703bd to d8ce925 Compare January 5, 2026 05:49
@paralin paralin force-pushed the add-session-export branch from d8ce925 to 76c6761 Compare January 19, 2026 10:45
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@paralin
Copy link
Contributor Author

paralin commented Jan 28, 2026

test failure is an unrelated flake

@paralin
Copy link
Contributor Author

paralin commented Jan 31, 2026

@thdxr This is the most useful PR I've sent and seems like an essential part of opencode, I use it for example in https://github.com/s4wave/ocpipe for structured inputs/outputs and workflows with opencode (like dspy). Without the command to export the session as json it's not possible. Could you take a look? Thanks! Would love to upstream and not require a fork.

opencode session export [sessionID]

export session transcript to file

Positionals:
  sessionID  session id to export

Options:
  -o, --output      output file path
  -f, --format      output format
  [string] [choices: "markdown", "json"] [default: "markdown"]

Fixes: anomalyco#5426

Signed-off-by: Christian Stewart <christian@aperture.us>
@paralin paralin force-pushed the add-session-export branch from cf31fad to a1e439b Compare January 31, 2026 06:42
paralin added a commit to paralin/opencode that referenced this pull request Feb 23, 2026
opencode session export [sessionID]

export session transcript to file

Positionals:
  sessionID  session id to export

Options:
  -o, --output      output file path
  -f, --format      output format
  [string] [choices: "markdown", "json"] [default: "markdown"]

Fixes: anomalyco#5426

Signed-off-by: Christian Stewart <christian@aperture.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant