The OpenCode plugin adds Agentuity Coder agents, slash commands, and memory support to OpenCode. Use it to run Agentuity Coder inside OpenCode or from agentuity ai opencode run.
Installation
Install the plugin using the CLI:
agentuity ai opencode installThis command adds @agentuity/opencode to your global OpenCode config at ~/.config/opencode/opencode.json.
After installation, OpenCode loads:
- Agentuity Coder agents for planning, implementation, review, memory, and command execution
- slash commands for Agentuity Coder, Cadence, cloud services, sandboxes, and memory
- plugin tools for session dashboards and public memory sharing
To remove the plugin:
agentuity ai opencode uninstallAgents
The plugin registers agents by display name. Use these exact names when overriding models in opencode.json.
Coder Team
| Agent | Role | When to Use |
|---|---|---|
| Lead | Orchestrator | Entry point for /agentuity-coder, /agentuity-cadence, and headless runs |
| Scout | Explorer | Finding files, patterns, and codebase context (read-only) |
| Builder | Implementer | Interactive code changes, quick fixes, guided implementation |
| Architect | Autonomous Implementer | Cadence mode, complex multi-file features, long-running tasks |
| Reviewer | Code Reviewer | Reviewing changes, catching issues, suggesting fixes |
| Memory | Context Manager | Storing/retrieving context, decisions, patterns across sessions |
| Expert | Agentuity Specialist | CLI commands, cloud services, SDK questions |
| Runner | Command Executor | Run lint/build/test/typecheck/format, returns structured summaries |
| Product | Product Strategy | Clarifying requirements, validating scope, tracking PRD-style work |
Expert Subagents
The Expert agent can route deeper Agentuity questions to hidden specialist subagents:
| Agent | Focus |
|---|---|
| Expert Backend | Runtime, agents, schemas, Drizzle, Postgres, storage |
| Expert Frontend | React hooks, auth, browser integrations, frontend utilities |
| Expert Ops | CLI, cloud services, deployments, sandboxes |
The Lead agent coordinates most user-facing work and delegates to the right subagent through OpenCode's task system.
Builder vs Architect
| Aspect | Builder | Architect |
|---|---|---|
| Mode | Interactive | Autonomous |
| Best for | Quick fixes, guided work | Cadence mode, complex features |
| Default model | anthropic/claude-opus-4-6 | openai/gpt-5.3-codex |
| Default reasoning option | variant: "high" | reasoningEffort: "xhigh" |
| Context | Session-based | Checkpoint-based |
Use Builder for interactive changes and small implementation tasks. Use Architect for Cadence mode, complex multi-file features, and longer autonomous work.
Memory System
The Memory agent stores reusable context by entity type:
| Entity Type | Scope | Examples |
|---|---|---|
user | Cross-project | Your preferences, patterns, corrections |
project | Project-specific | Architecture decisions, codebase patterns |
repo | Cross-project | Repository conventions, commit styles |
agent | Cross-project | Agent-specific behaviors, model preferences |
Memory tracks conclusions, corrections, relationships, session summaries, and compaction history. The plugin stores this data in Agentuity Cloud Key-Value Storage and Vector Storage namespaces used by the Memory agent.
Use /agentuity-memory-save to explicitly save important context. Use /agentuity-memory-share when you want to create a public share URL for a session summary or saved memory content.
Model Configuration
Override any agent's model in opencode.json. See Agent Model Overrides for full configuration options.
Run opencode models to see all available models.
The plugin's default deny list blocks these command patterns: agentuity cloud secrets, agentuity cloud secret, agentuity cloud apikey, and agentuity auth token.
Slash Commands
The plugin adds slash commands for common Agentuity tasks:
| Command | Description |
|---|---|
/agentuity-coder | Run tasks with the full agent team (Lead orchestrates) |
/agentuity-cadence | Start a long-running autonomous loop |
/agentuity-cloud | Interact with any Agentuity cloud service |
/agentuity-sandbox | Run code in isolated sandbox environments |
/agentuity-memory-save | Save session context to memory |
/agentuity-memory-share | Share memory or session content with a public URL |
Use these commands by typing them directly in OpenCode:
/agentuity-coder Create a new agent that processes webhooks from Stripe
MCP Servers
The plugin works without extra MCP servers, but Scout and Expert are more useful when context7 and grep_app are configured in opencode.json.
{
"mcp": {
"context7": { "type": "remote", "url": "https://mcp.context7.com/mcp" },
"grep_app": { "type": "remote", "url": "https://mcp.grep.app" }
}
}| MCP | Purpose | Free Tier |
|---|---|---|
| context7 | Library docs lookup | 500 req/month |
| grep_app | GitHub code search | Unlimited |
The install command prints this recommendation, but it does not modify your MCP config automatically.
Headless Mode
Run Agentuity tasks from the command line without opening OpenCode:
agentuity ai opencode run "Create an agent that validates email addresses"This wraps opencode run --agent "Agentuity Coder Lead" and adds non-interactive instructions so the agents can continue without prompting you.
# Ask the team to use an Agentuity cloud sandbox for execution
agentuity ai opencode run --sandbox "run the test suite"
# Stream OpenCode's raw JSON events
agentuity ai opencode run --json "fix the failing auth test"Cadence Mode
Cadence enables long-running autonomous work sessions. Start it with the /agentuity-cadence slash command:
/agentuity-cadence Build a complete auth system with tests
Ask the Lead to adjust Cadence in natural language:
| Action | How |
|---|---|
| Start | /agentuity-cadence <task description> |
| Status | "what's the status?" |
| Pause | "pause" or "hold on" |
| Resume | "continue" or "resume" |
| Stop | "stop" or Ctrl+C |
For headless execution:
agentuity ai opencode run "/agentuity-cadence Build the feature"Tmux Integration
When running inside tmux, the plugin can spawn agent work into separate panes for a visible multi-agent layout.
Tmux integration requires OpenCode server mode. Start OpenCode with opencode --port 4096 or another port before using tmux panes.
Configure tmux settings in your Agentuity CLI profile (~/.config/agentuity/production.yaml by default):
coder:
tmux:
enabled: true
maxPanes: 6| Option | Default | Description |
|---|---|---|
enabled | false | Enable tmux pane spawning |
maxPanes | 4 | Max agent panes before rotating the oldest out |
mainPaneMinWidth | 100 | Minimum width for the main pane in columns |
agentPaneMinWidth | 40 | Minimum width for agent panes in columns |
When enabled, agents spawn in a dedicated Agents window with a tiled grid layout. Oldest panes close automatically when maxPanes is reached.
Plugin Tools
The plugin registers a small set of tools for the agents:
| Tool | Description |
|---|---|
agentuity_session_dashboard | Inspect a session tree from the local OpenCode SQLite database |
agentuity_memory_share | Create a public share URL for memory or session content through Agentuity Cloud Streams |
These are agent-facing tools. In normal use, call /agentuity-coder, /agentuity-memory-share, or /agentuity-cadence and let the Lead or Memory agent choose the tool.
Configuration
Agent models are configured in ~/.config/opencode/opencode.json. OpenCode reads plugin-provided agents and the agent entries in opencode.json, so you can override any Agentuity Coder agent by display name. Plugin behavior settings such as tmux live in your Agentuity CLI profile.
Agent Model Overrides
Override any agent's default model in opencode.json:
{
"agent": {
"Agentuity Coder Builder": {
"model": "anthropic/claude-opus-4-6",
"temperature": 0.7
},
"Agentuity Coder Architect": {
"model": "openai/gpt-5.3-codex",
"reasoningEffort": "xhigh"
}
}
}| Option | Description |
|---|---|
model | Model identifier (e.g., anthropic/claude-opus-4-6) |
temperature | Number between 0-1 (lower = more deterministic) |
reasoningEffort | For OpenAI: low, medium, high, xhigh |
variant | For Anthropic: low, medium, high, max (extended thinking) |
thinking | For Anthropic: { "type": "enabled", "budgetTokens": 10000 } |
maxSteps | Maximum tool use steps per turn |
| provider-specific options | Additional fields passed through by OpenCode, such as provider or model options |
Monitoring Sessions
View and inspect OpenCode coding sessions from the CLI.
Dashboard
Display an overview of recent sessions with status, message counts, active tools, costs, and todos:
agentuity ai opencode dashboard| Option | Description |
|---|---|
--watch | Continuously refresh the dashboard (press q to quit, r to refresh) |
--interval <seconds> | Refresh interval in watch mode (default: 5) |
--limit <n> | Maximum sessions to show (default: 10) |
--all | Show all sessions (overrides default limit) |
--since <duration> | Filter by recent activity (30m, 1h, 6h, 24h, 7d) |
--status <status> | Filter by status: active, idle, error, archived, compacting |
--search <query> | Search sessions by title (case-insensitive) |
--session <id> | Focus on a specific session tree |
--all-todos | Show all todos including completed (default: pending only) |
--json | Output as JSON |
# Watch active sessions updated in the last hour
agentuity ai opencode dashboard --watch --since 1h
# Only active sessions
agentuity ai opencode dashboard --status active
# Search by title
agentuity ai opencode dashboard --search "auth"
# 5 most recent idle sessions
agentuity ai opencode dashboard --limit 5 --status idle
# JSON output for scripting
agentuity ai opencode dashboard --jsonInspect
View detailed information about a specific session, including messages, active tools, recent tool history, todos, cost breakdown, and child sessions:
agentuity ai opencode inspect <session-id>agentuity ai opencode inspect ses_abc123
# JSON output
agentuity ai opencode inspect ses_abc123 --jsonDatabase Location
The dashboard and inspect commands require OpenCode v1.2.0+ with SQLite storage.
Both commands read from the local OpenCode SQLite database. The CLI searches standard platform locations automatically:
- macOS:
~/Library/Application Support/opencode/opencode.db - Linux:
~/.local/share/opencode/opencode.db - Windows:
%APPDATA%\opencode\opencode.db(fallback:%LOCALAPPDATA%\opencode\opencode.db)
Override the path with the OPENCODE_DB_PATH environment variable:
OPENCODE_DB_PATH=/path/to/opencode.db agentuity ai opencode dashboardNext Steps
- AI Commands: Other AI-related CLI commands
- Local Development: Run agents locally
- Creating Agents: Build your first agent