An open API service indexing awesome lists of open source software.

https://github.com/srmdn/opcode-kit

Small Unix-style helpers for OpenCode sessions and account switching
https://github.com/srmdn/opcode-kit

account-switching cli developer-tools opencode productivity session-history shell sqlite

Last synced: about 16 hours ago
JSON representation

Small Unix-style helpers for OpenCode sessions and account switching

Awesome Lists containing this project

README

          

# opcode-kit

Small Unix-style helpers for OpenCode workflows.

## Tools

### `opcode-last`

- find recent OpenCode sessions for current directory
- preview session context before resume
- reopen intended session without guessing

Compatibility alias:

- `oc-last` still works and forwards to `opcode-last`

### `opcode-switch`

- switch between local OpenCode accounts
- save current auth as named profile
- activate another account without editing auth files by hand

## Install

Install all tools:

```bash
curl -fsSL https://raw.githubusercontent.com/srmdn/opcode-kit/main/install.sh | bash
```

Install `opcode-last` only:

```bash
curl -fsSL https://raw.githubusercontent.com/srmdn/opcode-kit/main/install.sh | bash -s -- opcode-last
```

Install `opcode-switch` only:

```bash
curl -fsSL https://raw.githubusercontent.com/srmdn/opcode-kit/main/install.sh | bash -s -- opcode-switch
```

Install from local checkout:

```bash
./install.sh
```

Install one tool from local checkout:

```bash
./install.sh opcode-last
```

Requires:

- `bash`
- [OpenCode](https://opencode.ai/)

Tool-specific notes:

- `opcode-last` needs `sqlite3`
- `opcode-switch --verify` needs `opencode` on `PATH`
- `install.sh` with no args installs all tools in `bin/`
- `install.sh ` installs one tool only

## Quick Start

Session recovery:

```bash
opcode-last
opcode-last --show 1
opcode-last --open 1
opcode-last --recent
```

Account switching:

```bash
opcode-switch
opcode-switch --save personal
opcode-switch work
opcode-switch --verify
```

## Example Output

```text
$ oc-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-last --show N
opcode-last --open N
```

## Why This Exists

OpenCode keeps local session history, but finding the right session later is not always easy.

Common failure mode:

- a session still exists
- the user knows useful context is still somewhere in local history
- built-in session discovery is not enough to quickly find and resume the right one

`opcode-kit` exists to fill gaps like that with small, inspectable command-line tools.

## Repo Shape

`opcode-kit` is a small monorepo toolbox.

Each tool is a standalone executable in `bin/`, with focused docs in `docs/`.

```text
opcode-kit/
README.md
LICENSE
install.sh
bin/
opcode-last
oc-last
opcode-switch
...
docs/
oc-last.md
opcode-switch.md
...
```

Shared repo, separate commands. No heavy framework, no package-manager lock-in.

## Principles

- keep tools small
- keep tools readable
- prefer direct shell workflows
- avoid unnecessary dependencies
- solve real OpenCode workflow problems

## Docs

- [docs/oc-last.md](docs/oc-last.md)
- [docs/opcode-switch.md](docs/opcode-switch.md)

## License

MIT