{"id":50922860,"url":"https://github.com/gfarb/copilot-session-manager","last_synced_at":"2026-06-16T20:30:43.895Z","repository":{"id":363195751,"uuid":"1260619039","full_name":"gfarb/copilot-session-manager","owner":"gfarb","description":"Browse, search, resume, and clean up your GitHub Copilot CLI sessions from a terminal UI.","archived":false,"fork":false,"pushed_at":"2026-06-07T20:31:04.000Z","size":1686,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T22:20:47.850Z","etag":null,"topics":["copilot","copilot-cli"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfarb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-05T17:30:06.000Z","updated_at":"2026-06-07T22:07:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gfarb/copilot-session-manager","commit_stats":null,"previous_names":["gfarb/copilot-session-manager"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gfarb/copilot-session-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fcopilot-session-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fcopilot-session-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fcopilot-session-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fcopilot-session-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfarb","download_url":"https://codeload.github.com/gfarb/copilot-session-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fcopilot-session-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34423213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["copilot","copilot-cli"],"created_at":"2026-06-16T20:30:40.791Z","updated_at":"2026-06-16T20:30:43.872Z","avatar_url":"https://github.com/gfarb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🗂️\u0026nbsp;\u0026nbsp;`csm`\n\n### Copilot Session Manager\n\n***Browse, search, resume, and clean up your GitHub Copilot CLI sessions from a terminal UI.***\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/gfarb/copilot-session-manager/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/gfarb/copilot-session-manager?style=for-the-badge\u0026color=212\u0026logo=github\" alt=\"latest release\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/platform-macOS-000?style=for-the-badge\u0026logo=apple\" alt=\"macOS\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/built%20with-Go-00ADD8?style=for-the-badge\u0026logo=go\" alt=\"Go\"\u003e\n  \u003ca href=\"https://github.com/charmbracelet/bubbletea\"\u003e\u003cimg src=\"https://img.shields.io/badge/powered%20by-Bubble%20Tea-FF75B7?style=for-the-badge\" alt=\"Bubble Tea\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n![csm demo](docs/demo.gif)\n\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003e [!TIP]\n\u003e `csm` → fuzzy-search your sessions → \u003ckbd\u003eenter\u003c/kbd\u003e to resume → \u003ckbd\u003eo\u003c/kbd\u003e to open files → \u003ckbd\u003ed\u003c/kbd\u003e to delete.\n\n---\n\n## Why this exists\n\nCopilot CLI stores every session locally on disk: a SQLite database plus per-session folders with event logs, generated artifacts, checkpoints, and plan files.\n\nThere's no built-in way to browse any of it. `csm` gives you:\n\n| | |\n|---|---|\n| 🔍 **Find** | Fuzzy-search across summaries, repos, branches, file paths, refs, and messages |\n| 📂 **Browse** | Files the assistant touched, parsed from `events.jsonl` |\n| 🎨 **Open** | Artifacts, plans, and checkpoints directly from the TUI |\n| ⏪ **Resume** | One keystroke, correct cwd, clean handoff to `copilot --resume` |\n| 🗑️ **Delete** | Hard-delete with safety checks (refuses to delete active sessions) |\n| 🚀 **Integrate** | `/session-manager` slash command launches `csm` from inside Copilot CLI |\n\n---\n\n## Install\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/gfarb/copilot-session-manager/main/scripts/install.sh | bash\n```\n\nThe installer downloads the latest release binary and the `/session-manager` slash command extension:\n\n| What | Where |\n|---|---|\n| `csm` binary | `~/.local/bin/csm` (override with `INSTALL_DIR`) |\n| Slash command | `~/.copilot/extensions/csm/extension.mjs` |\n\n\u003e [!IMPORTANT]\n\u003e Make sure `~/.local/bin` is on your `PATH`. The installer verifies the download against a published `sha256` sidecar.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuild from source\u003c/strong\u003e\u003c/summary\u003e\n\nRequires **Go 1.26+**.\n\n```sh\ngit clone https://github.com/gfarb/copilot-session-manager\ncd copilot-session-manager\ngo build -o ~/.local/bin/csm .\n\n# (optional) slash command\nmkdir -p ~/.copilot/extensions/csm\ncp extension/extension.mjs ~/.copilot/extensions/csm/extension.mjs\n```\n\n\u003c/details\u003e\n\nVerify it works:\n\n```sh\ncsm -h\ncsm list | head -3\n```\n\n---\n\n## Keyboard Shortcuts\n\nTwo-pane layout: session list on the left, tabbed preview on the right.\n\n#### Navigation\n\n| Key | Action |\n|---|---|\n| \u003ckbd\u003e↑\u003c/kbd\u003e \u003ckbd\u003e↓\u003c/kbd\u003e / \u003ckbd\u003ej\u003c/kbd\u003e \u003ckbd\u003ek\u003c/kbd\u003e | Move through the list |\n| \u003ckbd\u003e/\u003c/kbd\u003e | Fuzzy filter (searches summary, repo, branch, cwd, file paths, refs, and user messages) |\n| \u003ckbd\u003eenter\u003c/kbd\u003e | **Resume** the session (`chdir` + `copilot --resume`) |\n| \u003ckbd\u003ed\u003c/kbd\u003e | **Delete** the session (confirm with \u003ckbd\u003ey\u003c/kbd\u003e) |\n| \u003ckbd\u003ec\u003c/kbd\u003e / \u003ckbd\u003eC\u003c/kbd\u003e | Copy session **id** / **cwd** to clipboard |\n| \u003ckbd\u003e1\u003c/kbd\u003e \u003ckbd\u003e2\u003c/kbd\u003e \u003ckbd\u003e3\u003c/kbd\u003e \u003ckbd\u003e4\u003c/kbd\u003e | Jump to tab |\n| \u003ckbd\u003e[\u003c/kbd\u003e / \u003ckbd\u003e]\u003c/kbd\u003e | Cycle tabs |\n| \u003ckbd\u003etab\u003c/kbd\u003e | Swap focus between list and preview |\n| \u003ckbd\u003e?\u003c/kbd\u003e | Toggle key hints |\n| \u003ckbd\u003eq\u003c/kbd\u003e / \u003ckbd\u003ectrl-c\u003c/kbd\u003e | Quit |\n\n#### Files tab\n\nFiles found in session metadata and tool events:\n\n| Badge | Meaning |\n|---|---|\n| `[plan]` | Session plan (`plan.md`) |\n| `[artifact]` | Generated files in `files/` |\n| `[checkpoint]` | Checkpoint files |\n| `[view]` `[edit]` `[create]` | Workspace files parsed from `events.jsonl` |\n\nPaths are displayed relative to the session's cwd when possible:\n\n```text\n./pkg/quota/limiter.go         \u003c- inside the session's cwd\n~/other-repo/foo.go            \u003c- outside cwd, inside $HOME\n/etc/hosts                     \u003c- absolute path\nfiles/dashboard.json           \u003c- session artifact\n```\n\n| Key | Action |\n|---|---|\n| \u003ckbd\u003eo\u003c/kbd\u003e | Open with macOS default app |\n| \u003ckbd\u003eO\u003c/kbd\u003e | Reveal in Finder |\n| \u003ckbd\u003ev\u003c/kbd\u003e | Open in VS Code |\n| \u003ckbd\u003ee\u003c/kbd\u003e | Open in `$EDITOR` (TUI suspends, resumes on exit) |\n| \u003ckbd\u003ey\u003c/kbd\u003e | Copy full path |\n\n#### Refs tab\n\nPRs, issues, commits, and other GitHub URLs mentioned in the session, parsed from `events.jsonl`.\n\n| Key | Action |\n|---|---|\n| \u003ckbd\u003eo\u003c/kbd\u003e | Open URL in browser |\n| \u003ckbd\u003ey\u003c/kbd\u003e | Copy URL |\n\n#### Overview \u0026 Turns\n\n- **Overview** (\u003ckbd\u003e1\u003c/kbd\u003e): IDs, dates, summary, first/last user message\n- **Turns** (\u003ckbd\u003e4\u003c/kbd\u003e): Scrollable conversation history with timestamps\n\n---\n\n## `/session-manager` Slash Command\n\nType this inside any live Copilot CLI session:\n\n```\n/session-manager\n```\n\n`csm` opens in a new terminal window (Ghostty, iTerm, or Terminal.app, detected via `TERM_PROGRAM`). Your active session keeps running undisturbed.\n\nPass args through:\n\n```\n/session-manager --print\n```\n\n---\n\n## CLI Subcommands\n\n```sh\ncsm                  # interactive TUI (default)\ncsm --print          # TUI, but enter prints \"\u003ccwd\u003e\\t\u003cid\u003e\" to stdout\ncsm list             # TSV dump: id, display-line, search-blob\ncsm preview \u003cid\u003e     # human-readable session detail\ncsm -h               # help\n```\n\n`--print` is useful for shell scripts:\n\n```sh\nread -r CWD ID \u003c \u003c(csm --print)\necho \"picked $ID in $CWD\"\n```\n\n---\n\n## Configuration\n\nAll optional. Everything works out of the box.\n\n| Env var | Default | What it does |\n|---|---|---|\n| `CSM_DB` | `~/.copilot/session-store.db` | Session database path |\n| `CSM_SESSION_STATE` | `\u003cCSM_DB-dir\u003e/session-state` | Session state directory |\n| `CSM_BIN` | `csm` | Binary the slash command launches |\n| `EDITOR` | `vi` | Editor for the \u003ckbd\u003ee\u003c/kbd\u003e action |\n| `INSTALL_DIR` | `~/.local/bin` | Where the installer puts the binary |\n| `CSM_VERSION` | `latest` | Pin a specific release tag |\n\n---\n\n## How it works\n\n- **SQLite** - reads from `~/.copilot/session-store.db` via [`modernc.org/sqlite`](https://gitlab.com/cznic/sqlite) (pure Go, no CGo). A read-only connection handles queries; a separate writable connection is opened only for deletes.\n- **Events parser** - scans `events.jsonl` line by line so multi-megabyte payloads don't silently truncate.\n- **Resume** - on \u003ckbd\u003eenter\u003c/kbd\u003e, the TUI exits, `os.Chdir`s to the session's cwd, then `syscall.Exec`s `copilot --resume=\u003cid\u003e`. The process is replaced in one move. `chdir` failure is fatal to prevent resuming in the wrong directory.\n- **Delete** - a single transaction across all session tables, then `os.RemoveAll` on the session-state folder. Refuses if `inuse.*.lock` is present. Tolerates schema drift across Copilot CLI versions.\n\n---\n\n## Development\n\n```sh\ngo build -o csm . \u0026\u0026 go test ./...\n./csm\n```\n\nIterating on the extension:\n\n```sh\n# Edit extension/extension.mjs, then:\ncp extension/extension.mjs ~/.copilot/extensions/csm/extension.mjs\n# In your live Copilot CLI session, /clear forces extension reload.\n```\n\nCutting a release: push a `v*` tag. The workflow at `.github/workflows/release.yml` cross-compiles darwin arm64/amd64 and attaches the archives to a GitHub Release.\n\n```sh\ngit tag v0.1.0\ngit push origin v0.1.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarb%2Fcopilot-session-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfarb%2Fcopilot-session-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarb%2Fcopilot-session-manager/lists"}