OpenCode is an open-source AI coding agent that brings large-language-model-powered development directly into your terminal, desktop, or IDE. It understands your codebase, executes tools on your behalf, and iterates alongside you — all governed by a permission model you control. The project is a TypeScript monorepo built on Effect-TS for compositional service architecture, and exposes multiple interfaces: a rich Terminal UI (TUI), an Electron desktop app, a CLI, and an HTTP API for programmatic access.
Sources: README.md, package.json
What OpenCode Does
At its core, OpenCode is a session-driven agent runtime. When you open a project directory, OpenCode initializes a location — a scoped environment that binds configuration, agents, tools, and filesystem access to that directory. You then start a session, select an agent (e.g. build for full-access development or plan for read-only analysis), and begin a conversation. The agent routes your prompt through an LLM provider, decides which tools to invoke (file reads, edits, bash execution, web search, etc.), and streams results back — asking for permission when policy requires it.
Two built-in agents ship by default. The build agent has unrestricted tool access and is designed for active development. The plan agent operates in read-only mode, denying file edits by default and requesting permission before running shell commands — ideal for exploring unfamiliar codebases or designing changes before implementing them. A subagent handles complex multi-step searches and can be invoked with in messages.