OpenCode plugin and platform reference for updating or removing code in agentic/src/modules.
Use this skill only when all are true:
/Users/michaljarnot/IdeaProjects/agentic/Users/michaljarnot/IdeaProjects/agentic/src/modules/**If these signals are missing, do not apply this skill.
Never load this skill for work outside /Users/michaljarnot/IdeaProjects/agentic/src/modules.
OpenCode is an open-source agentic AI coding assistant available as a terminal TUI, desktop app, and IDE extension. Built on a client/server architecture with a Bun/JS runtime and Hono HTTP server, it supports 75+ LLM providers via the AI SDK and Models.dev, and it ships with a sophisticated agent system, tool framework, MCP integration, and full-featured TUI. With over , 700 contributors, and 2.5M+ monthly users, it is the leading open-source alternative to proprietary coding agents.
OpenCode follows a client/server architecture. Running opencode starts both a TUI client and an internal HTTP server. The server can also run headless via opencode serve, enabling remote clients (desktop app, web interface, mobile). The server exposes a full OpenAPI 3.1 REST API at /doc, with a TypeScript SDK (@opencode-ai/sdk) generated via Stainless.
The system supports multi-session operation — multiple agents can run in parallel on the same project. Sessions persist in a SQLite database, and all processing happens locally or through direct provider API calls. OpenCode does not store code or context data on its servers; only the /share feature sends data externally.
Key architectural components include the AI SDK for provider-agnostic LLM interaction, ripgrep for file search operations (grep, glob, list), built-in LSP client integration for 30+ languages, an event bus for internal communication, and a plugin system for extensibility.
The install script is the fastest path:
curl -fsSL https://opencode.ai/install | bash
Package manager options include npm (npm install -g opencode-ai), bun (bun install -g opencode-ai), pnpm, yarn, Homebrew (brew install anomalyco/tap/opencode for latest releases; brew install opencode for official but less frequently updated formula), Arch Linux (sudo pacman -S opencode or paru -S opencode-bin), Scoop (scoop install opencode), Chocolatey (choco install opencode), Mise (mise use -g github:anomalyco/opencode), Nix (nix run nixpkgs#opencode), and Docker (docker run -it --rm ghcr.io/anomalyco/opencode). Binaries are also available from GitHub Releases. For Windows, WSL is recommended for best compatibility.
Prerequisites are a modern terminal emulator (WezTerm, Alacritty, Ghostty, Kitty) and API keys for at least one LLM provider.
OpenCode uses JSON/JSONC configuration files with schema validation at https://opencode.ai/config.json. A separate TUI config (tui.json, schema https://opencode.ai/tui.json) handles UI settings.
.well-known/opencode endpoint (organizational defaults)~/.config/opencode/opencode.jsonOPENCODE_CONFIG environment variableopencode.json in project root (discovered by traversing up to nearest Git directory).opencode directories — agents, commands, plugins, tools, themesOPENCODE_CONFIG_CONTENT environment variable{env:VARIABLE_NAME} — replaced at load time{file:path/to/file} — relative to config file location or absolute| Key | Type | Description |
|---|---|---|
$schema | string | "https://opencode.ai/config.json" |
model | string | Default model, format provider/model (e.g. "anthropic/claude-sonnet-4-5") |
small_model | string | Lightweight model for titles/summaries; defaults to gpt-5-nano via Zen |
default_agent | string | Default primary agent ("build" or "plan" or custom) |
autoupdate | boolean|"notify" | Auto-update behavior; true (default), false, or "notify" |
share | string | Sharing mode: "manual" (default), "auto", "disabled" |
provider | object | Custom provider configs with timeout, setCacheKey, options, models |
tools | object | Enable/disable tools globally by name (boolean values) |
permission | string|object | Permission config — "allow", or per-tool object with patterns |
agent | object | Agent definitions with description, model, prompt, tools, permission, temperature, top_p, mode, color, steps, hidden, disable |
command | object | Custom commands with template, description, agent, model, subtask |
instructions | array | Paths, globs, or URLs to instruction files (combined with AGENTS.md) |
compaction | object | { auto: true, prune: true, reserved: 10000 } |
watcher | object | { ignore: ["node_modules/**", "dist/**"] } |
mcp | object | MCP server definitions (local/remote) |
plugin | array | npm plugin packages to load |
formatter | object|false | Formatter configs per tool, or false to disable all |
lsp | object|false | LSP server configs, or false to disable all |
server | object | { port, hostname, mdns, mdnsDomain, cors } |
disabled_providers | array | Provider IDs to disable (takes priority) |
enabled_providers | array | Allowlist of providers |
experimental | object | Unstable options: chatMaxRetries, disable_paste_summary, hook |
Permissions control whether tool actions run automatically, prompt the user, or are blocked entirely. Three actions exist: "allow" (run without approval), "ask" (prompt user who can choose once/always/reject), and "deny" (block entirely).
Permissions can be set at four levels of specificity. Global shorthand ("permission": "allow") sets all tools. Per-tool ("permission": { "bash": "ask", "edit": "deny" }) targets individual tools. Wildcard ("*": "ask") provides a catch-all. Granular patterns allow per-command or per-path rules:
{
"permission": {
"bash": { "*": "ask", "git *": "allow", "rm *": "deny" },
"edit": { "*": "deny", "src/**/*.ts": "allow" }
}
}
Pattern matching uses * (zero or more characters) and ? (exactly one character). Last matching rule wins. Home directory expansion (~, $HOME) is supported.
| Key | Matches Against |
|---|---|
read | File path |
edit | All file modifications (edit, write, patch, multiedit) |
glob | Glob pattern |
grep | Regex pattern |
list | Directory path |
bash | Parsed commands (e.g. git status --porcelain) |
task | Subagent type |
skill | Skill name |
lsp | Non-granular |
todoread/todowrite | Non-granular |
webfetch | URL |
websearch/codesearch | Query |
external_directory | Paths outside project (default: "ask") |
doom_loop | Same tool call repeated 3× with identical input (default: "ask") |
Defaults: most permissions are "allow". The read tool denies .env files by default (*.env → deny, *.env.* → deny, *.env.example → allow). Agent-specific permissions merge with global config, with agent rules taking precedence.
OpenCode's agent system is its central architectural feature. Agents are specialized AI assistants with configurable prompts, models, tool access, and permissions. There are two types: primary agents (direct user interaction, switchable via Tab key) and subagents (invoked by primary agents or via @mention).
edit and bash set to "ask" by defaultAgents can be defined in opencode.json or as markdown files in .opencode/agents/ (project) or ~/.config/opencode/agents/ (global). The markdown filename becomes the agent name.
| Option | Description |
|---|---|
description | Required for custom agents; brief purpose description |
mode | "primary", "subagent", or "all" (default) |
model | Override model; format provider/model-id |
prompt | Custom system prompt; supports {file:./path} references |
temperature | 0.0–1.0; default varies by model (0 for most, 0.55 for Qwen) |
tools | Object enabling/disabling tools by name (booleans); supports wildcards |
permission | Per-agent permission overrides; merges with global config |
steps | Max agentic iterations before forced text-only response |
hidden | Boolean; hides subagent from @ autocomplete (still invokable by model) |
disable | Boolean; disables agent entirely |
color | Hex color or theme color name for UI |
top_p | Alternative diversity control (0.0–1.0) |
Any unrecognized options are passed through to the provider as model options (e.g., OpenAI's reasoningEffort).
Run opencode agent create for an interactive wizard, or create markdown files directly: