OpenCode
opencode.ai- Category
- AI Agents
- Rank
- No. 121Tools index
- Listed in
- #7 Code with an agent · #7 Interface with your agents
- Pricing
- Open Source
- Type
- AGENT
- Use case
- Coding
- Interfaces
- CLI · Editor Extension · Desktop
- Builder
- anomalyco
- GitHub
- 220.7k stars
- Latest release
- v1.19.4
- Date
About
An open source AI coding agent that helps developers write code directly in their terminal, IDE, or desktop app. Supports 75+ LLM providers including Claude, GPT, and Gemini, with privacy-first design that doesn't store your code.
What it does
OpenCode is a command line assistant that pairs with a language model to read, edit, and run commands inside your own project. It ships two switchable modes: one with full file and shell access for building, and a read-only mode for exploring or planning that asks permission before every change. A separate helper handles multi-step searches on request. It also runs as a local server, so a companion client or script can drive the same session through a generated interface.
Why it's ranked here
The case here is breadth and discipline, not novelty. Permission rules that allow, deny, or ask per tool and per pattern are enforced in the same module that ships built-in auth plugins for a dozen-plus providers, not left to documentation. Internal style and terminology guides read like one team maintaining a single architecture over years, not a demo wrapped around a chat loop. MIT licensing and installers spanning every major platform round out a genuinely mature project, though it openly refuses to sandbox anything it executes.
What's good
Permission handling is genuinely granular: rules match by wildcard pattern and by tool, remember an always choice, and cascade to reject or approve other pending requests in the same session automatically. The plugin system ships built-in authentication for over a dozen providers out of the box, and the MCP client supports three transport types with OAuth handling built in, not bolted on. The SDK can embed the whole server in-process, skipping the network round trip for tooling that runs alongside it.
Tradeoffs
There is no sandbox: the maintainers say plainly that permission prompts are a user-experience aid, not isolation, so anyone running it against untrusted repositories should wrap it in a container or VM themselves. The internal architecture leans hard on a functional effect runtime with generator-based control flow throughout the server and plugin layers, a style that raises the learning curve for anyone used to plainer TypeScript. A long list of patched third-party dependencies also signals real friction under the hood, even if each patch is deliberate.
How to use it well
This suits developers who want a single agent they can point at real shell and file access under supervision, then flip to a read-only planning mode when exploring unfamiliar code before committing to a change. Turn on the general search subagent for broad codebase questions instead of burning the primary agent's context. If you expose the server beyond your own machine, set a server password yourself: it ships unauthenticated by default. It is not a sandboxed execution environment, so pair it with a container when running against code you do not trust.
Technical notes+
packages/opencode/src/index.ts wires a yargs based CLI exposing commands for run, serve, agent, mcp, github, session, plugin and more, while packages/cli/src/index.ts shows a second, Effect-based command runtime with its own daemon and lazily-imported handlers, indicating two coexisting CLI stacks in the same monorepo. packages/opencode/src/server/server.ts builds the HTTP listener on Effect's platform-node HttpServer with a port-fallback strategy that tries 4096 before any free port, plus optional mDNS publishing. packages/opencode/src/mcp/index.ts implements MCP client connections over StreamableHTTP and SSE transports with a dedicated OAuth provider and handling for servers that require dynamic client registration. packages/opencode/src/permission/index.ts implements the allow, deny, ask, and always rule engine with wildcard pattern matching built on Effect's Deferred primitive. packages/opencode/src/plugin/index.ts registers built-in auth plugins for Codex, GitHub Copilot, Modal, GitLab, Poe, Cloudflare, Azure, DigitalOcean, Snowflake Cortex, XAI, and Cerebras, alongside a loader for externally installed npm plugins. packages/sdk/js/src/index.ts exposes createOpencodeClient and createOpencodeServer plus a combined createOpencode helper, and packages/llm/src/index.ts centralizes the provider-agnostic LLM client, tool definitions, and tool runtime; packages/tui/src/index.tsx is a two-line re-export of the terminal UI's run function. package.json shows a Bun-managed workspace monorepo under the MIT license whose root test script deliberately exits with an error to force tests to run from package subdirectories. AGENTS.md and CONTEXT.md are unusually detailed internal style and domain-vocabulary documents (covering concepts like Context Epoch and Safe Provider-Turn Boundary) that govern how contributions are written, and LICENSE and SECURITY.md respectively confirm MIT terms and state plainly that there is no sandbox and that server mode ships unauthenticated unless a password variable is set.
Observed
- License
- Licensed under MIT.
- Language
- TypeScript codebase organized as a Bun-managed workspace monorepo across many internal packages.
- Interfaces
- Ships as a command-line tool, an HTTP server with a generated API client, an embeddable SDK, and an MCP client supporting stdio, SSE, and StreamableHTTP transports.
- Distribution
- Distributed through npm, Homebrew, Scoop, Chocolatey, pacman, the AUR, mise, and Nix, plus a separate desktop application packaged as dmg, exe, deb, rpm, and AppImage builds.
- Security posture
- Server mode requires an explicit password environment variable to enable authentication; it runs unauthenticated by default otherwise.
- Isolation model
- The project's own security documentation states the permission system is a user-experience feature, not a sandbox or isolation boundary.
- Test tooling
- The root package.json test script intentionally fails, forcing tests to be run from individual package directories rather than the repository root.
Read from README.md, package.json, packages/opencode/src/index.ts, packages/cli/src/index.ts, packages/opencode/src/server/server.ts, packages/opencode/src/mcp/index.ts, packages/opencode/src/permission/index.ts, packages/opencode/src/plugin/index.ts, packages/sdk/js/src/index.ts, packages/llm/src/index.ts, packages/tui/src/index.tsx, AGENTS.md, CONTEXT.md, LICENSE, SECURITY.md.
What it can do
Generate code from natural language prompts
Natural language description of desired functionality → Generated code in specified programming language
Debug and fix code errors
Code with bugs or errors → Corrected code with fixes applied
Refactor existing code
Existing code that needs optimization or restructuring → Improved, refactored code
Explain code functionality
Code snippet or file → Natural language explanation of what the code does
Complete partial code snippets
Incomplete code or function stubs → Complete, functional code implementation
Convert code between programming languages
Code written in one programming language → Equivalent code in a different programming language
Intel on OpenCode
Tags
Tech Stack
Media

Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.