OpenCode is a terminal-based AI coding agent written in Go that integrates multiple large language models into a single command-line interface. The project is now archived, with development continuing under the name Crush, developed by the original author and the Charm team. The repository serves as a historical record of the original OpenCode implementation.
The application provides a Terminal User Interface built with Bubble Tea, enabling developers to interact with AI models directly from their terminal for coding assistance, debugging, and other development tasks. OpenCode supports an extensive range of AI providers including OpenAI, Anthropic Claude, Google Gemini, AWS Bedrock, Groq, Azure OpenAI, and OpenRouter. The supported models span multiple families such as GPT-4 variants, Claude 3 and 4 series, Gemini 2.0 and 2.5 versions, and specialized models like O1, O3, and Llama variants.
The core functionality includes session management capabilities that allow users to save and manage multiple conversation sessions with persistent storage through SQLite databases. OpenCode features an integrated vim-like editor for composing messages and supports opening external editors for more complex text composition. The application includes Language Server Protocol integration for enhanced code intelligence and file change tracking to visualize modifications during sessions.
A distinctive feature is the auto-compact functionality that monitors token usage during conversations and automatically triggers summarization when usage approaches ninety-five percent of the model's context window limit. This prevents context overflow errors by creating new sessions with summaries, allowing users to continue work without losing conversation history. The AI assistant has access to various tools including file operations, command execution, file searching, and code modification capabilities.
OpenCode operates in both interactive and non-interactive modes. The interactive mode provides a full Terminal User Interface with extensive keyboard shortcuts for navigation and control. Non-interactive mode allows users to pass prompts directly as command-line arguments, making the tool suitable for scripting and automation workflows. The non-interactive mode supports multiple output formats including plain text and JSON, with optional spinner animation that can be disabled for automated workflows.
Configuration is flexible, supporting multiple locations including the home directory, XDG config directories, and local project directories. Users can configure the application through JSON configuration files or environment variables for API keys and service endpoints. The application allows customization of the shell used for command execution and supports named arguments for creating powerful custom commands with multiple placeholders.
The keyboard shortcut system is comprehensive, with global shortcuts for application control, chat-specific shortcuts for message management, editor shortcuts for text composition, and specialized shortcuts for dialogs and permission management. Users can switch between sessions, select different AI models, manage permissions for AI operations, and view application logs through dedicated keyboard-driven interfaces.
The project was in early development at the time of archival, with features subject to change. The repository includes detailed documentation of supported models, configuration options, installation methods including Homebrew and AUR packages, and comprehensive usage instructions for both interactive and non-interactive modes.