OpenCode: Open-Source AI Coding Agent for the Terminal
What OpenCode is
OpenCode is an open-source AI coding agent. Its README sums it up in one line, "The open source AI coding agent", and the documentation says it is available as a terminal-based interface, a desktop app or an IDE extension. The core experience is the terminal UI: you run opencode inside a project, describe what you want in plain language, and the agent reads files, searches the codebase, runs shell commands and edits code on your behalf.
The project is aimed at developers who want an agentic coding workflow without being tied to one model vendor. According to the providers documentation, OpenCode uses the AI SDK and Models.dev to support 75+ LLM providers, and it can also run local models. The same interface therefore works with a hosted API, a company gateway or a model served on your own machine. The repository is MIT-licensed and written mainly in TypeScript.
How it works
OpenCode is organised around four ideas: agents, tools, permissions and providers.
Agents
The docs describe two built-in primary agents that you switch between with the Tab key. build is the default, with all tools enabled, for normal development work. plan is a restricted agent for analysis and planning: by default it denies file edits, writes and patches outside its own plan directory (~/.opencode/plan/) and can use the question tool to ask clarifying questions.
Alongside them sit subagents. general has full tool access and is meant for multi-step work that can run in parallel; it can be invoked with @general in a message. explore is a fast, read-only agent for finding files and code. scout is a read-only agent for external docs and dependency research that can clone a dependency repository into OpenCode's managed cache without touching your workspace. Hidden system agents handle compaction of long context, session titles and session summaries.
Tools
The built-in tools listed in the docs are shell, edit (exact string replacement), write, read, grep, glob, apply_patch, skill (loads a SKILL.md file), webfetch, websearch and question, plus an experimental lsp tool for definitions, references, hover and call hierarchy. Internally grep and glob use ripgrep, which respects .gitignore; a .ignore file in the project root can re-include paths. You can add your own functions as custom tools or connect MCP servers.
Permissions and providers
Every action resolves to allow, ask or deny, configured in opencode.json globally, per tool, or with wildcard rules on the tool input (for example allowing git * while denying rm *). Provider credentials added with the /connect command are stored in ~/.local/share/opencode/auth.json, and each provider can be customised in the config, including a baseURL override for proxies or custom endpoints.
Key features
- Provider-agnostic: the provider directory in the docs covers hosted services such as Anthropic, OpenAI, Amazon Bedrock and GitHub Copilot, as well as local runtimes such as Ollama, LM Studio and llama.cpp.
- Plan and build modes: plan a change in a restricted agent, iterate on the plan, then switch to build with
Tabto apply it. - Project memory file:
/initanalyses the project and creates anAGENTS.mdfile in the root, which the docs recommend committing to Git. - Undo and redo:
/undoreverts the agent's changes and restores your original message;/redore-applies them, and both can be repeated. - File and image context:
@fuzzy-searches files to reference in a prompt, and images can be dragged into the terminal as references. - Granular permissions: per-tool and per-pattern rules, per-agent overrides, and an
--automode that approves anything not explicitly denied. - Extensibility: custom tools, MCP servers, skills, custom commands, themes, keybinds and code formatters.
- Several surfaces: terminal UI, a desktop app (in beta) for macOS, Windows and Linux, and IDE integration.
Getting started
The README lists these installation options:
# YOLO
curl -fsSL https://opencode.ai/v2/install | bash
# Package managers
npm i -g @opencode/cli@latest # or bun/pnpm/yarn
brew install anomalyco/tap/opencode-v2 # macOS and Linux (recommended, always up to date)
brew install opencode # macOS and Linux (official brew formula, updated less)
sudo pacman -S opencode # Arch Linux (Stable)
paru -S opencode-beta # Arch Linux (Latest from AUR)
mise use -g opencode # Any OS
nix run github:anomalyco/opencode # Nix
The desktop app can be installed on macOS with Homebrew:
brew install --cask opencode-desktop
After connecting a provider with /connect, go to a project and start the agent:
cd /path/to/project
opencode
Then run /init in the TUI so OpenCode can analyse the project and write AGENTS.md. To change how much the agent may do without asking, add a permission block to opencode.json, for example:
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"*": "ask",
"shell": "allow",
"edit": "deny"
}
}
Use cases
- Onboarding to an unfamiliar codebase: ask how a part of the system works, referencing files with
@, using the read-only explore agent or plan mode so nothing is changed. - Feature work with a review step: describe a feature in plan mode, refine the plan, then switch to build to implement it, with
/undoas a safety net. - Teams with mixed model access: one tool that can point at a corporate gateway through
baseURL, a cloud provider or a local Ollama or LM Studio server. - Locked-down environments: deny edits or shell commands globally and allow only specific command patterns such as
git *. - Scripted runs: the permissions docs show
opencode run --auto "Refactor this module"for non-interactive use, with explicit deny rules still enforced.
How it compares
The README does not include a comparison table. OpenCode sits in the same category as other terminal coding agents such as Claude Code and Codex CLI. The differences its own documentation emphasises are model choice (75+ providers plus local models through one interface), an MIT licence for the whole client, and a configurable agent system with separate plan, build, explore and scout roles. Which agent produces better changes depends mostly on the model behind it, so the practical comparison is about workflow, permissions and provider flexibility rather than raw code quality.
Things to know before adopting
- Two major versions: the README's install commands target OpenCode 2 (the
/v2/installscript and the@opencode/clinpm package). The docs note that OpenCode 1 and OpenCode 2 both use theopencodecommand and cannot be installed side by side under their default command, and the README says to remove versions older than 0.1.x before installing. - Permissive defaults: the tools docs say all tools are enabled by default and do not need permission to run. Plan mode blocks edits but does not restrict shell commands by default, and a global
"edit": "allow"or"*": "allow"rule also applies to Plan. Set permissions explicitly if that matters to you. - Web search leaves the machine:
websearchis only available with the OpenCode or OpenCode Go provider or whenOPENCODE_ENABLE_EXAorOPENCODE_ENABLE_PARALLELis set, and it calls a hosted MCP service. - Optional paid service: the intro docs recommend OpenCode Zen, a curated list of tested models that requires signing in and adding billing details. It is optional; any other provider can be used instead.
- Windows: the docs recommend WSL for the best experience, and installing with Bun on Windows is still in progress. The desktop app is labelled beta.
- Naming: the README asks projects that use "opencode" in their name to state that they are not built by or affiliated with the OpenCode team, so third-party add-ons are common and worth checking.
- Licence: MIT, which allows commercial use and modification with attribution.
Project activity
As of October 2026 the repository has about 217,000 stars. It was created in April 2025, is written mainly in TypeScript, uses dev as its default branch and is licensed under MIT, with commits landing as recently as October 19, 2026. Documentation is at opencode.ai/docs, the source is at github.com/anomalyco/opencode, and the project homepage is opencode.ai.
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/anomalyco/opencode
GitHub - anomalyco/opencode: OpenCode: Open-Source AI Coding Agent for the Terminal
OpenCode is an MIT-licensed AI coding agent with a terminal UI, desktop app and IDE extension. It supports 75+ LLM providers and local models, with plan and bui...
github - anomalyco/opencode
Related Projects
Maintain OpenCode: Open-Source AI Coding Agent for the Terminal? Add the badge to your README
Show that the project is featured on TechLogHub and send readers to this write-up.
[](https://techloghub.com/open-source/opencode?utm_source=techloghub_badge&utm_medium=referral&utm_campaign=readme)
