gitmyhub

opencode

Go ★ 13k updated 9mo ago ▣ archived

A powerful AI coding agent. Built for the terminal.

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.

GoSQLiteBubble Teasetup: moderatecomplexity 3/5

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.

Where it fits