explaingit

opencode-ai/opencode

12,530GoAudience · developerComplexity · 3/5Setup · moderate

TLDR

A now-archived terminal AI coding assistant in Go that lets you chat with AI models, run shell commands, and edit project files, all from the terminal. The project continues as Crush under the Charm team.

Mindmap

mindmap
  root((OpenCode))
    What it does
      Terminal AI assistant
      Code chat and editing
    AI providers
      OpenAI and Claude
      Gemini Groq and more
    Features
      Shell command execution
      Session history SQLite
      Auto-compact
    Status
      Archived
      Continues as Crush
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run an AI coding assistant entirely inside the terminal without a browser or separate app.

USE CASE 2

Switch between multiple AI providers (OpenAI, Claude, Gemini, Groq) using a single tool and one API key per service.

USE CASE 3

Resume a previous coding session by reloading conversation history saved locally in a SQLite database.

Tech stack

GoSQLiteBubble Tea

Getting it running

Difficulty · moderate Time to first run · 30min

Requires at least one AI provider API key (OpenAI, Anthropic, Google, Groq, etc.) before first use.

No license is stated in the explanation, check the repository for terms.

In plain English

OpenCode was a terminal-based AI coding assistant written in Go. It provided a text-based interface inside the terminal for asking AI models to help write, debug, or explain code. This repository has since been archived, and the project continues under the name Crush, developed by the original author in collaboration with the Charm team. While it was active, OpenCode supported multiple AI providers from a single tool: OpenAI, Anthropic Claude, Google Gemini, Groq, AWS Bedrock, Azure OpenAI, and OpenRouter. A developer would configure an API key for whichever service they had access to and then start chatting. The AI could not only respond to questions but also take direct actions: running shell commands, reading and modifying files in the current project, and tracking what changed during a session. The interface was built using a Go library called Bubble Tea, which makes it possible to build structured, navigable screens inside a terminal. A vim-style text editor was integrated for composing longer messages, and conversation history was saved to a local SQLite database so sessions could be resumed later. One notable feature was auto-compact: when a conversation grew long enough to approach the AI model'''s memory limit, the tool would automatically summarize the session and continue from that summary, avoiding errors caused by exceeding the context window. Language Server Protocol support was also included, which let the editor offer the same kind of code-awareness features found in full IDEs, such as understanding types and references in the code being edited. Development of OpenCode has moved to the Crush repository under the charmbracelet organization on GitHub.

Copy-paste prompts

Prompt 1
I'm setting up the OpenCode terminal AI assistant with an Anthropic Claude API key. Walk me through the configuration steps and how to start my first coding session.
Prompt 2
OpenCode's auto-compact feature summarized my long session. How do I review what was summarized and continue the conversation from that point?
Prompt 3
Show me how OpenCode uses Language Server Protocol to provide code-aware suggestions, what types of hints and references does it expose inside the terminal editor?
Open on GitHub → Explain another repo

← opencode-ai on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.