惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Vercel News
Vercel News
Martin Fowler
Martin Fowler
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LangChain Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs

博客园 - 服务号AwesomeAITools

“同事.skill”不用写了,取代龙虾的爱马仕 Hermes agent主动“蒸馏”你 AI写需求系列之PM Skills Claude Code如何使用Github Copilot订阅 OpenClaw 的 Hooks钩子系统 OpenClaw 的记忆系统 OpenClaw的系统提示词 Superpowers 与 Spec-Kit和 OpenSpec 有什么不同 Claude官方Skills推荐 vscode系列:在vscode里面使用skills opencode的几种运行方式区别 OpenClaw里面的canvas是什么 opencode系列教程2:基本使用 OpenClaw 用什么模型? openclaw系列1:安装 Claude Code中英文系列教程38:使用Agent SDK 创建属于你自己的Agent OpenClaw系列教程0:入门介绍,安装与常见问题 Claude Code中英文系列教程37:通过API调用使用Agent Skills的最佳实践 Claude Code中英文系列教程36:Skills官方最佳实践 Claude Code中英文系列教程35:通过API使用Skills创建ppt,word文档和pdf
OpenCode系列教程1:安装与使用
服务号AwesomeAITools · 2026-02-28 · via 博客园 - 服务号AwesomeAITools

OpenCode 是一个开源的 AI 编码代理。它提供终端界面、桌面应用和 IDE 扩展等多种使用方式。

Installation 安装

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

# Package managers
npm i -g opencode-ai@latest        # or bun/pnpm/yarn
bun install -g opencode-ai
bun add -g opencode-ai
pnpm install -g opencode-ai
yarn global add opencode-ai

scoop install opencode             # Windows 虽然 OpenCode 可以直接在 Windows 上运行,但我们推荐使用WSL
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)
paru -S opencode
mise use -g opencode               # Any OS
mise use -g github:anomalyco/opencode
nix run nixpkgs#opencode           # or github:anomalyco/opencode for latest dev branch
使用 Docker
docker run -it --rm ghcr.io/anomalyco/opencode

Desktop App (BETA) 桌面应用(测试版)

OpenCode is also available as a desktop application.
OpenCode 也可以作为桌面应用程序使用。

Agents 代理

OpenCode includes two built-in agents you can switch between with the Tab key.
OpenCode 包含两个内置代理,您可以使用 Tab 键在它们之间切换。你会在右下角看到模式指示器。

build - Default, full-access agent for development work
构建 - 默认的全权限代理,用于开发工作

plan - Read-only agent for analysis and code exploration
计划 - 仅读代理,用于分析和代码探索

Also included is a general subagent for complex searches and multistep tasks. This is used internally and can be invoked using @general in messages.
还包括一个用于复杂搜索和多步骤任务的通用子代理。这用于内部,可以通过在消息中使用 @general 来调用。

How is this different from Claude Code?

这与 Claude Code 有何不同?

It's very similar to Claude Code in terms of capability. Here are the key differences:
在能力方面非常相似。以下是主要区别:

100% open source 100% 开源

Not coupled to any provider. 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.
不与任何供应商绑定。 OpenCode 可以与 Claude、OpenAI、Google 或本地模型一起使用。随着模型的发展,它们之间的差距将缩小,价格也将下降,因此保持供应商无关性非常重要。

Out-of-the-box LSP support
开箱即用的 LSP 支持 (Language Server Protocol)

A focus on TUI. OpenCode is built by neovim users and the creators of terminal.shop; we are going to push the limits of what's possible in the terminal.
专注于 TUI。OpenCode 是由 neovim 用户和 terminal.shop 的创建者构建的;我们将推动终端可能性的极限。

A client/server architecture. This, for example, can allow OpenCode to run on your computer while you drive it remotely from a mobile app, meaning that the TUI frontend is just one of the possible clients.
客户端/服务器架构。这可以允许 OpenCode 在您的计算机上运行,同时可以通过移动应用程序远程控制它,TUI 前端只是可能的客户端之一。

TUI (Terminal User Interface)终端用户界面

使用

/connect 登录

进入项目目录后

opencode

/init OpenCode 会分析你的项目并在项目根目录创建一个 AGENTS.md 文件。

可以使用 /undo 命令来撤销修改。

你与 OpenCode 的对话可以与团队分享。

/share

将图片拖放到终端中即可将其添加到提示词中。

我可以使用现有的 AI 订阅吗?

可以,OpenCode 支持所有主流提供商的订阅计划。您可以使用您的 Claude Pro/Max, ChatGPT Plus/Pro, 或 GitHub Copilot 订阅。