No description
  • TypeScript 68.6%
  • MDX 27.8%
  • CSS 3.1%
  • HTML 0.2%
  • JavaScript 0.1%
  • Other 0.1%
Find a file
Julian Nymark e11f048bff
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
config updates
2026-06-06 13:18:29 +02:00
.changeset feat(http-recorder): prepare public beta release (#31018) 2026-06-06 03:01:26 +00:00
.github feat(http-recorder): prepare public beta release (#31018) 2026-06-06 03:01:26 +00:00
.husky fix: update pre-push hook to allow caret version differences (#9876) 2026-01-21 14:40:01 -06:00
.opencode wip, rework and add sidebar customizability + toggle block for context 2026-06-06 11:43:56 +02:00
.zed app: refactor server management backend (#13813) 2026-02-18 23:03:24 +08:00
github fix(github): enforce existing git author identity (#30507) 2026-06-03 12:08:22 +05:30
infra fix(stats): serve stats og image from banner 2026-06-03 10:53:07 -05:00
nix chore: update nix node_modules hashes 2026-06-06 03:19:00 +00:00
packages WIP on the system context display 2026-06-06 13:05:43 +02:00
patches fix(opencode): patch empty Gemini replay messages (#30463) 2026-06-02 14:49:13 -05:00
perf Skip git setup for processor tool test (#28406) 2026-05-19 18:09:15 -04:00
script feat(core): add command registry (#30624) 2026-06-04 02:57:43 -04:00
sdks/vscode sync release versions for v1.16.2 2026-06-05 15:58:48 +00:00
specs fix(core): recover v2 context overflow (#31005) 2026-06-05 16:05:51 -04:00
.dockerignore feat: initial datalake and stats site (#28666) 2026-05-25 17:34:04 -05:00
.editorconfig chore: add .editorconfig (#536) 2025-06-29 21:12:58 -04:00
.gitattributes fix(opencode): enforce storage path invariants (#29666) 2026-06-02 00:54:41 +00:00
.gitignore fix(opencode): route SAP AI Core reasoning variants through modelParams (#30482) 2026-06-03 18:40:39 -05:00
.gitleaksignore Add native LLM core foundation (#24712) 2026-05-08 16:56:20 -04:00
.oxlintrc.json feat: enable type-aware no-misused-spread rule, fix 8 violations (#22749) 2026-04-16 03:50:50 +00:00
.prettierignore desktop: add more basic menu bar items 2026-02-06 18:10:48 +08:00
AGENTS.md feat(core): interrupt v2 session execution (#30850) 2026-06-05 16:06:40 +00:00
bun.lock feat(http-recorder): prepare public beta release (#31018) 2026-06-06 03:01:26 +00:00
bunfig.toml upgrade opentui to 0.3.2 (#30748) 2026-06-04 22:05:59 +02:00
CONTEXT.md feat(core): bound v2 tool output (#30999) 2026-06-05 14:35:19 -04:00
CONTRIBUTING.md docs: update desktop app references from Tauri to Electron (#25965) 2026-05-06 12:15:59 +08:00
flake.lock chore: update nix bun version (#23881) 2026-04-23 00:25:40 -04:00
flake.nix feat(nix): add opencode-electron derivation (#16163) 2026-05-15 23:20:48 -05:00
FORK.md wip, rework and add sidebar customizability + toggle block for context 2026-06-06 11:43:56 +02:00
install fix: baseline CPU detection (#13371) 2026-02-13 07:50:43 +10:00
LICENSE docs: cleanup casing 2025-06-20 15:35:25 -05:00
package.json feat(http-recorder): prepare public beta release (#31018) 2026-06-06 03:01:26 +00:00
README.ar.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.bn.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.br.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.bs.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.da.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.de.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.es.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.fr.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.gr.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.it.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.ja.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.ko.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.md config updates 2026-06-06 13:18:29 +02:00
README.no.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.pl.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.ru.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.th.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.tr.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.uk.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.vi.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.zh.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
README.zht.md ignore: cleanup readme (#28049) 2026-05-17 11:26:23 -05:00
screenshot-uk.png feat(i18n): add Ukrainian (uk) locale support (#28061) 2026-05-19 14:45:39 +08:00
SECURITY.md docs: add policy about AI-generated security reports 2026-02-18 09:15:18 -05:00
sst-env.d.ts feat: improve referral system (#29720) 2026-05-28 13:50:14 +02:00
sst.config.ts sync 2026-06-02 09:51:59 -04:00
STATS.md ignore: update download stats 2026-01-29 2026-01-29 12:07:50 +00:00
TODO.md wip, rework and add sidebar customizability + toggle block for context 2026-06-06 11:43:56 +02:00
tsconfig.json sync 2025-09-27 04:10:56 -04:00
turbo.json Add native LLM core foundation (#24712) 2026-05-08 16:56:20 -04:00

OpenCode logo

The open source AI coding agent.

Discord npm Build status


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

OpenCode Terminal UI


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 --single to 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.