opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(opencode): add session view to print a transcript

Open molloyzak13 opened this issue 5 months ago • 1 comments

Issue for this PR

Closes #32264

Type of change

  • [x] New feature

What does this PR do?

opencode session list lists sessions but there is no way to read one from the terminal. This adds opencode session view [sessionID] - it renders a session as a Markdown transcript to stdout, paged through less when interactive. It defaults to the most recent session and takes --no-reasoning / --no-tools to trim output. It sits next to session list / session delete in the same command group and reuses Session.Service (get + messages), the same service export uses.

How did you verify your code works?

Ran bun dev against a real session: session view <id>, session view (picks the most recent, prints which on stderr), --no-tools --no-reasoning, and a bad id (prints Session not found). tsc --noEmit is clean. I also hit a yargs gotcha where options named no-* collide with yargs built-in boolean negation, and fixed it by using positive reasoning/tools booleans defaulting to true.

Screenshots / recordings

Not a UI change (CLI output).

Checklist

  • [x] I have tested my changes locally
  • [x] I have not included unrelated changes in this PR

molloyzak13 avatar Jun 14 '26 03:06 molloyzak13

Thanks for updating your PR! It now meets our contributing guidelines. :+1:

github-actions[bot] avatar Jun 14 '26 04:06 github-actions[bot]

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

github-actions[bot] avatar Jul 14 '26 22:07 github-actions[bot]