[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4972":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":24,"defaultBranch":25,"hasWiki":24,"hasPages":24,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},4972,"opencode","opencode-ai\u002Fopencode","opencode-ai","A powerful AI coding agent. Built for the terminal.","",null,"Go",12915,1461,7,116,0,14,94,433,76,44.49,"MIT License",true,false,"main",[27,28,29,30,31],"ai","claude","code","llm","openai","2026-06-12 02:01:06","# 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:\u002F\u002Fgithub.com\u002Fcharmbracelet\u002Fcrush\n\n\n# ⌬ OpenCode\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F9ae61ef6-70e5-4876-bc45-5bcb4e52c714\" width=\"800\">\u003C\u002Fp>\n\n> **⚠️ 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>For a quick video overview, check out\n\u003Ca href=\"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=P8luPmEa1QI\">\u003Cimg width=\"25\" src=\"https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fcommons\u002F0\u002F09\u002FYouTube_full-color_icon_%282017%29.svg\"> OpenCode + Gemini 2.5 Pro: BYE Claude Code! I'm SWITCHING To the FASTEST AI Coder!\u003C\u002Fa>\u003C\u002Fp>\n\n\u003Ca href=\"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=P8luPmEa1QI\">\u003Cimg width=\"550\" src=\"https:\u002F\u002Fi3.ytimg.com\u002Fvi\u002FP8luPmEa1QI\u002Fmaxresdefault.jpg\">\u003C\u002Fa>\u003Cp>\n\n## Features\n\n- **Interactive TUI**: Built with [Bubble Tea](https:\u002F\u002Fgithub.com\u002Fcharmbracelet\u002Fbubbletea) 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:\u002F\u002Fraw.githubusercontent.com\u002Fopencode-ai\u002Fopencode\u002Frefs\u002Fheads\u002Fmain\u002Finstall | bash\n\n# Install a specific version\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fopencode-ai\u002Fopencode\u002Frefs\u002Fheads\u002Fmain\u002Finstall | VERSION=0.1.0 bash\n```\n\n### Using Homebrew (macOS and Linux)\n\n```bash\nbrew install opencode-ai\u002Ftap\u002Fopencode\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\u002Fopencode-ai\u002Fopencode@latest\n```\n\n## Configuration\n\nOpenCode looks for configuration in the following locations:\n\n- `$HOME\u002F.opencode.json`\n- `$XDG_CONFIG_HOME\u002Fopencode\u002F.opencode.json`\n- `.\u002F.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 \u002F\u002F 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 `\u002Fbin\u002Fbash` if not set.\n\nYou can override this in your configuration file:\n\n```json\n{\n  \"shell\": {\n    \"path\": \"\u002Fbin\u002Fzsh\",\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\": \"\u002Fbin\u002Fbash\",\n    \"args\": [\"-l\"]\n  },\n  \"mcpServers\": {\n    \"example\": {\n      \"type\": \"stdio\",\n      \"command\": \"path\u002Fto\u002Fmcp-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 \u002Fpath\u002Fto\u002Fproject\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\u002Fdialog 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\u002Fgeneration     |\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\u002Fapp**: Core application services\n- **internal\u002Fconfig**: Configuration management\n- **internal\u002Fdb**: Database operations and migrations\n- **internal\u002Fllm**: LLM providers and tools integration\n- **internal\u002Ftui**: Terminal UI components and layouts\n- **internal\u002Flogging**: Logging infrastructure\n- **internal\u002Fmessage**: Message handling\n- **internal\u002Fsession**: Session management\n- **internal\u002Flsp**: 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\u002Fopencode\u002Fcommands\u002F\n   ```\n\n   (typically `~\u002F.config\u002Fopencode\u002Fcommands\u002F` on Linux\u002FmacOS)\n\n   or\n\n   ```\n   $HOME\u002F.opencode\u002Fcommands\u002F\n   ```\n\n2. **Project Commands** (prefixed with `project:`):\n\n   ```\n   \u003CPROJECT DIR>\u002F.opencode\u002Fcommands\u002F\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 `~\u002F.config\u002Fopencode\u002Fcommands\u002Fprime-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~\u002F.config\u002Fopencode\u002Fcommands\u002Fgit\u002Fcommit.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\u002Foutput\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\u002Fto\u002Fmcp-server\",\n      \"env\": [],\n      \"args\": []\n    },\n    \"web-example\": {\n      \"type\": \"sse\",\n      \"url\": \"https:\u002F\u002Fexample.com\u002Fmcp\",\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:\u002F\u002Fgithub.com\u002Fsettings\u002Fcopilot) 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- ~\u002F.config\u002Fgithub-copilot\u002F[hosts,apps].json\n- $XDG_CONFIG_HOME\u002Fgithub-copilot\u002F[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:\u002F\u002Flocalhost:1235\u002Fv1\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:\u002F\u002Fgithub.com\u002Fopencode-ai\u002Fopencode.git\ncd opencode\n\n# Build\ngo build -o opencode\n\n# Run\n.\u002Fopencode\n```\n\n## Acknowledgments\n\nOpenCode gratefully acknowledges the contributions and support from these key individuals:\n\n- [@isaacphi](https:\u002F\u002Fgithub.com\u002Fisaacphi) - For the [mcp-language-server](https:\u002F\u002Fgithub.com\u002Fisaacphi\u002Fmcp-language-server) project which provided the foundation for our LSP client implementation\n- [@adamdottv](https:\u002F\u002Fgithub.com\u002Fadamdottv) - For the design direction and UI\u002FUX 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\u002Famazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature\u002Famazing-feature`)\n5. Open a Pull Request\n\nPlease make sure to update tests as appropriate and follow the existing code style.\n","OpenCode 是一个基于终端的AI编码助手，旨在为开发者提供直接在终端内的智能编程辅助。该项目使用Go语言开发，通过TUI（终端用户界面）与多种AI模型交互，支持代码编写、调试等任务。其核心功能包括多AI提供商支持、会话管理、工具集成、Vim风格编辑器以及LSP（语言服务器协议）集成等。特别适合需要高效编码和调试的开发者在日常工作中使用，尤其是在偏好命令行环境的情况下。请注意，此项目已归档并迁移至名为Crush的新仓库继续开发。",2,"2026-06-11 03:01:51","top_language"]