OpenCode Plugins
Complete guide to installing and using OpenCode plugins with Sincronizado.
Core Plugins (Standard Mode)
These plugins are installed by default in standard mode and higher.
opencode-direnv (simonwjackson)
Purpose: Automatically load environment variables from .envrc files when entering directories.
Installation:
# Included in VPS setup script
# Or install manually:
git clone https://github.com/simonwjackson/opencode-direnv.git ~/.config/opencode/plugins/direnv
Usage:
- Create
.envrcin project root:export API_KEY=secret123
export DATABASE_URL=postgres://localhost/db - Run
direnv allow - Variables auto-load when you enter the directory
agentmap (remorses)
Purpose: Tree view of codebase for better context in headless VPS environments.
Installation:
# Included in VPS setup script
git clone https://github.com/remorses/agentmap.git ~/.config/opencode/plugins/agentmap
Usage:
- Type
maportreein OpenCode to see project structure - Helps AI understand full codebase layout
opencode-sync (tctinh)
Purpose: Synchronize OpenCode settings and history across multiple machines via GitHub Gist.
Installation:
# Included in VPS setup script
git clone https://github.com/tctinh/opencode-sync.git ~/.config/opencode/plugins/sync
Setup:
- Create GitHub Personal Access Token with
gistscope - Run
opencode sync login - Enter your token
- Run
opencode sync pushto upload settings - On new machine:
opencode sync pull
ai-sessions-mcp (yoavf)
Purpose: Search and reference past OpenCode sessions.
Installation:
# Included in VPS setup script
git clone https://github.com/yoavf/ai-sessions-mcp.git ~/.config/opencode/plugins/ai-sessions
Usage:
search "previous work on auth"- Find relevant past sessionssession:last- Reference last session context
Session Management
ccmanager (kbwo)
Purpose: Visual session manager with real-time status indicators.
Installation:
# Included in VPS setup script (unless --no-ccmanager)
npm install -g @kbwo/ccmanager
Usage:
ccmanager- Launch interactive TUIccmanager list- List all sessions- Shows status: busy/waiting/idle per session
- Git worktree integration with session data copying
agent-of-empires (njbrake)
Purpose: Alternative session manager using tmux + git worktrees.
Installation:
# Install via VPS setup
sudo ./scripts/setup-vps.sh --with-agent-of-empires
# Or manually
curl -fsSL https://raw.githubusercontent.com/njbrake/agent-of-empires/main/install.sh | bash
Usage:
- TUI/CLI session manager
- Auto-creates worktrees per session
- Status dashboard
- Docker sandboxing option
Note: Mutually exclusive with ccmanager. Use --with-agent-of-empires --no-ccmanager to switch.
Optional Plugins (Full/Custom Mode)
opencode-worktree-session (felixAnhalt)
Purpose: Automatic Git worktree per OpenCode session with auto-cleanup.
Installation:
# Included in VPS setup with --with-worktree-session
npm install -g @tmegit/opencode-worktree-session
Configuration:
Add to opencode.json:
{
"plugin": ["@tmegit/opencode-worktree-session"]
}
Usage:
- Run
opencode - Prompt asks for branch suffix (e.g.,
feature-auth) - Plugin creates
opencode/feature-authbranch and worktree - AI works in isolated environment
- On exit: auto-commits changes, pushes branch, removes worktree
Benefits:
- No main branch pollution
- Each task in isolated branch
- Automatic cleanup
- Refuses to run on main branch (safety)
opencode-session-handoff (bristena-op)
Purpose: Seamless context continuation when sessions fill up.
Installation:
# Configure in opencode.json (plugin-based, no install needed)
Configuration:
Add to opencode.json:
{
"plugin": ["opencode-session-handoff"]
}
Usage:
- Session fills up (context limit reached)
- Say "handoff"
- Plugin creates new session with compact continuation prompt
- Context preserved across sessions
Critical for:
- Long-running tasks
- Mobile workflow (sessions fill faster on phone)
- Multi-device development
Plugin Configuration
Edit .opencode.config.json to enable/disable plugins:
{
"plugins": {
"enabled": ["opencode-direnv", "agentmap", "opencode-sync", "ai-sessions-mcp", "ccmanager"]
}
}
For npm-based plugins (worktree-session, session-handoff), add to opencode.json instead.
Troubleshooting
Plugin not loading
- Check plugin is in
~/.config/opencode/plugins/ - Verify plugin name matches enabled list in config
- Restart OpenCode session
- For npm plugins: verify global install with
npm list -g
sync plugin authentication fails
- Regenerate GitHub token with
gistscope - Run
opencode sync loginagain - Check token hasn't expired
direnv not loading
- Ensure
.envrcexists and is executable - Run
direnv allowafter creating/modifying - Check
.envrcsyntax is valid bash
worktree-session not activating
- Verify plugin installed:
npm list -g @tmegit/opencode-worktree-session - Check
opencode.jsonhas correct plugin path - Ensure you're not on main branch (plugin refuses to run there)
session-handoff not working
- Verify plugin configured in
opencode.json - Say "handoff" clearly (not "hand off" or "hand-off")
- Check if context actually filled (may need longer conversation)