Skip to main content
OpenCode Terminal Interface
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.

What is OpenCode?

OpenCode is a Go-based CLI application that brings AI assistance directly to your terminal. It provides a beautiful TUI (Terminal User Interface) for interacting with various AI models to help with coding tasks, debugging, refactoring, and more. Built with Bubble Tea, OpenCode offers a smooth, responsive terminal experience that feels native to your development workflow.

Key features

Multiple AI providers

Support for OpenAI, Anthropic Claude, Google Gemini, AWS Bedrock, Groq, Azure OpenAI, GitHub Copilot, and OpenRouter

Interactive TUI

Beautiful terminal interface with vim-like editor, syntax highlighting, and smooth animations

Session management

Save and manage multiple conversation sessions with automatic context summarization

Tool integration

AI can execute commands, search files, modify code, and integrate with LSP for code intelligence

Custom commands

Create reusable commands with named arguments for common workflows

MCP protocol

Extend capabilities through Model Context Protocol with external tools and services

Installation

Get started with OpenCode using our install script, Homebrew, AUR, or Go

Quickstart guide

Run your first AI assistant session in minutes

Configuration

Configure AI providers, LSP, MCP servers, and customize your setup

Features

Explore powerful features like custom commands, file tracking, and auto-compact

How it works

  1. Start OpenCode in any project directory
  2. Select your AI model from multiple providers (Claude, GPT-4, Gemini, etc.)
  3. Chat with AI using natural language to get coding help
  4. AI uses tools to read files, execute commands, and modify code
  5. Review and approve changes with a built-in permission system
  6. Track changes across your session with automatic file history

Architecture

OpenCode is built with a modular architecture written in Go:
  • cmd: Command-line interface using Cobra
  • internal/app: Core application services
  • internal/config: Configuration management
  • internal/db: SQLite database operations and migrations
  • internal/llm: LLM providers and tools integration
  • internal/tui: Terminal UI components built with Bubble Tea
  • internal/lsp: Language Server Protocol integration
  • internal/session: Session and message management

Non-interactive mode

OpenCode also supports non-interactive prompt mode for scripting and automation:
# Run a single prompt and get the response
opencode -p "Explain the use of context in Go"

# Get response in JSON format
opencode -p "Explain the use of context in Go" -f json

# Run without showing the spinner (useful for scripts)
opencode -p "Explain the use of context in Go" -q
All permissions are auto-approved in non-interactive mode.

Community

OpenCode has been archived and continued as Crush by the original author and the Charm team.
For help or feedback:

Next steps

1

Install OpenCode

Follow the installation guide to get OpenCode on your system
2

Configure your AI provider

Set up API keys for your preferred AI provider (Anthropic, OpenAI, etc.)
3

Run your first session

Start OpenCode and chat with AI to get coding help

Build docs developers (and LLMs) love