Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

opencode-ai/opencode

Developer Tools

A terminal AI coding agent with multi-provider model support, tool use, sessions, LSP diagnostics, and MCP integration.

13,889
2,473
Go
MIT
1 year old

Project status

This repository is archived and no longer maintained. Development continues as Crush by the original author and the Charm team, so new users should treat this codebase as a historical version rather than an active dependency Crush.

What it does

OpenCode is a Go CLI and TUI that puts an AI coding assistant in the terminal. It connects to multiple model providers (OpenAI, Anthropic, Gemini, AWS Bedrock, Groq, Azure OpenAI, OpenRouter, Copilot, and self-hosted OpenAI-compatible endpoints), keeps conversation sessions in SQLite, and gives the model tools to search files, view and edit code, run shell commands, fetch URLs, and run sub-tasks README.

A useful design point is that tool calls go through a permission dialog unless non-interactive mode is used. LSP integration feeds diagnostics into the assistant, while MCP servers can add external tools over stdio or SSE. Custom Markdown commands with $NAME placeholders let you repeat common prompts such as issue triage.

Getting started

The README's install options include a shell installer, Homebrew on macOS/Linux, AUR on Arch, and go install. For a source build you need Go 1.24.0 or newer development:

git clone https://github.com/opencode-ai/opencode.git
cd opencode
go build -o opencode
./opencode

Before starting, set the API key for your chosen provider, e.g. ANTHROPIC_API_KEY, OPENAI_API_KEY, or GEMINI_API_KEY. Run opencode for the TUI, or opencode -p "Explain the use of context in Go" for one-shot output; add -f json for JSON or -q to suppress the spinner usage.

Configuration is read from $HOME/.opencode.json, $XDG_CONFIG_HOME/opencode/.opencode.json, or ./.opencode.json; the file selects provider keys, agent models, shell, MCP servers, and LSP commands configuration. The install script is the quickest path but executes a remote script, so review it before running.

Constraints

The project itself warns that it was in early development and not production-ready; features may change or break. Non-interactive prompt mode auto-approves all permissions for the session, which is unsafe for unattended use on untrusted prompts or repositories. File and shell tools act directly on your working directory, so sessions should be scoped deliberately.

Copilot support is marked experimental and may require an authenticated token or existing Copilot client Copilot setup. LSP integration exposes only diagnostics to the assistant, not completions or hover. Self-hosted models require an OpenAI-compatible endpoint such as LOCAL_ENDPOINT=http://localhost:1235/v1. The code is MIT licensed LICENSE.

HotRepo's take

OpenCode appears once in HotRepo's Go daily list on 2026-11-10, at 16th place with 3 stars gained that day. The repository was archived and points to Crush as its continuation, so that data describes an already historical snapshot rather than an actively growing project. Anyone evaluating the current tool should look at Crush instead of starting from this archived code.

Written by AI from the project's README, updated . The project's own docs are the source of truth.

Hacker News

opencode - AI coding agent built for the terminal
▲ 4 · 0 comments · June 19, 2025
Opencode
▲ 2 · 0 comments · April 29, 2025
OpenCode: Terminal-based AI assistant for developers
▲ 1 · 0 comments · June 24, 2025

You might also like

  1. anomalyco/opencodeAn MIT-licensed terminal coding agent for developers who want full control over model choice and local file access.TypeScript220,940
  2. can1357/oh-my-piA terminal coding agent with LSP, debugger, subagents, browser and multi-provider model routing built in.TypeScript38,015
  3. 1jehuang/jcodeA Rust terminal coding agent optimized for running many parallel agents in one repo with low memory and fast startup.Rust21,383
  4. samber/cc-skills-golangGo-specific agent skills that keep coding assistants aligned with idiomatic conventions, testing and debugging practice.Go3,688
  5. Alishahryar1/free-claude-codeRoute existing coding agents and IDEs through a shared catalog of free model providers, with fallback and token-saving options.Python63,590