OpenCode

A fully open-source AI coding agent built for the terminal, with a TUI, desktop app, web client, plugin system, and SDK — one of the most-starred AI coding agents on GitHub.

182.4Kstars
22.6Kforks
MIT License
TypeScript

OpenCode is a terminal-native AI coding agent, distributed as an npm package (opencode-ai) and built as a genuine multi-surface product rather than a single CLI script: a terminal UI (tui), a desktop app, a web client, a session UI, and even a Slack integration all sit on top of a shared core and server, with an SDK and plugin system for extending it.

The monorepo separates the LLM abstraction layer (llm), the agent core (core), the server that surfaces are built against (server), and infrastructure concerns like identity, storage (via Effect + Drizzle/SQLite packages), and codegen for the HTTP API (httpapi-codegen) into distinct packages, reflecting a production-grade architecture rather than a single-file agent loop.

MIT licensed with no separate enterprise-gated license, OpenCode is entirely open source, including its enterprise-oriented package, and has grown to one of the most popular AI coding agents on GitHub by star count.

What You Get

  • A terminal UI (TUI) as the primary interface, plus desktop, web, and Slack surfaces built on the same core
  • A plugin system and SDK for extending or integrating OpenCode into other tools and workflows
  • A shared server and LLM abstraction layer supporting multiple model providers rather than one hardcoded backend
  • Fully MIT-licensed code, including the enterprise-oriented package, with no separate commercial license

Common Use Cases

  • Driving AI-assisted coding tasks directly from the terminal without switching to an IDE extension
  • Extending the agent’s capabilities through the plugin system for team- or project-specific workflows
  • Integrating AI coding agent access into team communication tools via the Slack integration
  • Building custom tooling on top of OpenCode’s SDK instead of the built-in TUI/desktop/web clients

Under The Hood

Architecture OpenCode’s monorepo cleanly separates the agent core and llm abstraction from surface-specific packages (tui, desktop, web, cli, slack, session-ui), all built against a shared server and protocol package defining the API contract between them. Storage is handled through dedicated Effect-based SQLite packages (effect-sqlite-node, effect-drizzle-sqlite), and httpapi-codegen generates typed API bindings rather than hand-writing them — infrastructure choices consistent with a project built to support many simultaneous client surfaces rather than a single CLI.

Tech Stack TypeScript throughout, using the Effect framework for functional, typed infrastructure code (SQLite/Drizzle integration), a custom protocol/SDK layer for client-server communication, and Storybook for UI component development. Distributed via npm (opencode-ai) with automated publish workflows in CI.

Code Quality Very active, consistently maintained commit history at massive scale (180K+ stars, 22K+ forks) reflects one of the most heavily used and contributed-to AI coding agents in the open-source ecosystem; the presence of dedicated test directories per package and CI-gated publishing indicate release discipline appropriate for a project of this scale.

What Makes It Unique Most open-source coding agents ship as a single CLI or IDE extension; OpenCode instead built out TUI, desktop, web, and Slack surfaces on a shared core and server from early on, plus a full plugin/SDK ecosystem — treating multi-surface support as core architecture rather than an afterthought.

Self-Hosting

Licensing Model MIT licensed — the entire monorepo, including the enterprise package, is open source with no separate commercial license.

Self-Hosting Restrictions None found; there’s no gated enterprise-only codebase separate from the open-source repository.

License Key Required No.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search