🔥 anomalyco/opencode:开源 AI 编程 Agent
英文标题:🔥 anomalyco/opencode
OpenCode 是一个开源 AI 编程 Agent,提供终端界面和桌面应用,可通过安装脚本、npm、Homebrew、Scoop、Chocolatey、Nix 等多种方式部署。项目内置 build 与 plan 两个可通过 Tab 切换的 Agent:前者拥有完整开发权限,后者以只读方式支持代码分析与变更规划。OpenCode 还提供用于复杂检索和多步骤任务的 general 子 Agent,可通过 @general 调用。对于开发者而言,它提供了覆盖 macOS、Windows、Linux 的本地 AI 编程工作流,并可通过文档进一步配置和扩展。
459.6 KB
13.3 KB
中文
开源 AI 编程 Agent。
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
提示
安装前请移除所有早于 0.1.x 的版本。
OpenCode 也提供桌面应用。可直接从 releases 页面或 opencode.ai/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 或 .AppImage |
macOS (Homebrew)
brew install --cask opencode-desktop
Windows (Scoop)
scoop bucket add extras; scoop install extras/opencode-desktop
安装脚本会按照以下优先级顺序确定安装路径:
$OPENCODE_INSTALL_DIR- 自定义安装目录$XDG_BIN_DIR- 符合 XDG Base Directory Specification 的路径$HOME/bin- 标准用户二进制目录(若其存在或可以创建)$HOME/.opencode/bin- 默认回退路径
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
OpenCode 内置两个 Agent,可通过 Tab 键在两者之间切换。
- build - 默认 Agent,拥有用于开发工作的完整访问权限
- plan - 用于分析和代码探索的只读 Agent
- 默认拒绝编辑文件
- 运行 bash 命令前请求许可
- 适合探索不熟悉的代码库或规划变更
此外,还包含一个用于复杂搜索和多步骤任务的 general 子 Agent。该 Agent 供内部使用,也可以在消息中通过 @general 调用。
进一步了解 agents。
如需了解如何配置 OpenCode,请访问我们的文档。
如果你有兴趣为 OpenCode 贡献代码,请在提交 pull request 前阅读我们的贡献文档。
如果你正在开发与 OpenCode 相关、且名称中使用了“opencode”的项目,例如“opencode-dashboard”或“opencode-mobile”,请在 README 中添加说明,明确该项目并非由 OpenCode 团队构建,且与我们不存在任何关联。
English / 原文
The open source AI coding agent.
English | 简体中文 | 繁體中文 | 한국어 | Deutsch | Español | Français | Italiano | Dansk | 日本語 | Polski | Русский | Bosanski | العربية | Norsk | Português (Brasil) | ไทย | Türkçe | Українська | বাংলা | Ελληνικά | Tiếng Việt
# 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.
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
The install script respects the following priority order for the installation path:
$OPENCODE_INSTALL_DIR- Custom installation directory$XDG_BIN_DIR- XDG Base Directory Specification compliant path$HOME/bin- Standard user binary directory (if it exists or can be created)$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
OpenCode includes two built-in agents you can switch between with 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 multistep tasks. This is used internally and can be invoked using @general in messages.
Learn more about agents.
For more info on how to configure OpenCode, head over to our docs.
If you're interested in contributing to OpenCode, please read our contributing docs before submitting a pull request.
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.
