{"id":27824884,"url":"https://github.com/opencode-ai/opencode","last_synced_at":"2026-01-12T01:49:41.294Z","repository":{"id":284829247,"uuid":"949662713","full_name":"opencode-ai/opencode","owner":"opencode-ai","description":"A powerful AI coding agent. Built for the terminal.","archived":false,"fork":false,"pushed_at":"2025-07-01T09:52:20.000Z","size":1275,"stargazers_count":6295,"open_issues_count":108,"forks_count":464,"subscribers_count":38,"default_branch":"main","last_synced_at":"2025-07-01T10:44:42.650Z","etag":null,"topics":["ai","claude","code","llm","openai"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opencode-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-16T23:38:55.000Z","updated_at":"2025-07-01T10:31:28.000Z","dependencies_parsed_at":"2025-03-27T22:32:06.649Z","dependency_job_id":"2b4c4fdc-2cbc-4e4f-9fcf-79c70e6aeb13","html_url":"https://github.com/opencode-ai/opencode","commit_stats":null,"previous_names":["kujtimiihoxha/termai","kujtimiihoxha/opencode","opencode-ai/opencode"],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/opencode-ai/opencode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencode-ai%2Fopencode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencode-ai%2Fopencode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencode-ai%2Fopencode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencode-ai%2Fopencode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencode-ai","download_url":"https://codeload.github.com/opencode-ai/opencode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencode-ai%2Fopencode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","claude","code","llm","openai"],"created_at":"2025-05-01T19:01:14.761Z","updated_at":"2026-01-12T01:49:41.288Z","avatar_url":"https://github.com/opencode-ai.png","language":"Go","funding_links":[],"categories":["AI Agent Frameworks","ツール","Tools and Code","Go","CLI \u0026 Terminal Tools","💻 Shell \u0026 CLI Assistants","其他工具与实用程序","代码 Coding","CLI Coding Tools","A01_文本生成_文本对话","Alternatives to Claude Code","🖥 Coding Agents","HarmonyOS","🚀 AI Tools for Vim, Neovim, and Terminal","What is an Agentic Game?","1. Local Agents","Alternative Coding Agents","Applied AI","AI Agent Skills","Terminal \u0026 CLI Agents"],"sub_categories":["General Agent Frameworks","IDE \u0026 エディタアシスタント","Vibe Coding and AI Coding Assistants","AI Agents Stack","大语言对话模型及数据","Terminal and CLI Agents","Windows Manager","Compatible Agents","Coding Agents \u0026 IDE Extensions","Video Tutorials","Agentic Editors:","Agents"],"readme":"# Archived: Project has Moved\n\nThis repository is no longer maintained and has been archived for provenance.\n\nThe project has continued under the name [Crush][crush], developed by the original author and the Charm team.\n\nPlease follow [Crush][crush] for ongoing development.\n\n[crush]: https://github.com/charmbracelet/crush\n\n\n# ⌬ OpenCode\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/9ae61ef6-70e5-4876-bc45-5bcb4e52c714\" width=\"800\"\u003e\u003c/p\u003e\n\n\u003e **⚠️ 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.\n\nA powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal.\n\n## Overview\n\nOpenCode 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.\n\n\u003cp\u003eFor a quick video overview, check out\n\u003ca href=\"https://www.youtube.com/watch?v=P8luPmEa1QI\"\u003e\u003cimg width=\"25\" src=\"https://upload.wikimedia.org/wikipedia/commons/0/09/YouTube_full-color_icon_%282017%29.svg\"\u003e OpenCode + Gemini 2.5 Pro: BYE Claude Code! I'm SWITCHING To the FASTEST AI Coder!\u003c/a\u003e\u003c/p\u003e\n\n\u003ca href=\"https://www.youtube.com/watch?v=P8luPmEa1QI\"\u003e\u003cimg width=\"550\" src=\"https://i3.ytimg.com/vi/P8luPmEa1QI/maxresdefault.jpg\"\u003e\u003c/a\u003e\u003cp\u003e\n\n## Features\n\n- **Interactive TUI**: Built with [Bubble Tea](https://github.com/charmbracelet/bubbletea) for a smooth terminal experience\n- **Multiple AI Providers**: Support for OpenAI, Anthropic Claude, Google Gemini, AWS Bedrock, Groq, Azure OpenAI, and OpenRouter\n- **Session Management**: Save and manage multiple conversation sessions\n- **Tool Integration**: AI can execute commands, search files, and modify code\n- **Vim-like Editor**: Integrated editor with text input capabilities\n- **Persistent Storage**: SQLite database for storing conversations and sessions\n- **LSP Integration**: Language Server Protocol support for code intelligence\n- **File Change Tracking**: Track and visualize file changes during sessions\n- **External Editor Support**: Open your preferred editor for composing messages\n- **Named Arguments for Custom Commands**: Create powerful custom commands with multiple named placeholders\n\n## Installation\n\n### Using the Install Script\n\n```bash\n# Install the latest version\ncurl -fsSL https://raw.githubusercontent.com/opencode-ai/opencode/refs/heads/main/install | bash\n\n# Install a specific version\ncurl -fsSL https://raw.githubusercontent.com/opencode-ai/opencode/refs/heads/main/install | VERSION=0.1.0 bash\n```\n\n### Using Homebrew (macOS and Linux)\n\n```bash\nbrew install opencode-ai/tap/opencode\n```\n\n### Using AUR (Arch Linux)\n\n```bash\n# Using yay\nyay -S opencode-ai-bin\n\n# Using paru\nparu -S opencode-ai-bin\n```\n\n### Using Go\n\n```bash\ngo install github.com/opencode-ai/opencode@latest\n```\n\n## Configuration\n\nOpenCode looks for configuration in the following locations:\n\n- `$HOME/.opencode.json`\n- `$XDG_CONFIG_HOME/opencode/.opencode.json`\n- `./.opencode.json` (local directory)\n\n### Auto Compact Feature\n\nOpenCode 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:\n\n- Monitors token usage during your conversation\n- Automatically triggers summarization when usage reaches 95% of the model's context window\n- Creates a new session with the summary, allowing you to continue your work without losing context\n- Helps prevent \"out of context\" errors that can occur with long conversations\n\nYou can enable or disable this feature in your configuration file:\n\n```json\n{\n  \"autoCompact\": true // default is true\n}\n```\n\n### Environment Variables\n\nYou can configure OpenCode using environment variables:\n\n| Environment Variable       | Purpose                                                                          |\n| -------------------------- | -------------------------------------------------------------------------------- |\n| `ANTHROPIC_API_KEY`        | For Claude models                                                                |\n| `OPENAI_API_KEY`           | For OpenAI models                                                                |\n| `GEMINI_API_KEY`           | For Google Gemini models                                                         |\n| `GITHUB_TOKEN`             | For Github Copilot models (see [Using Github Copilot](#using-github-copilot))    |\n| `VERTEXAI_PROJECT`         | For Google Cloud VertexAI (Gemini)                                               |\n| `VERTEXAI_LOCATION`        | For Google Cloud VertexAI (Gemini)                                               |\n| `GROQ_API_KEY`             | For Groq models                                                                  |\n| `AWS_ACCESS_KEY_ID`        | For AWS Bedrock (Claude)                                                         |\n| `AWS_SECRET_ACCESS_KEY`    | For AWS Bedrock (Claude)                                                         |\n| `AWS_REGION`               | For AWS Bedrock (Claude)                                                         |\n| `AZURE_OPENAI_ENDPOINT`    | For Azure OpenAI models                                                          |\n| `AZURE_OPENAI_API_KEY`     | For Azure OpenAI models (optional when using Entra ID)                           |\n| `AZURE_OPENAI_API_VERSION` | For Azure OpenAI models                                                          |\n| `LOCAL_ENDPOINT`           | For self-hosted models                                                           |\n| `SHELL`                    | Default shell to use (if not specified in config)                                |\n\n### Shell Configuration\n\nOpenCode allows you to configure the shell used by the bash tool. By default, it uses the shell specified in the `SHELL` environment variable, or falls back to `/bin/bash` if not set.\n\nYou can override this in your configuration file:\n\n```json\n{\n  \"shell\": {\n    \"path\": \"/bin/zsh\",\n    \"args\": [\"-l\"]\n  }\n}\n```\n\nThis is useful if you want to use a different shell than your default system shell, or if you need to pass specific arguments to the shell.\n\n### Configuration File Structure\n\n```json\n{\n  \"data\": {\n    \"directory\": \".opencode\"\n  },\n  \"providers\": {\n    \"openai\": {\n      \"apiKey\": \"your-api-key\",\n      \"disabled\": false\n    },\n    \"anthropic\": {\n      \"apiKey\": \"your-api-key\",\n      \"disabled\": false\n    },\n    \"copilot\": {\n      \"disabled\": false\n    },\n    \"groq\": {\n      \"apiKey\": \"your-api-key\",\n      \"disabled\": false\n    },\n    \"openrouter\": {\n      \"apiKey\": \"your-api-key\",\n      \"disabled\": false\n    }\n  },\n  \"agents\": {\n    \"coder\": {\n      \"model\": \"claude-3.7-sonnet\",\n      \"maxTokens\": 5000\n    },\n    \"task\": {\n      \"model\": \"claude-3.7-sonnet\",\n      \"maxTokens\": 5000\n    },\n    \"title\": {\n      \"model\": \"claude-3.7-sonnet\",\n      \"maxTokens\": 80\n    }\n  },\n  \"shell\": {\n    \"path\": \"/bin/bash\",\n    \"args\": [\"-l\"]\n  },\n  \"mcpServers\": {\n    \"example\": {\n      \"type\": \"stdio\",\n      \"command\": \"path/to/mcp-server\",\n      \"env\": [],\n      \"args\": []\n    }\n  },\n  \"lsp\": {\n    \"go\": {\n      \"disabled\": false,\n      \"command\": \"gopls\"\n    }\n  },\n  \"debug\": false,\n  \"debugLSP\": false,\n  \"autoCompact\": true\n}\n```\n\n## Supported AI Models\n\nOpenCode supports a variety of AI models from different providers:\n\n### OpenAI\n\n- GPT-4.1 family (gpt-4.1, gpt-4.1-mini, gpt-4.1-nano)\n- GPT-4.5 Preview\n- GPT-4o family (gpt-4o, gpt-4o-mini)\n- O1 family (o1, o1-pro, o1-mini)\n- O3 family (o3, o3-mini)\n- O4 Mini\n\n### Anthropic\n\n- Claude 4 Sonnet\n- Claude 4 Opus\n- Claude 3.5 Sonnet\n- Claude 3.5 Haiku\n- Claude 3.7 Sonnet\n- Claude 3 Haiku\n- Claude 3 Opus\n\n### GitHub Copilot\n\n- GPT-3.5 Turbo\n- GPT-4\n- GPT-4o\n- GPT-4o Mini\n- GPT-4.1\n- Claude 3.5 Sonnet\n- Claude 3.7 Sonnet\n- Claude 3.7 Sonnet Thinking\n- Claude Sonnet 4\n- O1\n- O3 Mini\n- O4 Mini\n- Gemini 2.0 Flash\n- Gemini 2.5 Pro\n\n### Google\n\n- Gemini 2.5\n- Gemini 2.5 Flash\n- Gemini 2.0 Flash\n- Gemini 2.0 Flash Lite\n\n### AWS Bedrock\n\n- Claude 3.7 Sonnet\n\n### Groq\n\n- Llama 4 Maverick (17b-128e-instruct)\n- Llama 4 Scout (17b-16e-instruct)\n- QWEN QWQ-32b\n- Deepseek R1 distill Llama 70b\n- Llama 3.3 70b Versatile\n\n### Azure OpenAI\n\n- GPT-4.1 family (gpt-4.1, gpt-4.1-mini, gpt-4.1-nano)\n- GPT-4.5 Preview\n- GPT-4o family (gpt-4o, gpt-4o-mini)\n- O1 family (o1, o1-mini)\n- O3 family (o3, o3-mini)\n- O4 Mini\n\n### Google Cloud VertexAI\n\n- Gemini 2.5\n- Gemini 2.5 Flash\n\n## Usage\n\n```bash\n# Start OpenCode\nopencode\n\n# Start with debug logging\nopencode -d\n\n# Start with a specific working directory\nopencode -c /path/to/project\n```\n\n## Non-interactive Prompt Mode\n\nYou can run OpenCode in non-interactive mode by passing a prompt directly as a command-line argument. This is useful for scripting, automation, or when you want a quick answer without launching the full TUI.\n\n```bash\n# Run a single prompt and print the AI's response to the terminal\nopencode -p \"Explain the use of context in Go\"\n\n# Get response in JSON format\nopencode -p \"Explain the use of context in Go\" -f json\n\n# Run without showing the spinner (useful for scripts)\nopencode -p \"Explain the use of context in Go\" -q\n```\n\nIn this mode, OpenCode will process your prompt, print the result to standard output, and then exit. All permissions are auto-approved for the session.\n\nBy default, a spinner animation is displayed while the model is processing your query. You can disable this spinner with the `-q` or `--quiet` flag, which is particularly useful when running OpenCode from scripts or automated workflows.\n\n### Output Formats\n\nOpenCode supports the following output formats in non-interactive mode:\n\n| Format | Description                     |\n| ------ | ------------------------------- |\n| `text` | Plain text output (default)     |\n| `json` | Output wrapped in a JSON object |\n\nThe output format is implemented as a strongly-typed `OutputFormat` in the codebase, ensuring type safety and validation when processing outputs.\n\n## Command-line Flags\n\n| Flag              | Short | Description                                         |\n| ----------------- | ----- | --------------------------------------------------- |\n| `--help`          | `-h`  | Display help information                            |\n| `--debug`         | `-d`  | Enable debug mode                                   |\n| `--cwd`           | `-c`  | Set current working directory                       |\n| `--prompt`        | `-p`  | Run a single prompt in non-interactive mode         |\n| `--output-format` | `-f`  | Output format for non-interactive mode (text, json) |\n| `--quiet`         | `-q`  | Hide spinner in non-interactive mode                |\n\n## Keyboard Shortcuts\n\n### Global Shortcuts\n\n| Shortcut | Action                                                  |\n| -------- | ------------------------------------------------------- |\n| `Ctrl+C` | Quit application                                        |\n| `Ctrl+?` | Toggle help dialog                                      |\n| `?`      | Toggle help dialog (when not in editing mode)           |\n| `Ctrl+L` | View logs                                               |\n| `Ctrl+A` | Switch session                                          |\n| `Ctrl+K` | Command dialog                                          |\n| `Ctrl+O` | Toggle model selection dialog                           |\n| `Esc`    | Close current overlay/dialog or return to previous mode |\n\n### Chat Page Shortcuts\n\n| Shortcut | Action                                  |\n| -------- | --------------------------------------- |\n| `Ctrl+N` | Create new session                      |\n| `Ctrl+X` | Cancel current operation/generation     |\n| `i`      | Focus editor (when not in writing mode) |\n| `Esc`    | Exit writing mode and focus messages    |\n\n### Editor Shortcuts\n\n| Shortcut            | Action                                    |\n| ------------------- | ----------------------------------------- |\n| `Ctrl+S`            | Send message (when editor is focused)     |\n| `Enter` or `Ctrl+S` | Send message (when editor is not focused) |\n| `Ctrl+E`            | Open external editor                      |\n| `Esc`               | Blur editor and focus messages            |\n\n### Session Dialog Shortcuts\n\n| Shortcut   | Action           |\n| ---------- | ---------------- |\n| `↑` or `k` | Previous session |\n| `↓` or `j` | Next session     |\n| `Enter`    | Select session   |\n| `Esc`      | Close dialog     |\n\n### Model Dialog Shortcuts\n\n| Shortcut   | Action            |\n| ---------- | ----------------- |\n| `↑` or `k` | Move up           |\n| `↓` or `j` | Move down         |\n| `←` or `h` | Previous provider |\n| `→` or `l` | Next provider     |\n| `Esc`      | Close dialog      |\n\n### Permission Dialog Shortcuts\n\n| Shortcut                | Action                       |\n| ----------------------- | ---------------------------- |\n| `←` or `left`           | Switch options left          |\n| `→` or `right` or `tab` | Switch options right         |\n| `Enter` or `space`      | Confirm selection            |\n| `a`                     | Allow permission             |\n| `A`                     | Allow permission for session |\n| `d`                     | Deny permission              |\n\n### Logs Page Shortcuts\n\n| Shortcut           | Action              |\n| ------------------ | ------------------- |\n| `Backspace` or `q` | Return to chat page |\n\n## AI Assistant Tools\n\nOpenCode's AI assistant has access to various tools to help with coding tasks:\n\n### File and Code Tools\n\n| Tool          | Description                 | Parameters                                                                               |\n| ------------- | --------------------------- | ---------------------------------------------------------------------------------------- |\n| `glob`        | Find files by pattern       | `pattern` (required), `path` (optional)                                                  |\n| `grep`        | Search file contents        | `pattern` (required), `path` (optional), `include` (optional), `literal_text` (optional) |\n| `ls`          | List directory contents     | `path` (optional), `ignore` (optional array of patterns)                                 |\n| `view`        | View file contents          | `file_path` (required), `offset` (optional), `limit` (optional)                          |\n| `write`       | Write to files              | `file_path` (required), `content` (required)                                             |\n| `edit`        | Edit files                  | Various parameters for file editing                                                      |\n| `patch`       | Apply patches to files      | `file_path` (required), `diff` (required)                                                |\n| `diagnostics` | Get diagnostics information | `file_path` (optional)                                                                   |\n\n### Other Tools\n\n| Tool          | Description                            | Parameters                                                                                |\n| ------------- | -------------------------------------- | ----------------------------------------------------------------------------------------- |\n| `bash`        | Execute shell commands                 | `command` (required), `timeout` (optional)                                                |\n| `fetch`       | Fetch data from URLs                   | `url` (required), `format` (required), `timeout` (optional)                               |\n| `sourcegraph` | Search code across public repositories | `query` (required), `count` (optional), `context_window` (optional), `timeout` (optional) |\n| `agent`       | Run sub-tasks with the AI agent        | `prompt` (required)                                                                       |\n\n## Architecture\n\nOpenCode is built with a modular architecture:\n\n- **cmd**: Command-line interface using Cobra\n- **internal/app**: Core application services\n- **internal/config**: Configuration management\n- **internal/db**: Database operations and migrations\n- **internal/llm**: LLM providers and tools integration\n- **internal/tui**: Terminal UI components and layouts\n- **internal/logging**: Logging infrastructure\n- **internal/message**: Message handling\n- **internal/session**: Session management\n- **internal/lsp**: Language Server Protocol integration\n\n## Custom Commands\n\nOpenCode supports custom commands that can be created by users to quickly send predefined prompts to the AI assistant.\n\n### Creating Custom Commands\n\nCustom commands are predefined prompts stored as Markdown files in one of three locations:\n\n1. **User Commands** (prefixed with `user:`):\n\n   ```\n   $XDG_CONFIG_HOME/opencode/commands/\n   ```\n\n   (typically `~/.config/opencode/commands/` on Linux/macOS)\n\n   or\n\n   ```\n   $HOME/.opencode/commands/\n   ```\n\n2. **Project Commands** (prefixed with `project:`):\n\n   ```\n   \u003cPROJECT DIR\u003e/.opencode/commands/\n   ```\n\nEach `.md` file in these directories becomes a custom command. The file name (without extension) becomes the command ID.\n\nFor example, creating a file at `~/.config/opencode/commands/prime-context.md` with content:\n\n```markdown\nRUN git ls-files\nREAD README.md\n```\n\nThis creates a command called `user:prime-context`.\n\n### Command Arguments\n\nOpenCode supports named arguments in custom commands using placeholders in the format `$NAME` (where NAME consists of uppercase letters, numbers, and underscores, and must start with a letter).\n\nFor example:\n\n```markdown\n# Fetch Context for Issue $ISSUE_NUMBER\n\nRUN gh issue view $ISSUE_NUMBER --json title,body,comments\nRUN git grep --author=\"$AUTHOR_NAME\" -n .\nRUN grep -R \"$SEARCH_PATTERN\" $DIRECTORY\n```\n\nWhen you run a command with arguments, OpenCode will prompt you to enter values for each unique placeholder. Named arguments provide several benefits:\n\n- Clear identification of what each argument represents\n- Ability to use the same argument multiple times\n- Better organization for commands with multiple inputs\n\n### Organizing Commands\n\nYou can organize commands in subdirectories:\n\n```\n~/.config/opencode/commands/git/commit.md\n```\n\nThis creates a command with ID `user:git:commit`.\n\n### Using Custom Commands\n\n1. Press `Ctrl+K` to open the command dialog\n2. Select your custom command (prefixed with either `user:` or `project:`)\n3. Press Enter to execute the command\n\nThe content of the command file will be sent as a message to the AI assistant.\n\n### Built-in Commands\n\nOpenCode includes several built-in commands:\n\n| Command            | Description                                                                                         |\n| ------------------ | --------------------------------------------------------------------------------------------------- |\n| Initialize Project | Creates or updates the OpenCode.md memory file with project-specific information                    |\n| Compact Session    | Manually triggers the summarization of the current session, creating a new session with the summary |\n\n## MCP (Model Context Protocol)\n\nOpenCode implements the Model Context Protocol (MCP) to extend its capabilities through external tools. MCP provides a standardized way for the AI assistant to interact with external services and tools.\n\n### MCP Features\n\n- **External Tool Integration**: Connect to external tools and services via a standardized protocol\n- **Tool Discovery**: Automatically discover available tools from MCP servers\n- **Multiple Connection Types**:\n  - **Stdio**: Communicate with tools via standard input/output\n  - **SSE**: Communicate with tools via Server-Sent Events\n- **Security**: Permission system for controlling access to MCP tools\n\n### Configuring MCP Servers\n\nMCP servers are defined in the configuration file under the `mcpServers` section:\n\n```json\n{\n  \"mcpServers\": {\n    \"example\": {\n      \"type\": \"stdio\",\n      \"command\": \"path/to/mcp-server\",\n      \"env\": [],\n      \"args\": []\n    },\n    \"web-example\": {\n      \"type\": \"sse\",\n      \"url\": \"https://example.com/mcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer token\"\n      }\n    }\n  }\n}\n```\n\n### MCP Tool Usage\n\nOnce configured, MCP tools are automatically available to the AI assistant alongside built-in tools. They follow the same permission model as other tools, requiring user approval before execution.\n\n## LSP (Language Server Protocol)\n\nOpenCode integrates with Language Server Protocol to provide code intelligence features across multiple programming languages.\n\n### LSP Features\n\n- **Multi-language Support**: Connect to language servers for different programming languages\n- **Diagnostics**: Receive error checking and linting information\n- **File Watching**: Automatically notify language servers of file changes\n\n### Configuring LSP\n\nLanguage servers are configured in the configuration file under the `lsp` section:\n\n```json\n{\n  \"lsp\": {\n    \"go\": {\n      \"disabled\": false,\n      \"command\": \"gopls\"\n    },\n    \"typescript\": {\n      \"disabled\": false,\n      \"command\": \"typescript-language-server\",\n      \"args\": [\"--stdio\"]\n    }\n  }\n}\n```\n\n### LSP Integration with AI\n\nThe AI assistant can access LSP features through the `diagnostics` tool, allowing it to:\n\n- Check for errors in your code\n- Suggest fixes based on diagnostics\n\nWhile the LSP client implementation supports the full LSP protocol (including completions, hover, definition, etc.), currently only diagnostics are exposed to the AI assistant.\n\n## Using Github Copilot\n\n_Copilot support is currently experimental._\n\n### Requirements\n- [Copilot chat in the IDE](https://github.com/settings/copilot) enabled in GitHub settings\n- One of:\n  - VSCode Github Copilot chat extension\n  - Github `gh` CLI\n  - Neovim Github Copilot plugin (`copilot.vim` or `copilot.lua`)\n  - Github token with copilot permissions\n\nIf using one of the above plugins or cli tools, make sure you use the authenticate\nthe tool with your github account. This should create a github token at one of the following locations:\n- ~/.config/github-copilot/[hosts,apps].json\n- $XDG_CONFIG_HOME/github-copilot/[hosts,apps].json\n\nIf using an explicit github token, you may either set the $GITHUB_TOKEN environment variable or add it to the opencode.json config file at `providers.copilot.apiKey`.\n\n## Using a self-hosted model provider\n\nOpenCode can also load and use models from a self-hosted (OpenAI-like) provider.\nThis is useful for developers who want to experiment with custom models.\n\n### Configuring a self-hosted provider\n\nYou can use a self-hosted model by setting the `LOCAL_ENDPOINT` environment variable.\nThis will cause OpenCode to load and use the models from the specified endpoint.\n\n```bash\nLOCAL_ENDPOINT=http://localhost:1235/v1\n```\n\n### Configuring a self-hosted model\n\nYou can also configure a self-hosted model in the configuration file under the `agents` section:\n\n```json\n{\n  \"agents\": {\n    \"coder\": {\n      \"model\": \"local.granite-3.3-2b-instruct@q8_0\",\n      \"reasoningEffort\": \"high\"\n    }\n  }\n}\n```\n\n## Development\n\n### Prerequisites\n\n- Go 1.24.0 or higher\n\n### Building from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/opencode-ai/opencode.git\ncd opencode\n\n# Build\ngo build -o opencode\n\n# Run\n./opencode\n```\n\n## Acknowledgments\n\nOpenCode gratefully acknowledges the contributions and support from these key individuals:\n\n- [@isaacphi](https://github.com/isaacphi) - For the [mcp-language-server](https://github.com/isaacphi/mcp-language-server) project which provided the foundation for our LSP client implementation\n- [@adamdottv](https://github.com/adamdottv) - For the design direction and UI/UX architecture\n\nSpecial thanks to the broader open source community whose tools and libraries have made this project possible.\n\n## License\n\nOpenCode is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Here's how you can contribute:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\nPlease make sure to update tests as appropriate and follow the existing code style.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencode-ai%2Fopencode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencode-ai%2Fopencode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencode-ai%2Fopencode/lists"}