feat: add session-context support for Copilot CLI and opencode#273
Merged
Conversation
Extend the `session-context` command with two new subcommands: - `session-context copilot` — reads Copilot CLI session transcripts from `~/.copilot/session-state/`, matching sessions by workspace `cwd` field via `workspace.yaml` + `events.jsonl` - `session-context opencode` — reads opencode session transcripts from `~/.local/share/opencode/storage/`, matching sessions by project `path` field in session metadata + individual message JSON files Both support `--max-entries` and `--session-id` options, following the existing Cursor subcommand pattern. Also: - Add `copilotSessionStateDir()` and `opencodeStorageDir()` path helpers - Export shared utilities (TranscriptEntry, getContentPreview, RELEVANT_ROLES) from session-context.ts for reuse by per-editor reader modules - Split new readers into separate files to stay under max-lines lint rule - Update EN and pt-br reference docs with new subcommand sections Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Deploying archgate-cli with
|
| Latest commit: |
61503cf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e9bb86f2.archgate-cli.pages.dev |
| Branch Preview URL: | https://feat-session-context-copilot.archgate-cli.pages.dev |
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Summary
session-context copilotsubcommand — reads Copilot CLI session transcripts from~/.copilot/session-state/, matching sessions bycwdfield inworkspace.yamland parsingevents.jsonlsession-context opencodesubcommand — reads opencode session transcripts from~/.local/share/opencode/storage/, matching sessions by projectpathfield in session metadata and reading individual message JSON filescopilotSessionStateDir()andopencodeStorageDir()path resolution helpersTranscriptEntry,getContentPreview,RELEVANT_ROLES) fromsession-context.tsfor reuse by per-editor reader modulesThis closes the gap noted in
build-opencode-plugin.tswheresession-context opencodewas referenced but didn't exist yet.Test plan
bun run validatepasses (lint, typecheck, format, 728 tests, 23/23 ADR checks, build)session-context claude-codestill works (verified with live session)session-context copilotreturns proper error when no matching sessions existsession-context copilotfinds sessions bycwdmatch (verified with real~/.copilot/session-state/)session-context opencodereturns proper error when storage is emptysession-context --helpshows all 4 subcommands