OpenCode Agent Constitution 部署工具 / OpenCode Agent Constitution Deployment Tool
My OpenCode Tool is a professional deployment utility for setting up OpenCode Agent Constitution in any project. It automates the installation and configuration of the 6-role AI development team framework.
- 🚀 One-command deployment of Agent Constitution
- 🔧 Automatic OpenCode installation with offline fallback
- 📦 Smart network detection - tries multiple sources
- 🌐 Multi-platform support (Windows, macOS, Linux)
- 🔄 GitCode mirror support for Chinese users
- 🛡️ Offline installation capability
# Install globally
npm install -g https://github.com/jabing/my-opencode.git
# Or install locally in your project
npm install --save-dev https://github.com/jabing/my-opencode.git# Install globally
npm install -g https://gitcode.com/jabing/my-opencode.git
# Or install locally in your project
npm install --save-dev https://gitcode.com/jabing/my-opencode.git# Clone from GitHub
git clone https://github.com/jabing/my-opencode.git
# Or clone from GitCode (faster in China)
git clone https://gitcode.com/jabing/my-opencode.git
cd my-opencode
# Install globally
npm install -g .
# Or use directly
node setup-opencode.js# Run directly without installation
npx https://raw.githubusercontent.com/jabing/my-opencode/main/setup-opencode.js deploy
# Or from GitCode
npx https://gitcode.com/jabing/my-opencode/raw/main/setup-opencode.js deploy-
Install the tool:
npm install -g https://github.com/jabing/my-opencode.git
-
Navigate to your project:
cd /path/to/your/project -
Deploy Agent Constitution:
oad deploy
-
Follow the prompts to install OpenCode if needed
If you're in an environment without internet access:
-
Download packages when online:
# Clone the repository git clone https://github.com/jabing/my-opencode.git cd my-opencode/offline-packages # Download all dependencies (requires internet) ./download-packages.sh
-
Copy to offline environment:
# Copy the entire offline-packages directory cp -r offline-packages/ /path/to/offline/environment/ -
Install in offline environment:
cd /path/to/offline/environment/offline-packages ./install-offline.sh
-
Install Node.js manually:
- Windows: Run
offline-packages/nodejs/windows/node-installer.msi - macOS: Run
offline-packages/nodejs/macos/node-installer.pkg - Linux: Extract
offline-packages/nodejs/linux/node-*.tar.xz
- Windows: Run
-
Install Git manually (if needed):
- Windows: Run
offline-packages/git/windows/git-installer.exe - macOS: Run
offline-packages/git/macos/git-installer.pkg - Linux: Install
offline-packages/git/linux/git*.deb
- Windows: Run
-
Install OpenCode manually:
# Extract OpenCode to user directory mkdir -p ~/.opencode/bin # Windows unzip offline-packages/opencode/windows/opencode-windows-x64.zip -d ~/.opencode/bin # macOS (Intel) unzip offline-packages/opencode/macos/opencode-darwin-x64.zip -d ~/.opencode/bin # macOS (Apple Silicon) unzip offline-packages/opencode/macos/opencode-darwin-arm64.zip -d ~/.opencode/bin # Linux tar -xzf offline-packages/opencode/linux/opencode-linux-x64.tar.gz -d ~/.opencode/bin # Set permissions (Linux/macOS) chmod +x ~/.opencode/bin/opencode
-
Install My OpenCode Tool:
# Navigate to project directory cd /path/to/my-opencode # Install locally npm install -g .
After installation, you can use any of these commands:
# Using the full command
my-opencode
# Using the alias
opencode-setup
# Short alias
oad
# With options
oad --force
oad --global
oad --source /path/to/agent-constitution# Deploy Agent Constitution
oad deploy [options]
Options:
-f, --force Overwrite existing files
--no-disable-builtins Do not disable built-in agents
-s, --source <path> Path to agent-constitution source
-g, --global Install globally (user config)
-p, --project Install to project (default)
-h, --help Display help
# Check OpenCode installation
oad check-opencode
# Install OpenCode only
oad install-opencode [--offline]This tool deploys a 6-role professional AI development team:
- 🎼 Conductor - Final arbiter, controls iteration and termination
- 🔍 Analyst - Defines problem boundaries and verifiability
- 📋 Planner - Produces executable tasks without implementation details
- 🔨 Implementer - Executes tasks exactly as specified
- ✅ Reviewer - Validates compliance only
- 🧪 Tester - Provides reproducible evidence only
-
Node.js 12.0 or higher
- Download: https://nodejs.org/
- Recommended: LTS version (Long Term Support)
- Verification:
node --version
-
Git (required for downloading Agent Constitution)
- Download: https://git-scm.com/downloads
- Verification:
git --version
-
Internet connection (or offline packages)
-
OpenCode CLI (will be installed automatically if missing)
- Official: https://opencode.ai
- Verification:
opencode --version
-
curl or wget (for downloading OpenCode)
- Usually pre-installed on macOS and Linux
- Windows: Included in Windows 10+ or install separately
When official networks are unavailable, you can use offline packages from the offline-packages/ directory:
# Structure of offline-packages directory
offline-packages/
├── nodejs/ # Node.js installers (planned)
│ ├── windows/
│ ├── macos/
│ └── linux/
├── git/ # Git installers (planned)
│ ├── windows/
│ ├── macos/
│ └── linux/
├── opencode/ # OpenCode binaries (planned)
│ ├── windows/
│ ├── macos/
│ └── linux/
└── README.md # Offline installation guideWindows:
- Download installer from nodejs.org
- Run the installer (.msi file)
- Check "Add to PATH" during installation
- Verify: Open Command Prompt and run
node --version
macOS:
# Using Homebrew (recommended)
brew install node
# Or download from website
# https://nodejs.org/download/Linux:
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# Fedora/RHEL
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo yum install nodejs
# Arch Linux
sudo pacman -S nodejs npm# Check Node.js
node --version # Should show v12.0.0 or higher
npm --version # Should show npm version
# Check Git
git --version # Should show git version
# Check OpenCode (after installation)
opencode --version# On Linux/macOS
sudo npm install -g https://github.com/jabing/my-opencode.git
# Or install without sudo
npm install -g --prefix ~/.npm-global https://github.com/jabing/my-opencode.git# Add npm global bin to PATH
export PATH="$PATH:$(npm bin -g)"# The tool automatically tries GitCode mirrors
# You can also set proxy:
export https_proxy=http://your-proxy:port# Clone the repository
git clone https://github.com/jabing/my-opencode.git
cd my-opencode
# Run the tool
node setup-opencode.js
# Or install locally for testing
npm install -g .MIT License - see LICENSE file for details.
My OpenCode Tool 是一个专业的部署工具,用于在任何项目中设置 OpenCode Agent Constitution。它自动化了6角色AI开发团队框架的安装和配置。
- 🚀 一键部署 Agent Constitution
- 🔧 自动安装OpenCode,支持离线回退
- 📦 智能网络检测 - 尝试多个源
- 🌐 多平台支持 (Windows, macOS, Linux)
- 🔄 GitCode镜像支持 - 为中国用户优化
- 🛡️ 离线安装 能力
# 全局安装
npm install -g https://github.com/jabing/my-opencode.git
# 或在项目中本地安装
npm install --save-dev https://github.com/jabing/my-opencode.git# 全局安装
npm install -g https://gitcode.com/jabing/my-opencode.git
# 或在项目中本地安装
npm install --save-dev https://gitcode.com/jabing/my-opencode.git# 从GitHub克隆
git clone https://github.com/jabing/my-opencode.git
# 或从GitCode克隆(中国用户更快)
git clone https://gitcode.com/jabing/my-opencode.git
cd my-opencode
# 全局安装
npm install -g .
# 或直接使用
node setup-opencode.js# 直接运行,无需安装
npx https://raw.githubusercontent.com/jabing/my-opencode/main/setup-opencode.js deploy
# 或从GitCode
npx https://gitcode.com/jabing/my-opencode/raw/main/setup-opencode.js deploy-
安装工具:
npm install -g https://github.com/jabing/my-opencode.git
-
进入项目目录:
cd /path/to/your/project -
部署Agent Constitution:
oad deploy
-
按照提示 安装OpenCode(如果需要)
如果您在没有网络访问的环境中使用:
-
在有网络时下载包:
# 克隆仓库 git clone https://github.com/jabing/my-opencode.git cd my-opencode/offline-packages # 下载所有依赖(需要网络) ./download-packages.sh
-
复制到离线环境:
# 复制整个 offline-packages 目录 cp -r offline-packages/ /path/to/offline/environment/ -
在离线环境中安装:
cd /path/to/offline/environment/offline-packages ./install-offline.sh
-
手动安装Node.js:
- Windows: 运行
offline-packages/nodejs/windows/node-installer.msi - macOS: 运行
offline-packages/nodejs/macos/node-installer.pkg - Linux: 解压
offline-packages/nodejs/linux/node-*.tar.xz
- Windows: 运行
-
手动安装Git(如果需要):
- Windows: 运行
offline-packages/git/windows/git-installer.exe - macOS: 运行
offline-packages/git/macos/git-installer.pkg - Linux: 安装
offline-packages/git/linux/git*.deb
- Windows: 运行
-
手动安装OpenCode:
# 解压OpenCode到用户目录 mkdir -p ~/.opencode/bin # Windows unzip offline-packages/opencode/windows/opencode-windows-x64.zip -d ~/.opencode/bin # macOS (Intel) unzip offline-packages/opencode/macos/opencode-darwin-x64.zip -d ~/.opencode/bin # macOS (Apple Silicon) unzip offline-packages/opencode/macos/opencode-darwin-arm64.zip -d ~/.opencode/bin # Linux tar -xzf offline-packages/opencode/linux/opencode-linux-x64.tar.gz -d ~/.opencode/bin # 设置权限 (Linux/macOS) chmod +x ~/.opencode/bin/opencode
-
安装My OpenCode Tool:
# 进入项目目录 cd /path/to/my-opencode # 本地安装 npm install -g .
安装后,您可以使用以下命令:
# 使用完整命令
my-opencode
# 使用别名
opencode-setup
# 简短别名
oad
# 带选项
oad --force
oad --global
oad --source /path/to/agent-constitution# 部署Agent Constitution
oad deploy [选项]
选项:
-f, --force 覆盖现有文件
--no-disable-builtins 不禁用内置代理
-s, --source <路径> agent-constitution源路径
-g, --global 全局安装(用户配置)
-p, --project 安装到项目(默认)
-h, --help 显示帮助
# 检查OpenCode安装
oad check-opencode
# 仅安装OpenCode
oad install-opencode [--offline]此工具部署一个6角色的专业AI开发团队:
- 🎼 指挥家 (Conductor) - 最终决策者,控制迭代和终止
- 🔍 分析师 (Analyst) - 定义问题边界和可验证性
- 📋 规划师 (Planner) - 生成可执行任务,不包含实现细节
- 🔨 实施者 (Implementer) - 严格按照规划执行任务
- ✅ 评审员 (Reviewer) - 仅验证合规性
- 🧪 测试员 (Tester) - 仅提供可复现的证据
-
Node.js 12.0 或更高版本
- 下载地址:https://nodejs.org/
- 推荐:LTS版本(长期支持版)
- 验证:
node --version
-
Git(用于下载Agent Constitution)
- 下载地址:https://git-scm.com/downloads
- 验证:
git --version
-
网络连接(或离线包)
-
OpenCode CLI(如果缺失会自动安装)
- 官方网站:https://opencode.ai
- 验证:
opencode --version
-
curl 或 wget(用于下载OpenCode)
- macOS和Linux通常已预装
- Windows:Windows 10+已包含或需单独安装
当官方网络不可用时,您可以使用 offline-packages/ 目录中的离线包:
# offline-packages 目录结构
offline-packages/
├── nodejs/ # Node.js安装程序(计划中)
│ ├── windows/
│ ├── macos/
│ └── linux/
├── git/ # Git安装程序(计划中)
│ ├── windows/
│ ├── macos/
│ └── linux/
├── opencode/ # OpenCode二进制文件(计划中)
│ ├── windows/
│ ├── macos/
│ └── linux/
└── README.md # 离线安装指南Windows:
- 从 nodejs.org 下载安装程序
- 运行安装程序(.msi文件)
- 安装过程中勾选"Add to PATH"
- 验证:打开命令提示符并运行
node --version
macOS:
# 使用Homebrew(推荐)
brew install node
# 或从网站下载
# https://nodejs.org/download/Linux:
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# Fedora/RHEL
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo yum install nodejs
# Arch Linux
sudo pacman -S nodejs npm# 检查Node.js
node --version # 应显示 v12.0.0 或更高版本
npm --version # 应显示npm版本
# 检查Git
git --version # 应显示git版本
# 检查OpenCode(安装后)
opencode --version# 在Linux/macOS上
sudo npm install -g https://github.com/jabing/my-opencode.git
# 或不使用sudo安装
npm install -g --prefix ~/.npm-global https://github.com/jabing/my-opencode.git# 将npm全局bin目录添加到PATH
export PATH="$PATH:$(npm bin -g)"# 工具会自动尝试GitCode镜像
# 您也可以设置代理:
export https_proxy=http://your-proxy:port# 克隆仓库
git clone https://github.com/jabing/my-opencode.git
cd my-opencode
# 运行工具
node setup-opencode.js
# 或本地安装测试
npm install -g .MIT 许可证 - 详见 LICENSE 文件。
This project is NOT officially affiliated with or endorsed by the OpenCode team. It is an independent tool created by the community to enhance the OpenCode experience.
此项目不是OpenCode官方团队的产品或官方支持的工具。这是一个由社区创建的独立工具,旨在增强OpenCode的使用体验。
| 特性 | 官方OpenCode | My OpenCode Tool |
|---|---|---|
| 开发团队 | OpenCode官方团队 | 社区开发者 |
| 主要功能 | AI代码助手核心功能 | Agent Constitution部署工具 |
| 安装方式 | 官方安装脚本 | npm/GitHub安装 |
| 支持渠道 | 官方文档和支持 | GitHub Issues |
| 更新频率 | 定期官方发布 | 社区维护 |
- 官方工具优先:对于核心AI编码功能,请使用官方OpenCode工具
- 互补使用:此工具用于部署和管理Agent Constitution环境
- 问题反馈:遇到问题请在GitHub Issues中报告
- 贡献欢迎:欢迎提交Pull Request改进工具
最后更新: 2026年2月8日
版本: 1.0.0
维护者: jabing
许可证: MIT