2025-06-17 08:10:19 +08:00
< p align = "center" >
< a href = "https://opencode.ai" >
< picture >
2025-10-03 00:31:56 +08:00
< source srcset = "packages/console/app/src/asset/logo-ornate-dark.svg" media = "(prefers-color-scheme: dark)" >
< source srcset = "packages/console/app/src/asset/logo-ornate-light.svg" media = "(prefers-color-scheme: light)" >
< img src = "packages/console/app/src/asset/logo-ornate-light.svg" alt = "OpenCode logo" >
2025-06-17 08:10:19 +08:00
< / picture >
< / a >
< / p >
2025-12-11 08:05:33 +08:00
< p align = "center" > The open source AI coding agent.< / p >
2025-06-17 08:10:19 +08:00
< p align = "center" >
2025-07-10 07:55:06 +08:00
< a href = "https://opencode.ai/discord" > < img alt = "Discord" src = "https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" / > < / a >
2025-06-17 08:10:19 +08:00
< a href = "https://www.npmjs.com/package/opencode-ai" > < img alt = "npm" src = "https://img.shields.io/npm/v/opencode-ai?style=flat-square" / > < / a >
< a href = "https://github.com/sst/opencode/actions/workflows/publish.yml" > < img alt = "Build status" src = "https://img.shields.io/github/actions/workflow/status/sst/opencode/publish.yml?style=flat-square&branch=dev" / > < / a >
< / p >
2025-10-03 00:31:56 +08:00
[](https://opencode.ai)
2025-06-14 04:43:53 +08:00
2025-06-20 06:19:06 +08:00
---
2025-06-15 00:12:56 +08:00
### Installation
2025-06-14 04:37:58 +08:00
2025-06-15 00:12:56 +08:00
```bash
# YOLO
2025-06-14 04:42:31 +08:00
curl -fsSL https://opencode.ai/install | bash
2025-06-15 00:12:56 +08:00
# Package managers
npm i -g opencode-ai@latest # or bun/pnpm/yarn
2025-10-20 10:50:51 +08:00
scoop bucket add extras; scoop install extras/opencode # Windows
2025-10-23 22:25:42 +08:00
choco install opencode # Windows
2025-11-18 14:46:49 +08:00
brew install opencode # macOS and Linux
2025-06-15 00:12:56 +08:00
paru -S opencode-bin # Arch Linux
2025-12-20 05:51:09 +08:00
mise use -g github:sst/opencode # Any OS
2025-11-18 14:46:49 +08:00
nix run nixpkgs#opencode # or github:sst/opencode for latest dev branch
2025-06-14 04:42:31 +08:00
```
2025-07-16 08:09:26 +08:00
> [!TIP]
> Remove versions older than 0.1.x before installing.
2025-06-14 04:37:58 +08:00
2025-12-17 01:28:40 +08:00
### Desktop App (BETA)
OpenCode is also available as a desktop application. Download directly from the [releases page ](https://github.com/sst/opencode/releases ) or [opencode.ai/download ](https://opencode.ai/download ).
| Platform | Download |
| --------------------- | ------------------------------------- |
| macOS (Apple Silicon) | `opencode-desktop-darwin-aarch64.dmg` |
| macOS (Intel) | `opencode-desktop-darwin-x64.dmg` |
| Windows | `opencode-desktop-windows-x64.exe` |
| Linux | `.deb` , `.rpm` , or AppImage |
```bash
# macOS (Homebrew)
brew install --cask opencode-desktop
```
2025-07-19 02:15:10 +08:00
#### Installation Directory
The install script respects the following priority order for the installation path:
1. `$OPENCODE_INSTALL_DIR` - Custom installation directory
2. `$XDG_BIN_DIR` - XDG Base Directory Specification compliant path
3. `$HOME/bin` - Standard user binary directory (if exists or can be created)
4. `$HOME/.opencode/bin` - Default fallback
```bash
# Examples
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
```
2025-11-18 06:19:14 +08:00
### Agents
OpenCode includes two built-in agents you can switch between,
you can switch between these using the `Tab` key.
- **build** - Default, full access agent for development work
- **plan** - Read-only agent for analysis and code exploration
- Denies file edits by default
- Asks permission before running bash commands
- Ideal for exploring unfamiliar codebases or planning changes
Also, included is a **general** subagent for complex searches and multi-step tasks.
This is used internally and can be invoked using `@general` in messages.
Learn more about [agents ](https://opencode.ai/docs/agents ).
2025-06-20 04:26:58 +08:00
### Documentation
2025-06-15 02:45:59 +08:00
2025-10-03 00:31:56 +08:00
For more info on how to configure OpenCode [**head over to our docs** ](https://opencode.ai/docs ).
2025-06-15 02:45:59 +08:00
2025-06-15 00:45:26 +08:00
### Contributing
2025-10-19 03:10:14 +08:00
If you're interested in contributing to OpenCode, please read our [contributing docs ](./CONTRIBUTING.md ) before submitting a pull request.
2025-06-21 05:27:58 +08:00
2025-11-17 09:51:41 +08:00
### Building on OpenCode
2025-12-18 23:56:37 +08:00
If you are working on a project that's related to OpenCode and is using "opencode" as a part of its name; for example, "opencode-dashboard" or "opencode-mobile", please add a note to your README to clarify that it is not built by the OpenCode team and is not affiliated with us in any way.
2025-11-17 09:51:41 +08:00
2025-06-15 02:39:06 +08:00
### FAQ
2025-06-17 08:10:19 +08:00
#### How is this different than Claude Code?
2025-06-16 09:39:02 +08:00
2025-06-17 08:10:19 +08:00
It's very similar to Claude Code in terms of capability. Here are the key differences:
2025-06-16 09:39:02 +08:00
- 100% open source
2025-11-21 06:21:19 +08:00
- Not coupled to any provider. Although we recommend the models we provide through [OpenCode Zen ](https://opencode.ai/zen ); OpenCode can be used with Claude, OpenAI, Google or even local models. As models evolve the gaps between them will close and pricing will drop so being provider-agnostic is important.
2025-10-13 04:23:25 +08:00
- Out of the box LSP support
2025-10-03 00:31:56 +08:00
- A focus on TUI. OpenCode is built by neovim users and the creators of [terminal.shop ](https://terminal.shop ); we are going to push the limits of what's possible in the terminal.
- A client/server architecture. This for example can allow OpenCode to run on your computer, while you can drive it remotely from a mobile app. Meaning that the TUI frontend is just one of the possible clients.
2025-06-16 09:43:20 +08:00
2025-06-17 03:42:27 +08:00
#### What's the other repo?
2025-06-17 08:10:19 +08:00
The other confusingly named repo has no relation to this one. You can [read the story behind it here ](https://x.com/thdxr/status/1933561254481666466 ).
---
2025-09-11 05:47:29 +08:00
**Join our community** [Discord ](https://discord.gg/opencode ) | [X.com ](https://x.com/opencode )