Small Unix-style helpers for OpenCode workflows, as a single Go binary.
██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███████╗ ██╗ ██╗ ██╗ ████████╗ ██╔═══██╗ ██╔══██╗ ██╔════╝ ██╔═══██╗ ██╔══██╗ ██╔════╝ ██║ ██╔╝ ██║ ╚══██╔══╝ ██║ ██║ ██████╔╝ ██║ ██║ ██║ ██║ ██║ █████╗ █████╔╝ ██║ ██║ ██║ ██║ ██╔═══╝ ██║ ██║ ██║ ██║ ██║ ██╔══╝ ██╔═██╗ ██║ ██║ ╚██████╔╝ ██║ ╚██████╗ ╚██████╔╝ ██████╔╝ ███████╗ ██║ ██╗ ██║ ██║ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
opcode-kit switch manage local OpenCode accounts
opcode-kit last find and reopen OpenCode sessions
opcode-kit version show version
opcode-kit help show usage
Legacy compatibility wrappers (installed alongside):
opcode-switch→opcode-kit switch "$@"opcode-last→opcode-kit last "$@"
curl -fsSL https://raw.githubusercontent.com/srmdn/opcode-kit/main/install.sh | bashThis builds the binary from source and installs it plus both wrappers into ~/.local/bin (or $PREFIX/bin).
Selective installs:
curl -fsSL https://raw.githubusercontent.com/srmdn/opcode-kit/main/install.sh | bash -s -- opcode-kit
curl -fsSL https://raw.githubusercontent.com/srmdn/opcode-kit/main/install.sh | bash -s -- opcode-switch
curl -fsSL https://raw.githubusercontent.com/srmdn/opcode-kit/main/install.sh | bash -s -- opcode-lastFrom a local checkout:
./install.shRequires:
go(to build)- OpenCode
Tool-specific notes:
opcode-kit lastreads the local SQLite history, no networkopcode-kit switch --verifyneedsopencodeonPATH
Session recovery:
opcode-kit last
opcode-kit last --show 1
opcode-kit last --open 1
opcode-kit last --recentAccount switching:
opcode-kit switch
opcode-kit switch --save personal
opcode-kit switch work
opcode-kit switch --remove old-account
opcode-kit switch --verify--remove deletes the saved account and its matching OpenCode Go store entries while preserving other providers.
$ opcode-kit last
OpenCode sessions for:
/path/to/project
[1] Fix installer edge case
id: ses_abc123
dir: /path/to/project
updated: 2026-06-23 19:41:02
messages: 38
first user: make install.sh support one-tool installs too
last user: sanitize repo before first commit
last assistant: no confidential data found in tracked files...
Next:
opcode-kit last --show N
opcode-kit last --open N
$ opcode-kit switch
Available accounts:
→ personal
work
Usage: opcode-kit switch <name>
OpenCode keeps local session history, but finding the right session later is not always easy.
Common failure modes:
- a session still exists, but the user cannot remember which one has the useful context
- switching API accounts used to mean hand-editing auth files, and older tooling wrote a file OpenCode stopped reading
opcode-kit fixes both with small, inspectable commands.
go build ./...
go vet ./...
go test ./...The only external dependency is modernc.org/sqlite (pure-Go, no cgo) for reading session history.
opcode-kit/
README.md
LICENSE
AGENTS.md
install.sh
cmd/
opcode-kit/
main.go
internal/
switchcmd/
last/
docs/
opcode-switch.md
oc-last.md
- keep tools small
- keep tools readable
- prefer Go stdlib, one dependency max
- solve real OpenCode workflow problems
MIT