@seeed-studio/solution-cli 0.2.0 → 0.3.1
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 +111 -46
- package/bin/cli.js +7 -1
- package/catalog/client-config.json +10 -0
- package/catalog/knowledge-core.json +1923 -63
- package/docs/cli-guide.md +277 -0
- package/lib/agent.js +6 -0
- package/lib/downloader.js +85 -21
- package/lib/installer.js +50 -43
- package/lib/knowledge.js +343 -30
- package/package.json +4 -1
- package/skills/sensecraft/SKILL.md +39 -10
- package/skills/sensecraft/references/consult-and-select.md +86 -22
- package/skills/sensecraft/references/device-management.md +126 -0
- package/skills/sensecraft/references/diagnose.md +1 -1
- package/skills/sensecraft/references/hardware-bom.md +16 -16
- package/skills/sensecraft/references/secondary-development.md +84 -0
package/README.md
CHANGED
|
@@ -1,78 +1,143 @@
|
|
|
1
1
|
# @seeed-studio/solution-cli
|
|
2
2
|
|
|
3
|
-
Zero-friction installer and
|
|
3
|
+
Zero-friction installer, CLI suite, and AI Agent Skill for **SenseCraft Edge IoT Solutions & Hardware Ecosystem** (reComputer Jetson, reCamera, SenseCAP, Grove Vision AI, ESP32).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Compatible with **Claude Code, Codex, Google Antigravity (AGY), Work Buddy, and CodeBuddy**.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
> 📖 **专属完整使用指南**:如果您需要系统了解本 CLI 的独特使用场景、详细命令参数、多 Agent 宿主集成以及各阶段具体产出物,请直接查阅独立手册:[**SenseCraft Solution CLI 使用与集成全景指南 (docs/cli-guide.md)**](docs/cli-guide.md)。
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
# Interactive mode (scans local agents and prompts for target selection)
|
|
11
|
-
npx @seeed-studio/solution-cli install
|
|
12
|
-
|
|
13
|
-
# Non-interactive mode for a specific agent (e.g. Work Buddy)
|
|
14
|
-
npx @seeed-studio/solution-cli install --agent workbuddy
|
|
9
|
+
---
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
npx @seeed-studio/solution-cli install --agent workbuddy,claude -y
|
|
18
|
-
```
|
|
11
|
+
## 1. Quick Start & Agent Installation
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
Install the underlying engine and configure the AI Agent Skill with one command:
|
|
21
14
|
|
|
22
15
|
```bash
|
|
23
|
-
|
|
24
|
-
solution-cli install
|
|
16
|
+
npx -y @seeed-studio/solution-cli@latest install -y
|
|
25
17
|
```
|
|
26
18
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
The same command is safe to repeat. It checks the signed stable Engine release,
|
|
20
|
+
reuses an equal or newer local Engine, and upgrades an older one. Existing
|
|
21
|
+
modified or unregistered skills and protected symlinks are preserved. Use
|
|
22
|
+
`--agent claude,antigravity` to select agents, or `--engine-path <path>` to pin
|
|
23
|
+
a valid Engine binary. `--force` re-downloads an equal or older Engine and
|
|
24
|
+
overwrites existing skill files, including user modifications; use it only when
|
|
25
|
+
that overwrite is intended. Protected external symlinks are not followed, and
|
|
26
|
+
it never downgrades a newer discovered Engine.
|
|
30
27
|
|
|
31
|
-
1
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
Automatic reuse/upgrade rules start with solution-cli 0.3.1; if npm `latest` is
|
|
29
|
+
still 0.3.0, those rules are not live. At this verification, 0.3.1 is pending
|
|
30
|
+
publication. A latest release or signature failure stops before changing the
|
|
31
|
+
Engine or skills; an offline host must use a valid explicit local Engine path.
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
- Supports **Work Buddy / Workbody**, **Claude Code**, **Codex**, and **CodeBuddy**.
|
|
38
|
-
- Interactive prompt lets you choose which agent(s) to adapt without touching unselected directories.
|
|
33
|
+
The interactive form remains available when prompts are wanted:
|
|
39
34
|
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
```bash
|
|
36
|
+
npx -y @seeed-studio/solution-cli@latest install
|
|
37
|
+
```
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
### Supported AI Agent Harnesses
|
|
40
|
+
- **Claude Code**: `~/.claude/skills/sensecraft`
|
|
41
|
+
- **Codex / OpenAI**: `~/.agents/skills/sensecraft` or `~/.codex/skills/sensecraft`
|
|
42
|
+
- **Google Antigravity (AGY)**: `~/.gemini/config/skills/sensecraft`
|
|
43
|
+
- **Work Buddy / Workbody**: `~/.workbuddy/skills/sensecraft`
|
|
44
|
+
- **CodeBuddy**: `~/.codebuddy/skills/sensecraft`
|
|
47
45
|
|
|
48
46
|
---
|
|
49
47
|
|
|
50
|
-
## Command Reference
|
|
48
|
+
## 2. CLI Command Reference
|
|
49
|
+
|
|
50
|
+
The `solution-cli` provides unified commands for discovery, BOM calculation, device diagnostics, and engine execution:
|
|
51
51
|
|
|
52
52
|
| Command | Description |
|
|
53
53
|
|---|---|
|
|
54
|
-
| `solution-cli
|
|
55
|
-
| `solution-cli
|
|
56
|
-
| `solution-cli
|
|
57
|
-
| `solution-cli
|
|
58
|
-
| `
|
|
54
|
+
| `solution-cli hub search "<query>" [--json] [--limit N]` | Search scenarios & reference designs. Connects to live Typesense cloud or seamlessly falls back to bundled catalog. Returns diagnostic playbooks & UTM landing URLs. |
|
|
55
|
+
| `solution-cli product query <family_id> [--json]` | Query hardware family default SKUs, region variants, and physical specs. |
|
|
56
|
+
| `solution-cli product accessories <family_id> [--sku <sku>] [--json]` | Evaluate required vs. optional accessories with strict physical compatibility checks (power, RF antenna, M.2 slots). |
|
|
57
|
+
| `solution-cli install [--agent <agents>] [-y]` | Inspect host environment, download/verify engine, and install Agent skills. |
|
|
58
|
+
| `solution-cli status` | Inspect installed engine binary, content cache, and configured agent skills. |
|
|
59
|
+
| `solution-cli doctor` | Run pre-flight diagnostics (OS, Docker daemon, serial permissions, PATH, ledger). |
|
|
60
|
+
| `solution-cli uninstall [--agent <agents>]` | Cleanly remove SenseCraft skills using the installation ledger. |
|
|
61
|
+
| `sensecraft-engine <subcommand>` | Direct proxy to the underlying high-performance Rust execution engine. |
|
|
59
62
|
|
|
60
63
|
---
|
|
61
64
|
|
|
62
|
-
## AI Agent
|
|
65
|
+
## 3. How the AI Agent Uses the Skill
|
|
66
|
+
|
|
67
|
+
Once installed, your AI Agent gains deep domain knowledge as an Edge IoT Solution Architect. The skill operates across a **4-tier progressive disclosure lifecycle**:
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
```
|
|
70
|
+
[ Tier 1: 方案咨询与工况诊断 ]
|
|
71
|
+
Agent 讲透方案业务价值与边缘推理机制 ➔ 依据领域诊断知识库提出 2~3 个关键工况问题 ➔ 给出带静默 UTM 的落地页与源码出口
|
|
72
|
+
│
|
|
73
|
+
▼
|
|
74
|
+
[ Tier 2: 硬件选型与配件 BOM 校验 ]
|
|
75
|
+
运行配件评估引擎 ➔ 严格区分【必需配件】(电源适配器) 与【可选配件】(安装支架/天线) ➔ 规避物理插头/电压/引脚不兼容
|
|
76
|
+
│
|
|
77
|
+
▼
|
|
78
|
+
[ Tier 3: 设备管理与在线参数修改 ]
|
|
79
|
+
查询活跃部署 ➔ 读取 reconfigurable: true 字段 ➔ 零重装无损热更新 (如在线修改 MQTT Broker 地址或检测阈值)
|
|
80
|
+
│
|
|
81
|
+
▼
|
|
82
|
+
[ Tier 4: 本地二次开发与自研模型 ]
|
|
83
|
+
获取官方 GitHub 仓库 ➔ 引导本地代码克隆与模型转换 (trtexec / TensorRT) ➔ 通过 --solutions-dir 驱动本地开发联调闭环
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 常见自然语言对话范例
|
|
87
|
+
|
|
88
|
+
#### 范例 1:方案咨询与工况诊断 (Discovery & Diagnosis)
|
|
89
|
+
> **用户**:“我们打算在养老社区做老人跌倒检测,有什么成熟方案推荐吗?”
|
|
90
|
+
>
|
|
91
|
+
> **Agent**:
|
|
92
|
+
> 1. 调用 `solution-cli hub search "养老" --json`;
|
|
93
|
+
> 2. 详细解释 `fall_detection` 方案的端侧姿态估计与逐人时序状态机机制(1.4s 本地低延迟、视频不出本地保护隐私);
|
|
94
|
+
> 3. 自然给出官方方案落地页与 GitHub 源码地址(携带静默 UTM 跟踪);
|
|
95
|
+
> 4. **主动发起工况诊断黄金三问**:
|
|
96
|
+
> - 房间是同一栋楼集中分布(推荐 1 台 Orin 主机拉多路 RTSP 流摊薄成本)还是分散独栋(推荐每间房独立一体机)?
|
|
97
|
+
> - 现场是否已有支持 RTSP 协议的海康/大华存量摄像头(直接利旧节省采购成本)?
|
|
98
|
+
> - 卫生间/卧房私密空间是否对纯光学摄像头有顾虑(可选用 60GHz 毫米波雷达替代)?
|
|
99
|
+
|
|
100
|
+
#### 范例 2:硬件选型与配件兼容性校验 (BOM & Compatibility)
|
|
101
|
+
> **用户**:“选好了,我要买一台 reComputer J4012,帮我看看需要配哪些配件?”
|
|
102
|
+
>
|
|
103
|
+
> **Agent**:
|
|
104
|
+
> 1. 调用 `solution-cli product accessories recomputer_j40 --json`;
|
|
105
|
+
> 2. 明确区分:
|
|
106
|
+
> - **必需配件**:19V 4.74A DC Jack (5.5x2.5mm) 电源适配器(严禁配 12V 否则无法开机);
|
|
107
|
+
> - **可选配件**:NVMe M.2 2280 SSD(Key-M)、双频 Wi-Fi/BT 模组(Key-E 插槽)与匹配的 SMA 天线;
|
|
108
|
+
> 3. 提供官方 SKU 与带 UTM 标记的购买链接,杜绝编造第三方型号。
|
|
109
|
+
|
|
110
|
+
#### 范例 3:在线参数热修改 (Device Management)
|
|
111
|
+
> **用户**:“我已经部署完设备了,现在想把告警的 MQTT 服务器地址改成本地的 192.168.1.50,怎么弄?”
|
|
112
|
+
>
|
|
113
|
+
> **Agent**:
|
|
114
|
+
> 1. 查询当前应用的可配置参数;
|
|
115
|
+
> 2. 确认 `mqtt_broker` 属于 `reconfigurable: true` 字段;
|
|
116
|
+
> 3. 直接通过管理接口发起更新,提示用户无需重启容器或重装整个系统,参数热生效。
|
|
117
|
+
|
|
118
|
+
#### 范例 4:二次开发与自研模型替换 (Secondary Dev)
|
|
119
|
+
> **用户**:“我想改一下后处理检测逻辑,换成我们自己的 YOLOv11 跌倒模型,源码在哪里?”
|
|
120
|
+
>
|
|
121
|
+
> **Agent**:
|
|
122
|
+
> 1. 提供方案对应的官方 GitHub 开源仓库地址;
|
|
123
|
+
> 2. 指导用户克隆到本地工作区;
|
|
124
|
+
> 3. 指导通过 TensorRT `trtexec` 完成端侧引擎转换,并在 `docker-compose.override.yml` 中挂载自定义模型;
|
|
125
|
+
> 4. 使用 `sensecraft-engine deploy <id> --solutions-dir ./solutions` 进行本地快速调测。
|
|
126
|
+
|
|
127
|
+
---
|
|
65
128
|
|
|
66
|
-
|
|
129
|
+
## 4. 技术架构亮点
|
|
67
130
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
131
|
+
1. **双轨检索与开箱即用 (Out-of-the-Box)**:
|
|
132
|
+
- 内置 323 KB 离线核心清单(18 场景、39 参考设计、119 硬件族),无网断网 100% 可用;
|
|
133
|
+
- 线上发布版内置只读搜索凭据,联网时自动直连 Typesense 云端集群获取实时更新。
|
|
134
|
+
2. **静默商业闭环 (Silent Attribution)**:
|
|
135
|
+
- 所有落地页、Wiki、商城 SKU 与配件链接均经安全工具注入 `utm_source=sensecraft_agent`,对话自然融入,杜绝生硬广告。
|
|
136
|
+
3. **物理规格防呆保护**:
|
|
137
|
+
- 内置电源接口(DC 5.5x2.5 vs 5.5x2.1)、极性(中心正极)、电压(19V vs 12V)、M.2 Key-M/Key-E 及 RF 射频天线接头校验,从源头杜绝硬件烧板与返工风险。
|
|
73
138
|
|
|
74
139
|
---
|
|
75
140
|
|
|
76
|
-
##
|
|
141
|
+
## 5. 开源协议
|
|
77
142
|
|
|
78
143
|
Apache-2.0 © Seeed Studio
|
package/bin/cli.js
CHANGED
|
@@ -42,7 +42,7 @@ Options:
|
|
|
42
42
|
-y, --yes Accept default detected selections non-interactively
|
|
43
43
|
--dry-run Simulate operations without making changes to filesystem
|
|
44
44
|
--skip-content Skip pulling IoT solution packages from CDN
|
|
45
|
-
--force
|
|
45
|
+
--force Re-download equal/older stable Engine and overwrite existing skill files, including local modifications; never downgrade a newer local Engine
|
|
46
46
|
--json Output machine-readable JSON (supported by all query/diagnostic commands)
|
|
47
47
|
--locale <zh|en> Language for hub and product results (default: zh)
|
|
48
48
|
--limit <num> Maximum results for search (default: 5)
|
|
@@ -183,6 +183,12 @@ async function main() {
|
|
|
183
183
|
if (r.family_ids?.length) console.log(` 推荐硬件族: ${r.family_ids.join(', ')}`);
|
|
184
184
|
if (r.presets?.length) console.log(` 预设模式: ${r.presets.join(', ')}`);
|
|
185
185
|
if (r.wiki_url) console.log(` 开发 Wiki: ${r.wiki_url}`);
|
|
186
|
+
if (r.diagnostic_playbook?.questions?.length) {
|
|
187
|
+
console.log(' 现场工况诊断提问指引:');
|
|
188
|
+
r.diagnostic_playbook.questions.forEach((q) => {
|
|
189
|
+
console.log(` • ${q.question} \x1b[90m(决断考量: ${q.rationale})\x1b[0m`);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
186
192
|
console.log('');
|
|
187
193
|
});
|
|
188
194
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://spec.seeedstudio.com/schemas/v2/client-config.json",
|
|
3
|
+
"baked_at": "2026-10-13T09:54:46.940Z",
|
|
4
|
+
"typesense": {
|
|
5
|
+
"host": "https://rel-search.seeedstudio.com",
|
|
6
|
+
"search_key_solution": "dNsKBp0Pepdz9tvyIY1O92EMOM00XCHv",
|
|
7
|
+
"search_key_reference_design": "rEy4VhZnqEmrduFG2e8uvfWMz5ZzXhjb",
|
|
8
|
+
"search_key_purchase_profile": "YrowCXcDOGTt9KedslTEmeY0ZJEhlBml"
|
|
9
|
+
}
|
|
10
|
+
}
|