OpenCode中文版
v8.7.0🚀 OpenCode 汉化发行版 | ⚡️ 每日自动同步官方最新版 | 全自动构建三端安装包 (Win/Mac/Linux) | 您的 OpenCode 中文版首选下载站
OpenCode 中文汉化版
中文文档
项目简介
OpenCode 是由 Anomaly Company 开发的开源 AI 编程代理,提供终端界面 (TUI)、桌面应用和 IDE 扩展等多种使用方式。
OpenCode 中文汉化版是对 OpenCode 项目的本地化改造,通过模块化汉化配置和自动化脚本实现完整中文化,降低国内用户使用门槛。
核心功能:
- 🤖 AI 辅助编程 - 解释代码、添加功能、重构修改
- 📋 Plan 模式 - 先规划后实施,支持图片参考和迭代讨论
- ↩️ 撤销/重做 -
/undo和/redo命令轻松回退 - 🔗 对话分享 - 生成链接与团队协作
- 🔌 多模型支持 - 兼容各类 LLM 提供商
本项目解决的问题:
| 问题 | 解决方案 |
|---|---|
| 全英文界面降低使用效率 | 完整汉化所有用户可见文本 |
| 每次更新需重新手动修改 | 自动化脚本支持一键更新和汉化 |
| 不熟悉命令行操作 | 提供交互式菜单,简化操作流程 |
| 开发环境配置复杂 | Codes 工具一键管理所有依赖 |
🚀 快速开始
步骤 1:安装 Codes 管理工具
Codes 是本项目的开发环境管理工具,安装后获得全局命令:
# Linux/macOS (推荐使用 Gitee 镜像)
curl -fsSL https://gitee.com/QtCodeCreators/OpenCodeChineseTranslation/raw/main/scripts/install.sh | bash
# Windows PowerShell
irm https://gitee.com/QtCodeCreators/OpenCodeChineseTranslation/raw/main/scripts/install.ps1 | iex
安装完成后重启终端,即可使用 codes 命令。
步骤 2:环境诊断
codes doctor
步骤 3:安装缺失组件
codes install
🛠️ Codes 命令参考
Codes 是开发环境智能管理工具,提供一键安装、版本管理、环境诊断等功能。
基础命令
| 命令 | 说明 |
|---|---|
codes |
交互菜单 - 显示图形菜单 |
codes doctor |
环境诊断 - 检查所有工具状态 |
codes install |
安装组件 - 安装缺失的工具 |
codes install [编号] |
按编号安装 - 只安装指定组件 |
codes upgrade |
升级组件 - 升级已安装的工具 |
codes node lts |
Node 管理 - 切换到 LTS |
codes node 22 |
Node 管理 - 切换到 v22 |
codes opencode |
安装 OpenCode 汉化脚本 |
codes i18n |
安装汉化管理工具 |
codes helper |
启动智谱编码助手 |
codes env |
显示环境变量 |
codes env-permanent |
永久配置环境变量 |
codes update |
检查并更新 Codes |
codes check-update |
检查 Codes 新版本 |
codes --version |
显示版本信息 |
codes --help |
显示帮助信息 |
支持的组件
| 编号 | 组件 | 说明 |
|---|---|---|
| 1 | Node.js | JavaScript 运行时 |
| 2 | Bun | 快速 JavaScript 运行时 |
| 3 | Git | 版本控制工具 |
| 4 | Python | 编程语言 |
| 5 | nvm | Node 版本管理器 |
| 6 | coding-helper | 智谱编码助手 |
菜单选项
╔═══════════════════════════════════════════════╗
║ Codes - 开发环境管理工具 ║
╠═══════════════════════════════════════════════╣
║ [1] 环境诊断 - 检查所有工具状态 ║
║ [2] 安装组件 - 安装缺失的工具 ║
║ [3] 升级组件 - 升级已安装的工具 ║
║ [4] Node 管理 - 切换 Node.js 版本 ║
║ [5] Claude Code - 安装 Claude Code ║
║ [6] OpenCode - 安装 OpenCode 汉化版 ║
║ [7] 汉化管理工具 - 安装汉化脚本 ║
║ [8] 智谱助手 - 启动 coding-helper ║
║ [9] 环境变量 - 显示/导出环境变量 ║
║ [p] 永久配置 - 一键写入环境变量 ║
║ [u] 检查更新 - 检查 Codes 新版本 ║
║ [U] 更新 Codes - 自动更新到最新版 ║
║ [0] 退出 ║
╚═══════════════════════════════════════════════╝
📦 OpenCode 安装部署
重要:本项目使用相对路径设计,可放置在任意目录运行。
方式一:使用 Codes 安装(推荐)
# 1. 安装 Codes (如果还没安装)
curl -fsSL https://gitee.com/QtCodeCreators/OpenCodeChineseTranslation/raw/main/scripts/install.sh | bash
# 2. 克隆本仓库
git clone https://gitee.com/QtCodeCreators/OpenCodeChineseTranslation.git
cd OpenCodeChineseTranslation
# 3. 使用 Codes 一键初始化
codes opencode
codes i18n
方式二:手动克隆
# 克隆本仓库
git clone https://gitee.com/QtCodeCreators/OpenCodeChineseTranslation.git
cd OpenCodeChineseTranslation
# 首次运行会自动初始化
.\scripts\opencode\opencode.ps1
🎯 OpenCode 使用方法
一键汉化+部署
.\scripts\opencode\opencode.ps1
# 选择 [1] 一键汉化+部署
主菜单
| 选项 | 功能 | 适用场景 |
|---|---|---|
| [1] | 一键汉化+部署 | 首次使用或需要完整更新 |
| [2] | 应用汉化 | 仅应用翻译,不编译 |
| [3] | 验证汉化 | 检查翻译覆盖率 |
| [4] | 调试工具 | 排查汉化问题 |
| [5] | 版本检测 | 检查并更新官方版本 |
| [6] | 备份版本 | 备份当前汉化版本 |
| [7] | 高级菜单 | 更多高级选项 |
| [R] | 恢复纯净 | 撤销汉化,恢复到出厂状态 |
📂 项目结构
OpenCodeChineseTranslation/
├── scripts/ # 管理脚本目录
│ ├── install.sh # Codes 一键安装脚本
│ └── codes/ # Codes 核心脚本
│ ├── codes.sh # Linux/macOS 版本
│ └── README.md # Codes 详细文档
├── scripts/opencode/ # OpenCode 汉化脚本
│ ├── opencode.ps1 # 主脚本 (4700+ 行)
│ └── init.ps1 # 自动初始化脚本
├── opencode-i18n/ # 汉化配置目录
│ ├── config.json # 主配置文件
│ ├── dialogs/ # 对话框汉化
│ ├── routes/ # 路由汉化
│ ├── components/ # 组件汉化
│ └── common/ # 通用汉化
├── opencode-zh-CN/ # OpenCode 源码 (自动克隆)
└── docs/ # 项目文档
🔧 常见问题
| 问题 | 解决方法 |
|---|---|
| 执行策略错误 | Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass |
| 编译失败 | 确保已安装 Bun:codes install |
| 汉化未生效 | 运行 [2] 应用汉化 重新应用 |
| 网络超时 | 脚本会自动使用 Gitee 镜像 |
| 源码目录为空 | 运行 .\scripts\init.ps1 自动克隆 |
| 环境变量丢失 | 运行 codes env-permanent 永久配置 |
📊 汉化范围
| 模块 | 覆盖内容 |
|---|---|
| 命令面板 | 会话管理、模型选择、智能体切换 |
| 对话框 | 智能体选择器、会话列表、消息处理 |
| 侧边栏 | 上下文管理、MCP 状态显示 |
| 顶部栏 | 子智能体导航 |
| 权限系统 | 文件操作权限请求 |
| 通知提示 | 70+ 条操作提示信息 |
🤝 贡献指南
欢迎贡献代码和翻译!
- 修复翻译错误:提交 PR 修改
opencode-i18n/下的 JSON 文件 - 新增汉化模块:在对应目录添加新的 JSON 文件并更新
config.json - 脚本优化:提交 PR 修改
scripts/opencode/opencode.ps1 - Codes 优化:提交 PR 修改
scripts/codes/codes.sh
📄 许可证
本项目采用 MIT 许可证。详见 LICENSE 文件。
OpenCode 原项目采用 MIT 许可证,版权归 Anomaly Company 所有。
🔗 相关链接
| 链接 | 说明 |
|---|---|
| Gitee 仓库 | 国内镜像 |
| GitHub 仓库 | GitHub 主页 |
| OpenCode 官方 | 原项目 |
| 问题反馈 | 提交 Issue |
English Documentation
Project Overview
OpenCode is an open-source AI coding agent developed by Anomaly Company, providing TUI, desktop app, and IDE extensions.
OpenCode Chinese Translation is a localized version with complete Chinese translation through modular configuration and automated scripts.
Key Features:
- 🤖 AI-assisted coding - Explain, add features, refactor
- 📋 Plan mode - Plan first, execute later
- ↩️ Undo/Redo - Easy rollback with
/undoand/redo - 🔗 Share conversations - Generate links for collaboration
- 🔌 Multi-model support - Compatible with various LLM providers
Quick Start
Step 1: Install Codes
Codes is the development environment manager for this project:
# Linux/macOS (Gitee mirror recommended)
curl -fsSL https://gitee.com/QtCodeCreators/OpenCodeChineseTranslation/raw/main/scripts/install.sh | bash
# Windows PowerShell
irm https://gitee.com/QtCodeCreators/OpenCodeChineseTranslation/raw/main/scripts/install.ps1 | iex
Restart your terminal after installation.
Step 2: Environment Check
codes doctor
Step 3: Install Missing Components
codes install
Codes Commands
| Command | Description |
|---|---|
codes |
Interactive menu |
codes doctor |
Environment check |
codes install |
Install components |
codes upgrade |
Upgrade components |
codes node lts |
Switch to Node.js LTS |
codes opencode |
Install OpenCode script |
codes env-permanent |
Permanently configure env vars |
codes update |
Update Codes to latest |
codes --help |
Show help |
OpenCode Installation
# Clone repository
git clone https://gitee.com/QtCodeCreators/OpenCodeChineseTranslation.git
cd OpenCodeChineseTranslation
# Run the script
./scripts/opencode/opencode.ps1 # Windows
License
This project is licensed under MIT. See LICENSE for details.
OpenCode original project is also MIT licensed, copyright by Anomaly Company.
Links
| Link | Description |
|---|---|
| Gitee Repository | China mirror |
| GitHub Repository | GitHub home |
| OpenCode Official | Original project |
| Issue Tracker | Report issues |