Skip to content
简体中文

切换主题

// 用 AI 写代码

OpenCodev2.0.26

开源编程 agent,可接任意模型,运行在终端、IDE 或桌面。

开源 维护中 两用 开发者

官方下载官方直链

v1.19.6 · 2026-11-17

按钮直接指向官方文件(github.com),本站不转存、不改动安装包。核实于 2026-11-30。 全部文件、校验值和安装步骤 →

一段话结论

OpenCode 是开源编程 agent,可接任意模型,运行在终端、IDE 或桌面。

适合:想用 AI 写代码的开发者和团队。

要点:212k★;npm 近 90 天 2,984 万次;固定开销 7k vs 33k token 对比帖

01OpenCode 简介

OpenCode 是一款开源 AI 编程 agent,运行于终端,另提供桌面版(测试版)。它能够读取和修改代码、执行命令,协助完成开发任务。

主要功能

  • 内置两个 agent,通过 Tab 键切换:build 为默认的全权限开发 agent;plan 为只读 agent,默认禁止修改文件,执行 bash 命令前需经用户确认。
  • 另有 general 子 agent,用于复杂搜索和多步骤任务,可在消息中以 @general 调用。
  • 桌面版提供 macOS(Apple Silicon、Intel)、Windows 和 Linux 安装包。
  • 支持 npm、Homebrew、pacman、mise、Nix 等多种安装方式。

适合谁用

希望在终端中借助 AI 编写代码、并倾向使用开源工具的开发者;plan 模式适用于熟悉陌生代码库和规划改动。

平台与许可证

平台:终端(CLI);桌面版支持 macOS、Windows、Linux。 许可证:MIT。

本段由 AIMap 根据项目官方 README 整理(2026-10-26 拉取),数字和名称以原文为准。原仓库 ↗

02怎么开始

  1. 1通过官方安装脚本或包管理器(如 npm、Homebrew)安装命令行版。
  2. 2如需图形界面,可从 opencode.ai/download 下载桌面版。
  3. 3安装前应删除 0.1.x 之前的旧版本;配置方法参见官方文档。
curl -fsSL https://opencode.ai/v2/install | bashnpm i -g @opencode/cli@latest

Homebrew: opencodenpm: opencode-node

03README(项目原文)

以下内容来自 anomalyco/opencode 的 README,许可证 MIT,版权归原作者。 查看原文 ↗

OpenCode logo

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

OpenCode Terminal UI


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

# Package managers
npm i -g @opencode/cli@latest      # or bun/pnpm/yarn
brew install anomalyco/tap/opencode-v2 # 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-beta              # Arch Linux (Latest from AUR)
mise use -g opencode               # Any OS
nix run github:anomalyco/opencode  # Nix

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

Desktop App (BETA)

OpenCode is also available as a desktop application. Download it from opencode.ai/download.

Platform Download
macOS (Apple Silicon) opencode-desktop-mac-arm64.dmg
macOS (Intel) opencode-desktop-mac-x64.dmg
Windows opencode-desktop-win-x64.exe
Linux .deb, .rpm, or .AppImage
# macOS (Homebrew)
brew install --cask opencode-desktop
Installation Directory

The install script installs OpenCode to $HOME/.opencode/bin.

Agents

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.

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

04替代品与对比

并排对比 →

05相关

版本历史 · 收录依据 · 给 AI 读

最近版本

热度证据(第三方快照)

给 AI 读

数据更新于:AI 软件库与热度 · 软件档案 / 需求 · 软件官方下载(北京时间)