← Back to all projects

opencode

A terminal coding agent whose agents, models and permissions are all configuration, not code

OfficialMIT
Stars
223k
Forks
30k
Open issues
3.8k
Last commit
30 Oct 2026

What is opencode?

The distinguishing idea is that everything is declared rather than hard-wired: you define named agents in JSON or a markdown file, give each one its own model and its own per-tool permissions — allow, ask or deny for reading, editing and running commands — and switch between them with a keystroke. Two built-in primary agents ship this way, one with full access and one that asks before editing or running anything. It is MIT and provider-agnostic, but it moves fast and it recently changed hands, so old links and pinned versions go stale quickly.

What can you do with opencode?

  • Plan before it touches anything — The built-in plan agent is the same agent with edits and shell commands set to ask rather than allow, so you can work through an approach first and switch to the build agent with Tab once it looks right.
  • Define an agent in a markdown file — A file with a short front matter block — a description, whether it is a primary agent or a subagent — plus a system prompt is a complete agent definition, kept globally or committed alongside the project.
  • Set permissions per tool, per agent — Reading, editing, running commands and searching each take allow, ask or deny independently, which is how a review agent can be made structurally incapable of writing rather than merely instructed not to.
  • Hand narrow jobs to a subagent — Subagents are invoked by mention from within a session: a read-only one for searching the codebase, another for reading external documentation and dependencies, each on its own model.
  • Give it the same code intelligence you use — Language servers supply types, definitions and diagnostics to the agent, and MCP servers add outside tools, so its view of the project is not limited to reading files as text.

Before you choose opencode

  • The repository changed owner and now lives under a different organisation; older links, forks and documentation still pointing at the previous location are common and resolve by redirect rather than by being correct.
  • Releases are frequent and configuration keys have moved between versions, so a setup copied from a blog post is more likely to be stale here than with slower-moving agents.

Star history

21 Aug to 30 Oct · +23.4k

200k223k

Frequently asked questions

Is opencode free for commercial use?

opencode is released under the MIT licence — OSI-approved open source, which permits commercial use.

How can opencode be deployed?

opencode is available as Runs locally.