--- title: "OpenCode" type: entity tags: [ai, coding-agent, cli, open-source] sources: [如何在ubuntu上安装opencode并配置vibe-kanban] last_updated: 2026-04-22 --- ## Overview **OpenCode** 是一个开源 AI 编程代理,支持终端界面、桌面应用和 IDE 扩展三种形态,可连接任意 LLM 提供商。 ## Aliases - opencode - OpenCode.ai ## Key Features - **多形态交付**:终端 TUI / 桌面应用 / IDE 扩展 - **任意 LLM 支持**:通过 API Key 配置 OpenRouter、OpenAI、Anthropic 等提供商 - **OpenCode Zen**:官方精选模型列表,经过测试验证,推荐新手使用 - **项目初始化**:`/init` 自动分析项目结构,生成 `AGENTS.md` 文件 - **Plan/Build 双模式**:Tab 键切换,Plan 模式只生成方案不写代码 - **撤销/重做**:`/undo` 和 `/redo` 支持多次连续操作 - **文件引用**:`@` 键模糊搜索项目文件 - **图片支持**:拖拽图片到终端进行视觉分析 - **对话分享**:`/share` 生成可分享链接 ## Installation ```bash curl -fsSL https://opencode.ai/install | bash ``` ## Configuration 1. 运行 `/connect` 选择提供商 2. 访问 opencode.ai/auth 登录并获取 API Key 3. 粘贴 API Key 完成配置 ## Related Entities - [[OpenCode Zen]] — 官方精选模型推荐列表 - [[Vibe-Kanban]] — 看板式任务管理,与 OpenCode 配合使用 - [[Claude Code]] — 竞品 AI 编程代理 ## Related Concepts - [[Plan Mode]] — 计划模式,禁用写入只生成实现方案 - [[Build Mode]] — 构建模式,执行实际代码修改 - [[AGENTS.md]] — 项目角色定义文件 - [[Vibe Coding]] — AI 辅助编程的工作流理念