create-squirrel-opencode-harness 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,13 +14,20 @@
|
|
|
14
14
|
- 🌐 Multi-language support (English/Chinese)
|
|
15
15
|
- 📁 Automatic `.opencode/` directory structure
|
|
16
16
|
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
Before installing, ensure you have:
|
|
20
|
+
|
|
21
|
+
- **Opencode CLI installed** - Install globally: `npm i -g opencode-ai`
|
|
22
|
+
- **AI Provider configured** - Set up your API keys in Opencode (OpenAI, Anthropic, Fireworks, etc.)
|
|
23
|
+
|
|
17
24
|
## Quick Start
|
|
18
25
|
|
|
19
|
-
No installation needed! Use `npm
|
|
26
|
+
No installation needed! Use `npm create` or `npx`:
|
|
20
27
|
|
|
21
28
|
```bash
|
|
22
|
-
# Using npm
|
|
23
|
-
npm
|
|
29
|
+
# Using npm create (recommended)
|
|
30
|
+
npm create squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"
|
|
24
31
|
|
|
25
32
|
# Using npx
|
|
26
33
|
npx create-squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"
|
|
@@ -68,22 +75,20 @@ echo "your-model-id" | create-squirrel-opencode-harness --stdin
|
|
|
68
75
|
create-squirrel-opencode-harness --interactive
|
|
69
76
|
```
|
|
70
77
|
|
|
71
|
-
### With npm
|
|
72
|
-
|
|
73
|
-
When using `npm init`, pass arguments after `--`:
|
|
78
|
+
### With npm create
|
|
74
79
|
|
|
75
80
|
```bash
|
|
76
|
-
# Basic usage with npm
|
|
77
|
-
npm
|
|
81
|
+
# Basic usage with npm create
|
|
82
|
+
npm create squirrel-opencode-harness "your-model-id"
|
|
78
83
|
|
|
79
84
|
# With language option
|
|
80
|
-
npm
|
|
85
|
+
npm create squirrel-opencode-harness "your-model-id" --lang zh
|
|
81
86
|
|
|
82
87
|
# Interactive mode
|
|
83
|
-
npm
|
|
88
|
+
npm create squirrel-opencode-harness --interactive --lang zh
|
|
84
89
|
|
|
85
90
|
# Using stdin (pipe model id)
|
|
86
|
-
echo "your-model-id" | npm
|
|
91
|
+
echo "your-model-id" | npm create squirrel-opencode-harness --stdin
|
|
87
92
|
```
|
|
88
93
|
|
|
89
94
|
### Language Selection
|
|
@@ -140,13 +145,50 @@ Options:
|
|
|
140
145
|
└── sprint-status-template.md
|
|
141
146
|
```
|
|
142
147
|
|
|
148
|
+
## Next Steps (After Installation)
|
|
149
|
+
|
|
150
|
+
Once the harness is scaffolded, follow these steps to start working:
|
|
151
|
+
|
|
152
|
+
### Workflow Overview
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# 1. Run in your project directory
|
|
156
|
+
npm create squirrel-opencode-harness "your-model-id"
|
|
157
|
+
|
|
158
|
+
# 2. Start opencode
|
|
159
|
+
opencode
|
|
160
|
+
|
|
161
|
+
# 3. Press Tab to switch to the agent named "harness" and start collaborating
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 1. Start Opencode
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# In the same directory where you ran the scaffold
|
|
168
|
+
opencode
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 2. Switch to Harness Agent
|
|
172
|
+
|
|
173
|
+
- Press **Tab** to cycle through available agents
|
|
174
|
+
- Select **`harness`** agent - this is your main interface for AI collaboration
|
|
175
|
+
- ⚠️ **Important**: Always use the `harness` agent for communication. Do NOT use `planner`, `generator`, or `evaluator` directly - the harness will orchestrate these automatically.
|
|
176
|
+
|
|
177
|
+
### 3. Begin Your First Sprint
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
You: I want to build a todo list app
|
|
181
|
+
|
|
182
|
+
Harness: [Will create a sprint contract and guide you through the process]
|
|
183
|
+
```
|
|
184
|
+
|
|
143
185
|
## Examples
|
|
144
186
|
|
|
145
187
|
### Example 1: Quick Start
|
|
146
188
|
|
|
147
189
|
```bash
|
|
148
|
-
# Using npm
|
|
149
|
-
npm
|
|
190
|
+
# Using npm create (no install needed)
|
|
191
|
+
npm create squirrel-opencode-harness "openai/gpt-4"
|
|
150
192
|
|
|
151
193
|
# Or with npx
|
|
152
194
|
npx create-squirrel-opencode-harness "openai/gpt-4"
|
|
@@ -155,7 +197,7 @@ npx create-squirrel-opencode-harness "openai/gpt-4"
|
|
|
155
197
|
### Example 2: Interactive Mode in Chinese
|
|
156
198
|
|
|
157
199
|
```bash
|
|
158
|
-
npm
|
|
200
|
+
npm create squirrel-opencode-harness --interactive --lang zh
|
|
159
201
|
|
|
160
202
|
# Or with npx
|
|
161
203
|
npx create-squirrel-opencode-harness --interactive --lang zh
|
|
@@ -165,7 +207,7 @@ npx create-squirrel-opencode-harness --interactive --lang zh
|
|
|
165
207
|
|
|
166
208
|
```bash
|
|
167
209
|
export MODEL_ID="anthropic/claude-3-sonnet"
|
|
168
|
-
echo $MODEL_ID | npm
|
|
210
|
+
echo $MODEL_ID | npm create squirrel-opencode-harness --stdin
|
|
169
211
|
```
|
|
170
212
|
|
|
171
213
|
## Error Handling
|
|
@@ -204,13 +246,20 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
204
246
|
- 🌐 多语言支持(英文/中文)
|
|
205
247
|
- 📁 自动创建 `.opencode/` 目录结构
|
|
206
248
|
|
|
249
|
+
## 前置要求
|
|
250
|
+
|
|
251
|
+
安装前,请确保您已具备:
|
|
252
|
+
|
|
253
|
+
- **Opencode CLI 已安装** - 全局安装:`npm i -g opencode-ai`
|
|
254
|
+
- **AI Provider 已配置** - 在 Opencode 中设置您的 API 密钥(OpenAI、Anthropic、Fireworks 等)
|
|
255
|
+
|
|
207
256
|
## 快速开始
|
|
208
257
|
|
|
209
|
-
无需安装!直接使用 `npm
|
|
258
|
+
无需安装!直接使用 `npm create` 或 `npx`:
|
|
210
259
|
|
|
211
260
|
```bash
|
|
212
|
-
# 使用 npm
|
|
213
|
-
npm
|
|
261
|
+
# 使用 npm create(推荐)
|
|
262
|
+
npm create squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"
|
|
214
263
|
|
|
215
264
|
# 使用 npx
|
|
216
265
|
npx create-squirrel-opencode-harness "fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo"
|
|
@@ -258,22 +307,20 @@ echo "你的模型id" | create-squirrel-opencode-harness --stdin
|
|
|
258
307
|
create-squirrel-opencode-harness --interactive
|
|
259
308
|
```
|
|
260
309
|
|
|
261
|
-
### 使用 npm
|
|
262
|
-
|
|
263
|
-
使用 `npm init` 时,在 `--` 后传递参数:
|
|
310
|
+
### 使用 npm create
|
|
264
311
|
|
|
265
312
|
```bash
|
|
266
313
|
# 基础用法
|
|
267
|
-
npm
|
|
314
|
+
npm create squirrel-opencode-harness "your-model-id"
|
|
268
315
|
|
|
269
316
|
# 指定语言
|
|
270
|
-
npm
|
|
317
|
+
npm create squirrel-opencode-harness "your-model-id" --lang zh
|
|
271
318
|
|
|
272
319
|
# 交互模式
|
|
273
|
-
npm
|
|
320
|
+
npm create squirrel-opencode-harness --interactive --lang zh
|
|
274
321
|
|
|
275
322
|
# 使用标准输入(管道输入模型id)
|
|
276
|
-
echo "your-model-id" | npm
|
|
323
|
+
echo "your-model-id" | npm create squirrel-opencode-harness --stdin
|
|
277
324
|
```
|
|
278
325
|
|
|
279
326
|
### 语言选择
|
|
@@ -330,13 +377,50 @@ create-squirrel-opencode-harness "模型id" --lang zh
|
|
|
330
377
|
└── sprint-status-template.md
|
|
331
378
|
```
|
|
332
379
|
|
|
380
|
+
## 后续步骤(安装后)
|
|
381
|
+
|
|
382
|
+
脚手架搭建完成后,按以下步骤开始工作:
|
|
383
|
+
|
|
384
|
+
### 工作流程概览
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
# 1. 在项目目录运行创建命令
|
|
388
|
+
npm create squirrel-opencode-harness "your-model-id"
|
|
389
|
+
|
|
390
|
+
# 2. 启动 opencode
|
|
391
|
+
opencode
|
|
392
|
+
|
|
393
|
+
# 3. 按 Tab 键切换到名叫 "harness" 的 agent 开始协作
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### 1. 启动 Opencode
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
# 在运行脚手架的同一目录
|
|
400
|
+
opencode
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### 2. 切换到 Harness Agent
|
|
404
|
+
|
|
405
|
+
- 按 **Tab** 键循环切换可用 agent
|
|
406
|
+
- 选择 **`harness`** agent - 这是您与 AI 协作的主要界面
|
|
407
|
+
- ⚠️ **重要**:请始终使用 `harness` agent 进行交流。**不要**直接使用 `planner`、`generator` 或 `evaluator` - harness 会自动协调这些 agent。
|
|
408
|
+
|
|
409
|
+
### 3. 开始您的第一个 Sprint
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
您:我想构建一个待办事项应用
|
|
413
|
+
|
|
414
|
+
Harness: [将创建 sprint 合同并引导您完成整个过程]
|
|
415
|
+
```
|
|
416
|
+
|
|
333
417
|
## 使用示例
|
|
334
418
|
|
|
335
419
|
### 示例 1:快速开始
|
|
336
420
|
|
|
337
421
|
```bash
|
|
338
|
-
# 使用 npm
|
|
339
|
-
npm
|
|
422
|
+
# 使用 npm create(无需安装)
|
|
423
|
+
npm create squirrel-opencode-harness "openai/gpt-4"
|
|
340
424
|
|
|
341
425
|
# 或使用 npx
|
|
342
426
|
npx create-squirrel-opencode-harness "openai/gpt-4"
|
|
@@ -345,7 +429,7 @@ npx create-squirrel-opencode-harness "openai/gpt-4"
|
|
|
345
429
|
### 示例 2:中文交互模式
|
|
346
430
|
|
|
347
431
|
```bash
|
|
348
|
-
npm
|
|
432
|
+
npm create squirrel-opencode-harness --interactive --lang zh
|
|
349
433
|
|
|
350
434
|
# 或使用 npx
|
|
351
435
|
npx create-squirrel-opencode-harness --interactive --lang zh
|
|
@@ -355,7 +439,7 @@ npx create-squirrel-opencode-harness --interactive --lang zh
|
|
|
355
439
|
|
|
356
440
|
```bash
|
|
357
441
|
export MODEL_ID="anthropic/claude-3-sonnet"
|
|
358
|
-
echo $MODEL_ID | npm
|
|
442
|
+
echo $MODEL_ID | npm create squirrel-opencode-harness --stdin
|
|
359
443
|
```
|
|
360
444
|
|
|
361
445
|
## 错误处理
|