- TypeScript 68.6%
- MDX 27.8%
- CSS 3.1%
- HTML 0.2%
- JavaScript 0.1%
- Other 0.1%
|
Some checks failed
deploy / deploy (push) Has been cancelled
generate / generate (push) Has been cancelled
nix-eval / nix-eval (push) Has been cancelled
publish / version (push) Has been cancelled
test / unit (linux) (push) Has been cancelled
test / unit (windows) (push) Has been cancelled
test / e2e (linux) (push) Has been cancelled
test / e2e (windows) (push) Has been cancelled
typecheck / typecheck (push) Has been cancelled
publish / build-cli (push) Has been cancelled
publish / sign-cli-windows (push) Has been cancelled
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=arm64 host:macos-26 platform_flag:--mac --arm64 target:aarch64-apple-darwin]) (push) Has been cancelled
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=x64 host:macos-26-intel platform_flag:--mac --x64 target:x86_64-apple-darwin]) (push) Has been cancelled
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404 platform_flag:--linux target:x86_64-unknown-linux-gnu]) (push) Has been cancelled
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404-arm platform_flag:--linux --arm64 target:aarch64-unknown-linux-gnu]) (push) Has been cancelled
publish / build-electron (map[host:blacksmith-4vcpu-windows-2025 platform_flag:--win target:x86_64-pc-windows-msvc]) (push) Has been cancelled
publish / build-electron (map[host:windows-2025 platform_flag:--win --arm64 target:aarch64-pc-windows-msvc]) (push) Has been cancelled
publish / publish (push) Has been cancelled
|
||
|---|---|---|
| .changeset | ||
| .github | ||
| .husky | ||
| .opencode | ||
| .zed | ||
| github | ||
| infra | ||
| nix | ||
| packages | ||
| patches | ||
| perf | ||
| script | ||
| sdks/vscode | ||
| specs | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .gitleaksignore | ||
| .oxlintrc.json | ||
| .prettierignore | ||
| AGENTS.md | ||
| bun.lock | ||
| bunfig.toml | ||
| CONTEXT.md | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| FORK.md | ||
| install | ||
| LICENSE | ||
| package.json | ||
| README.ar.md | ||
| README.bn.md | ||
| README.br.md | ||
| README.bs.md | ||
| README.da.md | ||
| README.de.md | ||
| README.es.md | ||
| README.fr.md | ||
| README.gr.md | ||
| README.it.md | ||
| README.ja.md | ||
| README.ko.md | ||
| README.md | ||
| README.no.md | ||
| README.pl.md | ||
| README.ru.md | ||
| README.th.md | ||
| README.tr.md | ||
| README.uk.md | ||
| README.vi.md | ||
| README.zh.md | ||
| README.zht.md | ||
| screenshot-uk.png | ||
| SECURITY.md | ||
| sst-env.d.ts | ||
| sst.config.ts | ||
| STATS.md | ||
| TODO.md | ||
| tsconfig.json | ||
| turbo.json | ||
The open source AI coding agent.
This is a personal fork of anomalyco/opencode. It is not affiliated with the OpenCode team. Changes vs upstream are documented in FORK.md.
TUI changes in this fork:
- Configurable sidebar sections — hide MCP list, LSP list, and file-diff via
tui.json- Aggregated subagent (Task tool) token + cost totals in the Context sidebar widget
- Collapsible system context block inline in the session thread
Building from source
# Install dependencies
bun install
# Run directly without building (dev mode)
bun run dev
Installing the binary
Build a native binary for your platform and symlink it onto your PATH:
# Build (run from packages/opencode)
bun run build --single
# Symlink the output binary — update the filename to match your platform/arch
ln -sf "$(pwd)/dist/opencode-darwin-arm64" ~/.local/bin/opencode
# Verify
opencode --version
After pulling upstream changes, re-run
bun run build --singleto rebuild. The symlink points directly to the binary, so no re-linking needed.
Configuration
Two config files, both in ~/.config/opencode/:
| File | Purpose |
|---|---|
opencode.json |
Main config — model, providers, permissions, agents, MCP, plugins |
tui.jsonc |
TUI display settings only (theme, keybinds, sidebar, etc.) |
They are intentionally separate — upstream explicitly deprecated putting TUI keys inside opencode.json and migrates them out automatically. opencode.json is server/agent config; tui.jsonc is display/client config.
A project-level opencode.json at the repo root is merged on top of the global one and takes precedence.
Main config (~/.config/opencode/opencode.json)
{
"$schema": "https://opencode.ai/config.json",
// Default model
"model": "anthropic/claude-sonnet-4-5",
// Override the system prompt for a specific agent
"agent": {
"build": {
"prompt": "You are a focused coding agent. Be concise and direct."
}
}
}
The agent.prompt field replaces the built-in "You are OpenCode..." system prompt entirely for that agent. If omitted, the default prompt is chosen based on the model family (Anthropic, GPT, Gemini, etc.).
TUI config (~/.config/opencode/tui.jsonc)
{
"$schema": "https://opencode.ai/tui.json",
"sidebar": {
"show_file_diff": false, // hide Modified Files
"show_mcp": false, // hide MCP list
"show_lsp": false, // hide LSP list
"show_subagent_costs": true, // aggregate subagent token/cost in Context widget
"show_system_context": true // collapsible system context block in thread
}
}
AGENTS.md
Instruction files are loaded separately from the JSON config. OpenCode looks for AGENTS.md (or CLAUDE.md) walking up from the current directory to the repo root, plus ~/.config/opencode/AGENTS.md as a global fallback. These are appended to the system prompt, not a replacement for it.
Syncing with upstream
# Add upstream remote once
git remote add upstream git@github.com:anomalyco/opencode.git
# Pull upstream changes onto dev branch
git fetch upstream
git merge upstream/dev
Agents
OpenCode includes two built-in agents you can switch between with the Tab key.
- build - Default, full-access agent for development work
- plan - Read-only agent for analysis and code exploration
Learn more about agents.
Documentation
For more info on how to configure OpenCode, head over to our docs.
