oc-sessions
v0.1.8
Published
A CLI for listing, inspecting, resuming, and deleting OpenCode sessions from the local session database.
Downloads
1,155
Readme
oc-sessions
oc-sessions installs the oc CLI, a small tool for listing, inspecting, resuming, and deleting OpenCode sessions from the local session database.
Requirements
- Node.js
^20.19.0 || ^22.12.0 || >=23 opencodeavailable in your shell
Install
From npm after publishing:
npm install -g oc-sessionsFrom Bun:
bun add -g oc-sessionsFor local development from this repository:
bun install
bun linkYou can also run the built CLI directly:
bun run build
node ./dist/cli/index.js listUsage
oc <command>
Commands:
new Start a new OpenCode session
resume, r [session] Launch opencode in the session directory
list, ls List root sessions across all projects
view, v <session> Show session metadata and recent text parts
rename, mv <session> <title...>
Rename a session title
delete, d <session> Delete the session via opencode after confirmation
projects, p List OpenCode projects and session counts
cleanup Clean stale OpenCode DB/cache artifacts
help Show CLI help
completion Print a fish completion scriptSession lookup
<session> is required for view, rename, and delete. [session] is optional for resume.
When a session value is provided, the CLI resolves it in this order:
- Exact session ID match
- Exact session title match
- Unique session title prefix match
- Unique session ID prefix match
Quick workflows
oc help
oc new
oc resume
oc list
oc projects
oc rename ses_abc123 "better title"
oc cleanup
oc cleanup --vacuumOptional Fish completions
If you use Fish, install a completion file into Fish's user completion directory:
mkdir -p ~/.config/fish/completions
oc completion fish > ~/.config/fish/completions/oc.fishOpen a new Fish shell after installing the file, or run:
source ~/.config/fish/completions/oc.fish