opencode-loader
v1.1.15
Published
TUI launcher and oc shell command for OpenCode.
Downloads
1,540
Readme
opencode-hub
TUI launcher and oc shell command for OpenCode.
When loaded as an OpenCode plugin, it installs the oc command into your shell. Running oc opens an interactive TUI for switching between projects and managing plugins.
Features
- Project list — shows recent OpenCode projects sorted by last used, with session counts
- Pin / Hide / Unhide — organize your project list
- Custom path — open any directory directly
- Change path — reassociate sessions when a project moves
- Plugin manager — view plugin status, toggle auto-update, force rebuild, downgrade to specific commits
- Auto-update OpenCode — checks for new
opencode-ainpm versions once per day - Centralized config — stores config in
config/oc-config.json, plugins inconfig/plugins.json <creator>/<repo>layout — plugin repos stored underrepos/<github-user>/<repo-name>to prevent collisions
Requirements
- Bun runtime (uses
bun:sqlitefor reading the OpenCode session database)
Installation
Option A — Via plugin-updater (recommended)
If you have opencode-plugin-updater installed, add this entry to ~/.config/opencode/config/plugins.json:
{
"name": "opencode-hub",
"url": "https://github.com/intisy/opencode-hub.git",
"install": null,
"build": null,
"bundle": null,
"output": "plugin.js",
"pluginFile": "oc-launcher.js",
"autoUpdate": true
}Restart OpenCode. The updater will clone the repo and deploy the plugin automatically.
Option B — npm
Add the package to your ~/.config/opencode/opencode.json:
{
"plugins": ["opencode-hub@latest"]
}Restart OpenCode.
Option C — Manual
mkdir -p ~/.config/opencode/repos/intisy/opencode-hub
git clone https://github.com/intisy/opencode-hub.git ~/.config/opencode/repos/intisy/opencode-hub
cp ~/.config/opencode/repos/intisy/opencode-hub/plugin.js ~/.config/opencode/plugins/oc-launcher.jsRegister the plugin in ~/.config/opencode/opencode.json:
{
"plugins": {
"oc-launcher": "./plugins/oc-launcher.js"
}
}How It Works
- On OpenCode startup — the plugin installs
oc(oroc.cmdon Windows) into~/.local/bin/ - When you run
oc— the TUI launcher opens, showing your projects and plugins - Select a project — the launcher
cds into the directory and startsopencode
The plugin also provides an oc_remove tool to uninstall the shell command.
Usage
oc # Launch TUI
oc 3 # Open project #3 directly
oc myproject # Open first project matching "myproject"Keyboard shortcuts
Projects tab
| Key | Action | |-----|--------| | ↑↓ / W S | Navigate | | Enter | Open action menu | | O | Open project | | P | Pin/Unpin | | H | Hide | | U | Unhide all | | C | Custom path | | ← → | Switch tabs | | Q | Quit |
Plugins tab
| Key | Action | |-----|--------| | ↑↓ / W S | Navigate | | Enter | Open action menu | | F | Fetch remote updates | | A | Toggle auto-update | | U | Update plugin | | Q | Quit |
License
MIT
