opencode-ai /opencode

A powerful AI coding agent. Built for the terminal.

★ 13,909⑂ 2,467👁 44⑃ 141● 184▤ 50
GoMITCreated 2025-03-16
下载:v0.0.55v0.0.55 ↓0.0.552025-06-27
+7
日增长
13,909
stars
2,467
forks
44
watchers
141
prs
184
issues
50
releases

README

Archived: Project has Moved

This repository is no longer maintained and has been archived for provenance.

The project has continued under the name [Crush][crush], developed by the original author and the Charm team.

Please follow [Crush][crush] for ongoing development.

[crush]: https://github.com/charmbracelet/crush


 ⌬ OpenCode



 ⚠️ Early Development Notice: This project is in early development and is not yet ready for production use. Features may change, break, or be incomplete. Use at your own risk.

A powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal.

 Overview

OpenCode is a Go-based CLI application that brings AI assistance to your terminal. It provides a TUI (Terminal User Interface) for interacting with various AI models to help with coding tasks, debugging, and more.

For a quick video overview, check out
 OpenCode + Gemini 2.5 Pro: BYE Claude Code! I'm SWITCHING To the FASTEST AI Coder!



 Features

- Interactive TUI: Built with Bubble Tea for a smooth terminal experience
- Multiple AI Providers: Support for OpenAI, Anthropic Claude, Google Gemini, AWS Bedrock, Groq, Azure OpenAI, and OpenRouter
- Session Management: Save and manage multiple conversation sessions
- Tool Integration: AI can execute commands, search files, and modify code
- Vim-like Editor: Integrated editor with text input capabilities
- Persistent Storage: SQLite database for storing conversations and sessions
- LSP Integration: Language Server Protocol support for code intelligence
- File Change Tracking: Track and visualize file changes during sessions
- External Editor Support: Open your preferred editor for composing messages
- Named Arguments for Custom Commands: Create powerful custom commands with multiple named placeholders

 Installation

 Using the Install Script

bash
 Install the latest version
curl -fsSL https://raw.githubusercontent.com/opencode-ai/opencode/refs/heads/main/install | bash

 Install a specific version
curl -fsSL https://raw.githubusercontent.com/opencode-ai/opencode/refs/heads/main/install | VERSION=0.1.0 bash


 Using Homebrew (macOS and Linux)

bash
brew install opencode-ai/tap/opencode


 Using AUR (Arch Linux)

bash
 Using yay
yay -S opencode-ai-bin

 Using paru
paru -S opencode-ai-bin


 Using Go

bash
go install github.com/opencode-ai/opencode@latest


 Configuration

OpenCode looks for configuration in the following locations:

- $HOME/.opencode.json
- $XDG_CONFIG_HOME/opencode/.opencode.json
- ./.opencode.json (local directory)

 Auto Compact Feature

OpenCode includes an auto compact feature that automatically summarizes your conversation when it approaches the model's context window limit. When enabled (default setting), this feature:

- Monitors token usage during your conversation
- Automatically triggers summarization when usage reaches 95% of the model's context window
- Creates a new session with the summary, allowing you to continue your work withou

Top issues

Discussions

Latest release

v0.0.55 v0.0.55 2025-06-27
Changelog
 4427df587f3c636002b66dba467a338fe948c828 fixup early return for ollama (266)

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON