feat(opencode): add session view to print a transcript#32265
Open
molloyzak13 wants to merge 1 commit into
Open
feat(opencode): add session view to print a transcript#32265molloyzak13 wants to merge 1 commit into
molloyzak13 wants to merge 1 commit into
Conversation
Adds `opencode session view [sessionID]` rendering a session as a Markdown transcript to stdout (paged when TTY). Defaults to the most recent session; --no-reasoning / --no-tools trim the output. Sits next to `session list` / `session delete`. Closes anomalyco#32264
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #32264
Type of change
What does this PR do?
opencode session listlists sessions but there is no way to read one from the terminal. This addsopencode session view [sessionID]- it renders a session as a Markdown transcript to stdout, paged throughlesswhen interactive. It defaults to the most recent session and takes--no-reasoning/--no-toolsto trim output. It sits next tosession list/session deletein the same command group and reusesSession.Service(get + messages), the same serviceexportuses.How did you verify your code works?
Ran
bun devagainst a real session:session view <id>,session view(picks the most recent, prints which on stderr),--no-tools --no-reasoning, and a bad id (printsSession not found).tsc --noEmitis clean. I also hit a yargs gotcha where options namedno-*collide with yargs built-in boolean negation, and fixed it by using positivereasoning/toolsbooleans defaulting to true.Screenshots / recordings
Not a UI change (CLI output).
Checklist