https://github.com/tokentopapp/agent-opencode
tokentop agent plugin for OpenCode — session parsing, credential discovery, and real-time cost tracking
https://github.com/tokentopapp/agent-opencode
agent ai bun opencode tokentop tokentop-plugin typescript
Last synced: about 2 months ago
JSON representation
tokentop agent plugin for OpenCode — session parsing, credential discovery, and real-time cost tracking
- Host: GitHub
- URL: https://github.com/tokentopapp/agent-opencode
- Owner: tokentopapp
- License: mit
- Created: 2026-02-14T14:51:47.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-04-22T19:59:30.000Z (about 2 months ago)
- Last Synced: 2026-04-22T21:32:44.705Z (about 2 months ago)
- Topics: agent, ai, bun, opencode, tokentop, tokentop-plugin, typescript
- Language: TypeScript
- Homepage: https://github.com/tokentopapp/tokentop
- Size: 117 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# @tokentop/agent-opencode
[](https://www.npmjs.com/package/@tokentop/agent-opencode)
[](https://github.com/tokentopapp/agent-opencode/actions/workflows/ci.yml)
[](LICENSE)
[tokentop](https://github.com/tokentopapp/tokentop) agent plugin for **OpenCode**. Parses session data from both SQLite and JSON storage, reads multi-provider credentials, and provides real-time activity monitoring.
## Capabilities
| Capability | Status |
|-----------|--------|
| Session parsing | Yes (SQLite + JSON fallback) |
| Credential reading | Yes (multi-provider) |
| Real-time tracking | Yes |
| Multi-provider | Yes |
## How It Works
This plugin reads OpenCode's local data to extract:
- **Sessions** — parsed from SQLite database (`~/.local/share/opencode/opencode.db`) with automatic JSON fallback for older installs
- **Credentials** — reads OAuth tokens and API keys from `~/.local/share/opencode/auth.json` and provider config from `~/.config/opencode/config.json`
- **Provider discovery** — detects configured providers (Anthropic, OpenAI, Google Gemini, GitHub Copilot, OpenRouter, Antigravity, OpenCode Zen)
- **Real-time monitoring** — watches for session file changes to update the dashboard live
## Install
This plugin is **bundled with tokentop** — no separate install needed. If you need it standalone:
```bash
bun add @tokentop/agent-opencode
```
## Requirements
- [OpenCode](https://opencode.ai) installed
- [Bun](https://bun.sh/) >= 1.0.0
- `@tokentop/plugin-sdk` ^1.0.0 (peer dependency)
## Permissions
| Type | Access | Paths |
|------|--------|-------|
| Filesystem | Read | `~/.local/share/opencode`, `~/.config/opencode` |
## Development
```bash
bun install
bun run build
bun test
bun run typecheck
```
## Contributing
See the [Contributing Guide](https://github.com/tokentopapp/.github/blob/main/CONTRIBUTING.md). Issues for this plugin should be [filed on the main tokentop repo](https://github.com/tokentopapp/tokentop/issues/new?template=bug_report.yml&labels=bug,agent-opencode).
## License
MIT