English | 中文
🐿️ Scaffold Squirrel Opencode harness into your project with configurable AI models.
- 🚀 Quick setup of multi-agent harness system
- 🎛️ Configurable AI model identifiers
- 🔒 Transactional file copying (all-or-nothing)
- 🌐 Multi-language support (English/Chinese)
- 📁 Automatic
.opencode/directory structure
Before installing, ensure you have:
- Opencode CLI installed - Install globally:
npm i -g opencode-ai - AI Provider configured - Set up your API keys in Opencode (OpenAI, Anthropic, Fireworks, etc.)
No installation needed! Use npm create or npx:
# Using npm create (recommended)
npm create squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"
# Using npx
npx create-squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"
# Using pnpm
pnpm create squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"For frequent use, install globally:
# Using npm
npm install -g create-squirrel-opencode-harness
# Using pnpm
pnpm add -g create-squirrel-opencode-harness
# Using yarn
yarn global add create-squirrel-opencode-harnessThen use without npx:
create-squirrel-opencode-harness "your-model-id"# Using positional argument (default language: English)
create-squirrel-opencode-harness "openai/gpt-4"
# Using --model option
create-squirrel-opencode-harness --model "your-model-id"
# Using stdin
echo "your-model-id" | create-squirrel-opencode-harness --stdin
# Interactive mode
create-squirrel-opencode-harness --interactive# Basic usage with npm create
npm create squirrel-opencode-harness "your-model-id"
# With language option
npm create squirrel-opencode-harness "your-model-id" --lang zh
# Interactive mode
npm create squirrel-opencode-harness --interactive --lang zh
# Using stdin (pipe model id)
echo "your-model-id" | npm create squirrel-opencode-harness --stdin# English (default)
create-squirrel-opencode-harness "model-id" --lang en
# Chinese (中文)
create-squirrel-opencode-harness "model-id" --lang zhUsage: create-squirrel-opencode-harness [options] [model]
Options:
-V, --version output the version number
-m, --model <model> Model identifier for agents
-i, --interactive Use interactive mode to input model
--stdin Read model from stdin
-l, --lang <lang> Language (en/zh) (default: "en")
-h, --help display help for command
-
Directory Check: Creates
.opencode/directory structure.opencode/agents/- Agent definitions.opencode/harness/- Sprint templates
-
Model Configuration: Replaces
<%= model %>placeholder in agent files with your model identifier -
Transactional Copy: Checks all files before copying - if any file exists, aborts with error
.opencode/
├── agents/
│ ├── evaluator.md # Evaluator agent with your model
│ ├── generator.md # Generator agent with your model
│ ├── harness.md # Orchestrator agent with your model
│ └── planner.md # Planner agent with your model
└── harness/
└── templates/
├── contract-template.md
├── evaluation-template.md
├── final-summary-template.md
├── handoff-template.md
├── self-eval-template.md
├── spec-template.md
└── sprint-status-template.md
Once the harness is scaffolded, follow these steps to start working:
# 1. Run in your project directory
npm create squirrel-opencode-harness "your-model-id"
# 2. Start opencode
opencode
# 3. Press Tab to switch to the agent named "harness" and start collaborating# In the same directory where you ran the scaffold
opencode- Press Tab to cycle through available agents
- Select
harnessagent - this is your main interface for AI collaboration ⚠️ Important: Always use theharnessagent for communication. Do NOT useplanner,generator, orevaluatordirectly - the harness will orchestrate these automatically.
You: I want to build a todo list app
Harness: [Will create a sprint contract and guide you through the process]
# Using npm create (no install needed)
npm create squirrel-opencode-harness "openai/gpt-4"
# Or with npx
npx create-squirrel-opencode-harness "openai/gpt-4"npm create squirrel-opencode-harness --interactive --lang zh
# Or with npx
npx create-squirrel-opencode-harness --interactive --lang zhexport MODEL_ID="anthropic/claude-3-sonnet"
echo $MODEL_ID | npm create squirrel-opencode-harness --stdin- Transaction Protection: If any target file exists, the entire operation is aborted
- Missing Model: Returns error if model identifier is not provided
- Missing Source: Returns error if source directories (agents/, harness/) are missing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details.
English | 中文
🐿️ 将 Squirrel Opencode Harness 脚手架快速搭建到您的项目中,支持可配置的 AI 模型。
- 🚀 快速设置多代理 Harness 系统
- 🎛️ 可配置的 AI 模型标识符
- 🔒 事务性文件复制(全有或全无)
- 🌐 多语言支持(英文/中文)
- 📁 自动创建
.opencode/目录结构
安装前,请确保您已具备:
- Opencode CLI 已安装 - 全局安装:
npm i -g opencode-ai - AI Provider 已配置 - 在 Opencode 中设置您的 API 密钥(OpenAI、Anthropic、Fireworks 等)
无需安装!直接使用 npm create 或 npx:
# 使用 npm create(推荐)
npm create squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"
# 使用 npx
npx create-squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"
# 使用 pnpm
pnpm create squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"如需频繁使用,可以全局安装:
# 使用 npm
npm install -g create-squirrel-opencode-harness
# 使用 pnpm
pnpm add -g create-squirrel-opencode-harness
# 使用 yarn
yarn global add create-squirrel-opencode-harness安装后可直接使用,无需 npx:
create-squirrel-opencode-harness "your-model-id"# 使用位置参数(默认语言:英文)
create-squirrel-opencode-harness "openai/gpt-4"
# 使用 --model 选项
create-squirrel-opencode-harness --model "你的模型id"
# 使用标准输入
echo "你的模型id" | create-squirrel-opencode-harness --stdin
# 交互模式
create-squirrel-opencode-harness --interactive# 基础用法
npm create squirrel-opencode-harness "your-model-id"
# 指定语言
npm create squirrel-opencode-harness "your-model-id" --lang zh
# 交互模式
npm create squirrel-opencode-harness --interactive --lang zh
# 使用标准输入(管道输入模型id)
echo "your-model-id" | npm create squirrel-opencode-harness --stdin# 英文(默认)
create-squirrel-opencode-harness "模型id" --lang en
# 中文
create-squirrel-opencode-harness "模型id" --lang zh使用方法: create-squirrel-opencode-harness [选项] [模型]
选项:
-V, --version 输出版本号
-m, --model <模型> 代理模型标识符
-i, --interactive 使用交互式模式输入模型
--stdin 从标准输入读取模型
-l, --lang <语言> 语言 (en/zh) (默认: "en")
-h, --help 显示帮助信息
-
目录检查:创建
.opencode/目录结构.opencode/agents/- 代理定义文件.opencode/harness/- Sprint 模板文件
-
模型配置:将代理文件中的
<%= model %>占位符替换为您的模型标识符 -
事务复制:复制前检查所有文件 - 如果任何文件已存在,则中止并报错
.opencode/
├── agents/
│ ├── evaluator.md # 评估器代理(使用您的模型)
│ ├── generator.md # 生成器代理(使用您的模型)
│ ├── harness.md # 协调器代理(使用您的模型)
│ └── planner.md # 规划器代理(使用您的模型)
└── harness/
└── templates/
├── contract-template.md
├── evaluation-template.md
├── final-summary-template.md
├── handoff-template.md
├── self-eval-template.md
├── spec-template.md
└── sprint-status-template.md
脚手架搭建完成后,按以下步骤开始工作:
# 1. 在项目目录运行创建命令
npm create squirrel-opencode-harness "your-model-id"
# 2. 启动 opencode
opencode
# 3. 按 Tab 键切换到名叫 "harness" 的 agent 开始协作# 在运行脚手架的同一目录
opencode- 按 Tab 键循环切换可用 agent
- 选择
harnessagent - 这是您与 AI 协作的主要界面 ⚠️ 重要:请始终使用harnessagent 进行交流。不要直接使用planner、generator或evaluator- harness 会自动协调这些 agent。
您:我想构建一个待办事项应用
Harness: [将创建 sprint 合同并引导您完成整个过程]
# 使用 npm create(无需安装)
npm create squirrel-opencode-harness "openai/gpt-4"
# 或使用 npx
npx create-squirrel-opencode-harness "openai/gpt-4"npm create squirrel-opencode-harness --interactive --lang zh
# 或使用 npx
npx create-squirrel-opencode-harness --interactive --lang zhexport MODEL_ID="anthropic/claude-3-sonnet"
echo $MODEL_ID | npm create squirrel-opencode-harness --stdin- 事务保护:如果任何目标文件已存在,整个操作将被中止
- 缺失模型:如果未提供模型标识符,将返回错误
- 缺失源文件:如果源目录(agents/、harness/)不存在,将返回错误
- Fork 本仓库
- 创建功能分支 (
git checkout -b feature/amazing-feature) - 提交更改 (
git commit -m '添加了某个 amazing 功能') - 推送到分支 (
git push origin feature/amazing-feature) - 创建 Pull Request
MIT 许可证 - 详情请查看 LICENSE 文件。