> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/opencode-ai/opencode/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode - Terminal-based AI coding assistant

> A powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal with support for multiple AI providers and advanced tool integration.

<img src="https://github.com/user-attachments/assets/9ae61ef6-70e5-4876-bc45-5bcb4e52c714" alt="OpenCode Terminal Interface" />

<Warning>
  **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.
</Warning>

## 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](https://github.com/charmbracelet/bubbletea), OpenCode offers a smooth, responsive terminal experience that feels native to your development workflow.

## Key features

<CardGroup cols={2}>
  <Card title="Multiple AI providers" icon="robot">
    Support for OpenAI, Anthropic Claude, Google Gemini, AWS Bedrock, Groq, Azure OpenAI, GitHub Copilot, and OpenRouter
  </Card>

  <Card title="Interactive TUI" icon="terminal">
    Beautiful terminal interface with vim-like editor, syntax highlighting, and smooth animations
  </Card>

  <Card title="Session management" icon="layer-group">
    Save and manage multiple conversation sessions with automatic context summarization
  </Card>

  <Card title="Tool integration" icon="wrench">
    AI can execute commands, search files, modify code, and integrate with LSP for code intelligence
  </Card>

  <Card title="Custom commands" icon="code">
    Create reusable commands with named arguments for common workflows
  </Card>

  <Card title="MCP protocol" icon="plug">
    Extend capabilities through Model Context Protocol with external tools and services
  </Card>
</CardGroup>

## Quick links

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    Get started with OpenCode using our install script, Homebrew, AUR, or Go
  </Card>

  <Card title="Quickstart guide" icon="rocket" href="/quickstart">
    Run your first AI assistant session in minutes
  </Card>

  <Card title="Configuration" icon="gear" href="/configuration">
    Configure AI providers, LSP, MCP servers, and customize your setup
  </Card>

  <Card title="Features" icon="sparkles" href="/features">
    Explore powerful features like custom commands, file tracking, and auto-compact
  </Card>
</CardGroup>

## 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:

```bash theme={null}
# 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

<Note>
  OpenCode has been archived and continued as [Crush](https://github.com/charmbracelet/crush) by the original author and the Charm team.
</Note>

For help or feedback:

* Press `Ctrl+P` in OpenCode to list available actions
* Report issues at [github.com/opencode-ai/opencode](https://github.com/opencode-ai/opencode)
* Watch the [YouTube overview](https://www.youtube.com/watch?v=P8luPmEa1QI)

## Next steps

<Steps>
  <Step title="Install OpenCode">
    Follow the [installation guide](/installation) to get OpenCode on your system
  </Step>

  <Step title="Configure your AI provider">
    Set up API keys for your preferred AI provider (Anthropic, OpenAI, etc.)
  </Step>

  <Step title="Run your first session">
    Start OpenCode and chat with AI to get coding help
  </Step>
</Steps>
