opencode README

The project's README from github.com/anomalyco/opencode. As one markdown file: README.md.

OpenCode logo

The open source AI coding agent.

Discord npm Build status

English | 简体中文 | 繁體中文 | 한국어 | Deutsch | Español | Français | Italiano | Dansk | 日本語 | Polski | Русский | Bosanski | العربية | Norsk | Português (Brasil) | ไทย | Türkçe | Українська | বাংলা | Ελληνικά | Tiếng Việt

OpenCode Terminal UI


Installation

# YOLO
curl -fsSL https://opencode.ai/install | bash

# Package managers
npm i -g opencode-ai@latest        # or bun/pnpm/yarn
scoop install opencode             # Windows
choco install opencode             # Windows
brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date)
brew install opencode              # macOS and Linux (official brew formula, updated less)
sudo pacman -S opencode            # Arch Linux (Stable)
paru -S opencode-bin               # Arch Linux (Latest from AUR)
mise use -g opencode               # Any OS
nix run nixpkgs#opencode           # or github:anomalyco/opencode for latest dev branch

[!TIP] Remove versions older than 0.1.x before installing.

Desktop App (BETA)

OpenCode is also available as a desktop application. Download directly from the releases page or opencode.ai/download.

Platform Download
macOS (Apple Silicon) opencode-desktop-mac-arm64.dmg
macOS (Intel) opencode-desktop-mac-x64.dmg
Windows opencode-desktop-windows-x64.exe
Linux .deb, .rpm, or .AppImage
# macOS (Homebrew)
brew install --cask opencode-desktop
# Windows (Scoop)
scoop bucket add extras; scoop install extras/opencode-desktop

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 it exists or can be created)
  4. $HOME/.opencode/bin - Default fallback
# 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

Agents

OpenCode includes two built-in agents you can switch between with the Tab key.

Also included is a general subagent for complex searches and multistep tasks. This is used internally and can be invoked using @general in messages.

Learn more about agents.

Documentation

For more info on how to configure OpenCode, head over to our docs.

Contributing

If you're interested in contributing to OpenCode, please read our contributing docs before submitting a pull request.

Building on OpenCode

If you are working on a project that's related to OpenCode and is using "opencode" as 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.


Join our community Discord | X.com

opencode (anomalyco/opencode)

Searching Database…

214.4K ·GitHub
这是什么?OpenCode 是一个开源的 AI 编程代理,可以帮你编写、探索和修改代码。它提供命令行(CLI)版本,现在也推出了测试版桌面应用。
这是终端工具,还是也有桌面应用?它主要是一个命令行(CLI)代理,但 OpenCode 也提供测试版桌面应用,可以直接下载用于 macOS、Windows 和 Linux。
我该如何安装 OpenCode?可以从 opencode.ai/download 或 GitHub releases 页面获取桌面应用(macOS Apple Silicon/Intel 用 dmg,Windows 用 .exe,Linux 用 .deb/.rpm/.AppImage),也可以运行安装脚本,脚本会自动为你选择安装目录。
桌面应用已经可以日常使用了吗?还不完全可以。桌面应用明确标注为测试版,因此目前使用 OpenCode 更成熟的方式是命令行版本。
OpenCode 自带哪些内置代理?OpenCode 自带一个 build 代理(默认模式,拥有完整的文件编辑权限,用于开发)和一个 plan 代理(只读,禁止编辑文件,运行 bash 命令前会先询问权限,适合探索不熟悉的代码)。此外,还有一个 general 子代理,在内部处理复杂的多步骤搜索。
如何在 build 和 plan 代理之间切换?在命令行中按 Tab 键即可在 build 和 plan 代理之间切换。
我可以直接调用 general 子代理吗?可以,在消息中使用 @general 即可显式调用,适用于复杂搜索或多步骤任务。
我可以基于 OpenCode 开发自己的工具吗?可以,但如果你的项目名称中包含 “opencode”,需要在 README 中添加说明,表明该项目并非由 OpenCode 团队开发,也与其无关联。
Creator
anomalyco
Size
564 MB
Stars
214.4K
Age
1y
Commits · 90 Days