@seeed-studio/sensecraft-cli 0.3.1 → 0.4.0

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.
Files changed (28) hide show
  1. package/INSTALL.md +151 -190
  2. package/README-zh.md +463 -0
  3. package/README.md +9 -13
  4. package/package.json +2 -1
  5. package/scripts/test-install.js +1 -1
  6. package/skills/README.md +14 -35
  7. package/skills/sensecraft-cli/SKILL.md +131 -0
  8. package/skills/{sensecraft-apps → sensecraft-cli}/create-app/SKILL.md +26 -17
  9. package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/manifest-template.json +1 -1
  10. package/skills/{sensecraft-apps/create-app/reference-manifest.md → sensecraft-cli/create-app/references/manifest.md} +17 -14
  11. package/skills/{sensecraft-apps/commands.md → sensecraft-cli/references/app-commands.md} +38 -16
  12. package/skills/{sensecraft-apps/reference-app-fields.md → sensecraft-cli/references/app-fields.md} +4 -3
  13. package/skills/{sensecraft-apps/SKILL.md → sensecraft-cli/references/apps.md} +35 -37
  14. package/skills/{sensecraft-devices-cloud/commands.md → sensecraft-cli/references/cloud-commands.md} +1 -1
  15. package/skills/{sensecraft-devices-cloud/SKILL.md → sensecraft-cli/references/cloud.md} +4 -14
  16. package/skills/{confirmation.md → sensecraft-cli/references/confirmation.md} +2 -2
  17. package/skills/{sensecraft-data/commands.md → sensecraft-cli/references/data-commands.md} +2 -2
  18. package/skills/{sensecraft-data/SKILL.md → sensecraft-cli/references/data.md} +10 -18
  19. package/skills/{sensecraft-files/commands.md → sensecraft-cli/references/file-commands.md} +1 -1
  20. package/skills/{sensecraft-files/SKILL.md → sensecraft-cli/references/files.md} +3 -11
  21. package/skills/{sensecraft-models/commands.md → sensecraft-cli/references/model-commands.md} +5 -5
  22. package/skills/{sensecraft-models/SKILL.md → sensecraft-cli/references/models.md} +17 -27
  23. package/skills/{sensecraft-recamera/commands.md → sensecraft-cli/references/recamera-commands.md} +4 -4
  24. package/skills/{sensecraft-recamera/SKILL.md → sensecraft-cli/references/recamera.md} +6 -16
  25. package/skills/{sensecraft-apps/reference-tool-blocks.md → sensecraft-cli/references/tool-blocks.md} +20 -4
  26. package/skills/sensecraft-ai/SKILL.md +0 -134
  27. /package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/validate_manifest.py +0 -0
  28. /package/skills/{sensecraft-models/reference-model-fields.md → sensecraft-cli/references/model-fields.md} +0 -0
package/INSTALL.md CHANGED
@@ -1,62 +1,62 @@
1
- # SenseCraft CLI 安装指南
1
+ # SenseCraft CLI install guide
2
2
 
3
- 本文说明如何安装、升级、卸载 `sensecraft-cli`,以及如何把 Agent Skills 接到 Cursor 等工具。命令与登录见 [`README.zh.md`](README.zh.md)(英文 [`README.md`](README.md))。
3
+ How to install, upgrade, and uninstall `sensecraft-cli`, and how to connect Agent Skills to Cursor and other tools. Commands and sign-in: [`README.md`](README.md) (Chinese: [`README-zh.md`](README-zh.md)).
4
4
 
5
- ## 1. 环境要求
5
+ ## 1. Requirements
6
6
 
7
- | 项 | 要求 |
8
- |----|------|
9
- | Node.js | **≥ 16**(推荐 18 / 20 LTS) |
10
- | 网络 | 能访问 npm registry,以及二进制下载源(默认阿里云 OSS) |
11
- | 可选 | Go(仅从源码构建时需要,版本见 `go.mod`) |
7
+ | Item | Requirement |
8
+ |------|-------------|
9
+ | Node.js | **≥ 16** (18 or 20 LTS recommended) |
10
+ | Network | Access to the npm registry and the binary download host (Aliyun OSS by default) |
11
+ | Optional | Go, only when building from source. See `go.mod` for the version |
12
12
 
13
- ### 支持的平台
13
+ ### Supported platforms
14
14
 
15
- | OS | 架构 | 二进制名 |
16
- |----|------|----------|
15
+ | OS | Architecture | Binary name |
16
+ |----|--------------|-------------|
17
17
  | macOS | Intel (`x64`) | `sensecraft-cli-darwin-amd64` |
18
18
  | macOS | Apple Silicon (`arm64`) | `sensecraft-cli-darwin-arm64` |
19
19
  | Linux | `x64` / `arm64` | `sensecraft-cli-linux-amd64` / `…-arm64` |
20
20
  | Windows | `x64` / `arm64` | `sensecraft-cli-windows-amd64.exe` / `…-arm64.exe` |
21
21
 
22
- 其它组合会在安装时报 `Unsupported platform`。
22
+ Any other combination fails install with `Unsupported platform`.
23
23
 
24
24
  ---
25
25
 
26
- ## 2. 推荐安装(npm / npx)
26
+ ## 2. Recommended install (npm / npx)
27
27
 
28
- 适用于大多数用户。安装器会:
28
+ This path fits most people. The installer:
29
29
 
30
- 1. 按当前平台下载**与本 npm 包版本一致**的二进制
31
- 2. 全局注册 `sensecraft-cli` 命令
32
- 3. 若本地尚无配置,在交互终端下引导填写 OpenAPI Access Key
30
+ 1. Downloads the binary for this platform, pinned to this npm package version
31
+ 2. Registers the `sensecraft-cli` command globally
32
+ 3. In an interactive terminal, asks for an OpenAPI Access Key when no local config exists yet
33
33
 
34
34
  ### macOS / Linux
35
35
 
36
36
  ```bash
37
- # 确认 Node
37
+ # Check Node
38
38
  node -v # >= v16
39
39
 
40
- # 安装(首次会下载二进制)
40
+ # Install (the first run downloads the binary)
41
41
  npx @seeed-studio/sensecraft-cli install
42
42
 
43
- # 验证
43
+ # Check
44
44
  sensecraft-cli --version
45
45
  sensecraft-cli --help
46
46
  ```
47
47
 
48
- 若提示找不到命令,把 npm 全局 bin 加入 PATH:
48
+ If the shell cannot find the command, add the npm global bin directory to PATH:
49
49
 
50
50
  ```bash
51
51
  npm prefix -g
52
- # 常见路径:
53
- # macOS (Homebrew Node): /opt/homebrew/bin 或 /usr/local/bin
54
- # Linux: ~/.npm-global/bin 或 /usr/bin
55
- echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc # 或 ~/.bashrc
52
+ # Common paths:
53
+ # macOS (Homebrew Node): /opt/homebrew/bin or /usr/local/bin
54
+ # Linux: ~/.npm-global/bin or /usr/bin
55
+ echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
56
56
  source ~/.zshrc
57
57
  ```
58
58
 
59
- ### Windows(PowerShell 或 cmd)
59
+ ### Windows (PowerShell or cmd)
60
60
 
61
61
  ```powershell
62
62
  node -v
@@ -64,11 +64,11 @@ npx @seeed-studio/sensecraft-cli install
64
64
  sensecraft-cli --version
65
65
  ```
66
66
 
67
- - 全局命令一般为 `sensecraft-cli.cmd`,装在 `npm prefix -g` 目录下。
68
- - 若新开终端仍找不到命令:把该目录加入系统 **PATH**,或注销后重开终端。
69
- - 建议使用 **PowerShell 5+** 或 Windows Terminal;Git Bash 一般也可用。
67
+ - The global command is usually `sensecraft-cli.cmd`, in the `npm prefix -g` directory.
68
+ - If a new terminal still cannot find it, add that directory to the system **PATH**, or sign out and open the terminal again.
69
+ - PowerShell 5+ or Windows Terminal is the comfortable choice. Git Bash usually works too.
70
70
 
71
- ### 不全局安装、临时调用
71
+ ### Call it without a global install
72
72
 
73
73
  ```bash
74
74
  npx @seeed-studio/sensecraft-cli --version
@@ -76,64 +76,81 @@ npx @seeed-studio/sensecraft-cli auth info
76
76
  npx @seeed-studio/sensecraft-cli device list
77
77
  ```
78
78
 
79
- `npx` 每次仍可能触发 postinstall 下载/复用本地缓存的二进制。
79
+ Each `npx` run may still trigger postinstall, which downloads the binary or reuses the local cache.
80
80
 
81
- ### 指定版本安装
81
+ ### Install a specific version
82
82
 
83
83
  ```bash
84
- npx @seeed-studio/sensecraft-cli@0.1.3 install
85
- # 或
86
- npm install -g @seeed-studio/sensecraft-cli@0.1.3
84
+ npx @seeed-studio/sensecraft-cli@<version> install
85
+ # or
86
+ npm install -g @seeed-studio/sensecraft-cli@<version>
87
87
  ```
88
88
 
89
- 二进制 URL 形如:
89
+ Binary URLs look like:
90
90
 
91
- `{RELEASE_BASE}/v{版本}/sensecraft-cli-{os}-{arch}[.exe]`
91
+ `{RELEASE_BASE}/v{version}/sensecraft-cli-{os}-{arch}[.exe]`
92
92
 
93
- 默认 `RELEASE_BASE`:
93
+ Default `RELEASE_BASE`:
94
94
 
95
95
  `https://sensecraft-statics.seeed.cc/static/bin/sensecraft-cli`
96
96
 
97
97
  ---
98
98
 
99
- ## 3. 首次登录
99
+ ## 3. First sign-in
100
100
 
101
- 用 SenseCAP 门户里的 OpenAPI Access Key 登录。Key ID 和 Access Key 写入本机后,设备、分组、传感数据,以及应用、模型、文件、云设备都用这一把钥匙。
101
+ Sign in with an OpenAPI Access Key. After the Key ID and Access Key are saved on this machine, SenseCraft Data (devices, groups, sensor data), SenseCraft AI (model library, reCamera, cloud devices), and CodeCraft Hub (applications) all use that one key. Create and manage keys at <https://account.seeed.cc/account/access-keys>.
102
102
 
103
103
  ```bash
104
104
  sensecraft-cli auth add --key-id <Key ID> --access-key <Access Key> --site Global
105
105
  sensecraft-cli auth info
106
106
  ```
107
107
 
108
- `--site` 为 `Global` 或 `China`,省略时是 `Global`。无交互环境需要带上 `--key-id` 和 `--access-key`。`auth info` 不打印 Access Key。
108
+ `--site` is `Global` or `China`. The default is `Global`. A non-interactive environment must pass `--key-id` and `--access-key`. `auth info` does not print the Access Key.
109
+
110
+ The China site supports SenseCraft Data only. To use the CLI with SenseCraft AI and CodeCraft Hub, select the international site (Global).
111
+
112
+ ### Scripts and CI
113
+
114
+ A non-interactive environment must pass `--key-id` and `--access-key`. Point `SENSECRAFT_CONFIG_FILE` at a config file in the project so it does not land in `~/.config/sensecraft-cli/`:
115
+
116
+ ```bash
117
+ export SENSECRAFT_CONFIG_FILE="$PWD/.sensecraft/sensecraft.json"
118
+ sensecraft-cli auth add \
119
+ --key-id "$SENSECRAFT_KEY_ID" \
120
+ --access-key "$SENSECRAFT_ACCESS_KEY" \
121
+ --site Global
122
+ sensecraft-cli device list
123
+ ```
124
+
125
+ This file contains the Access Key. Do not commit it. On success, a business command prints indented JSON on stdout. `auth info` prints plain text. On failure, the message is on stderr and the exit code is non-zero.
109
126
 
110
127
  ---
111
128
 
112
- ## 4. 配置文件位置
129
+ ## 4. Config file location
113
130
 
114
- | 场景 | 路径 |
115
- |------|------|
116
- | **npm / npx 安装(默认)** | macOS/Linux:`~/.config/sensecraft-cli/sensecraft.json`;Windows:`%APPDATA%\sensecraft-cli\sensecraft.json` |
117
- | **源码 `go build` 直接运行** | 当前工作目录下的 `sensecraft.json`(除非设置了环境变量) |
131
+ | Situation | Path |
132
+ |-----------|------|
133
+ | **npm / npx install (default)** | macOS/Linux: `~/.config/sensecraft-cli/sensecraft.json`; Windows: `%APPDATA%\sensecraft-cli\sensecraft.json` |
134
+ | **Running a `go build` binary** | `sensecraft.json` in the current working directory, unless an environment variable is set |
118
135
 
119
- 环境变量(优先级从高到低):
136
+ Environment variables, highest priority first:
120
137
 
121
- | 变量 | 含义 |
122
- |------|------|
123
- | `SENSECRAFT_CONFIG_FILE` | 配置文件完整路径 |
124
- | `SENSECRAFT_CLI_PATH` | 配置**目录**(文件名固定为 `sensecraft.json`) |
138
+ | Variable | Meaning |
139
+ |----------|---------|
140
+ | `SENSECRAFT_CONFIG_FILE` | Full path to the config file |
141
+ | `SENSECRAFT_CLI_PATH` | Config **directory** (the file name is always `sensecraft.json`) |
125
142
 
126
- npm 包装器会自动注入 `SENSECRAFT_CLI_PATH` 指向上述默认目录,因此 **npm 装的 CLI 与纯 `go build` 二进制默认读的不是同一个文件**。
143
+ The npm wrapper sets `SENSECRAFT_CLI_PATH` to the default directory above, so an npm-installed CLI and a plain `go build` binary do not read the same file by default.
127
144
 
128
- ### 迁移配置
145
+ ### Move a config file
129
146
 
130
147
  ```bash
131
- # 示例:把 cwd 下的配置迁到 npm 默认位置
148
+ # Example: move a config from the working directory to the npm default
132
149
  mkdir -p ~/.config/sensecraft-cli
133
150
  cp ./sensecraft.json ~/.config/sensecraft-cli/sensecraft.json
134
151
  ```
135
152
 
136
- Windows:
153
+ Windows:
137
154
 
138
155
  ```powershell
139
156
  New-Item -ItemType Directory -Force "$env:APPDATA\sensecraft-cli"
@@ -142,108 +159,106 @@ Copy-Item .\sensecraft.json "$env:APPDATA\sensecraft-cli\sensecraft.json"
142
159
 
143
160
  ---
144
161
 
145
- ## 5. 升级
162
+ ## 5. Upgrade
146
163
 
147
- 已通过 npm 安装时,直接运行:
164
+ When the CLI was installed with npm:
148
165
 
149
166
  ```bash
150
167
  sensecraft-cli update
151
168
  ```
152
169
 
153
- 命令会查询 npm 上的最新版本,并执行 `npm install -g @seeed-studio/sensecraft-cli@<版本>`。本地版本号已经相同也会重新安装。安装器接着比较 `vendor/.version` 与新包版本,不一致就重新下载二进制。配置目录里的 Access Key 会保留。`--version` 只打印本地版本号,不访问 npm。
170
+ The command looks up the latest version on npm and runs `npm install -g @seeed-studio/sensecraft-cli@<version>`. It reinstalls even when the local version number already matches. The installer then compares `vendor/.version` with the new package version and downloads the binary again when they differ. The Access Key in the config directory is kept. `--version` prints the local version only and does not contact npm.
154
171
 
155
- 其它用法:
172
+ Other forms:
156
173
 
157
174
  ```bash
158
- sensecraft-cli update --check # 只查询,不安装
175
+ sensecraft-cli update --check # query only, do not install
159
176
  npm install -g @seeed-studio/sensecraft-cli@latest
160
177
  ```
161
178
 
162
- 平时使用其它命令时,如果缓存里发现了更新,结束时会在 stderr 提示运行 `sensecraft-cli update`。同一版本 24 小时内只提示一次,出现更新的版本会再提示。24 小时内不会重复访问 npm。本地 `dev` 构建、CI、以及设置了 `SENSECRAFT_CLI_NO_UPDATE_NOTIFIER` 时不提示。
163
-
164
- 进行中的活动也在 stderr 以 `Notice:` 提醒,名称、日期和详情链接来自 `https://api-gateway.seeed.cc/openapi/activity/list`(不带参数,即尚未结束的活动)。24 小时内只提醒一次。交互终端会问 `Ignore this activity? [y/N]`,回答 `y` 之后按 `activity_id` 不再提醒;回答 `n` 时 24 小时后还会再出现。非交互只打印,不提问,也不记成忽略。CI 以及 `SENSECRAFT_CLI_NO_ACTIVITY_NOTIFIER` 时不提醒。
179
+ While you run other commands, a newer version is reported once on stderr, with a hint to run `sensecraft-cli update`. The same version is mentioned at most once every 24 hours.
165
180
 
166
- 当前程序如果不是 npm 安装的(例如直接运行编译出的二进制),`update` 只打印上面的手动安装命令,不会覆盖正在运行的文件。
181
+ If the program was not installed with npm (for example a binary you compiled yourself), `update` only prints the manual install command. It does not replace the file that is running.
167
182
 
168
- 验证:
183
+ Check:
169
184
 
170
185
  ```bash
171
186
  sensecraft-cli --version
172
- # 应与 npm 包版本一致
187
+ # should match the npm package version
173
188
  ```
174
189
 
175
190
  ---
176
191
 
177
- ## 6. 卸载
192
+ ## 6. Uninstall
178
193
 
179
194
  ```bash
180
195
  npm uninstall -g @seeed-studio/sensecraft-cli
181
196
  ```
182
197
 
183
- 可选清理:
198
+ Optional cleanup:
184
199
 
185
200
  ```bash
186
- # 配置(会删除本地 Token / Access Key,请先备份)
201
+ # Config (this deletes the local Access Key; back it up first)
187
202
  rm -rf ~/.config/sensecraft-cli # macOS / Linux
188
203
  # Windows: Remove-Item -Recurse "$env:APPDATA\sensecraft-cli"
189
204
 
190
- # npx 缓存(可选)
205
+ # npx cache (optional)
191
206
  npm cache clean --force
192
207
  ```
193
208
 
194
- 包目录下的 `vendor/` 二进制会随全局包卸载一起消失。
209
+ The `vendor/` binary inside the package directory goes away with the global package.
195
210
 
196
211
  ---
197
212
 
198
- ## 7. 离线 / 内网 / 自定义二进制源
213
+ ## 7. Offline, intranet, or a custom binary host
199
214
 
200
- ### 使用本地已编译的 `dist/`
215
+ ### Use a local `dist/` you already built
201
216
 
202
217
  ```bash
203
218
  ./script/build.sh
204
219
  export SENSECRAFT_CLI_LOCAL_DIST="$PWD/dist"
205
220
  npx @seeed-studio/sensecraft-cli install
206
- # 或在已 clone 的 packages/cli 下:
221
+ # or, from a cloned packages/cli:
207
222
  # SENSECRAFT_CLI_LOCAL_DIST=$PWD/../../dist npm run postinstall
208
223
  ```
209
224
 
210
- ### 覆盖下载基址
225
+ ### Override the download base URL
211
226
 
212
- 默认从 OSS 拉 `{base}/v{version}/{artifact}`。内网镜像时:
227
+ By default the installer fetches `{base}/v{version}/{artifact}` from OSS. For an internal mirror:
213
228
 
214
229
  ```bash
215
230
  export SENSECRAFT_CLI_RELEASE_BASE="https://your-mirror.example.com/sensecraft-cli"
216
231
  npx @seeed-studio/sensecraft-cli install
217
232
  ```
218
233
 
219
- 镜像目录结构须与发版一致,例如:
234
+ The mirror layout must match a release, for example:
220
235
 
221
236
  ```text
222
- …/sensecraft-cli/v0.1.3/sensecraft-cli-darwin-arm64
223
- …/sensecraft-cli/v0.1.3/sensecraft-cli-linux-amd64
237
+ …/sensecraft-cli/v<version>/sensecraft-cli-darwin-arm64
238
+ …/sensecraft-cli/v<version>/sensecraft-cli-linux-amd64
224
239
  …
225
240
  ```
226
241
 
227
- ### 跳过下载(仅复用已有 vendor)
242
+ ### Skip the download and reuse `vendor/`
228
243
 
229
244
  ```bash
230
245
  export SENSECRAFT_CLI_SKIP_DOWNLOAD=1
231
- # 若 vendor 中没有匹配当前版本的二进制,安装会失败
246
+ # Install fails when vendor has no binary for the current version
232
247
  ```
233
248
 
234
- ### 可选校验和
249
+ ### Optional checksum
235
250
 
236
- 若发版方提供了 SHA256,可设置:
251
+ If the publisher provides a SHA256:
237
252
 
238
253
  ```bash
239
254
  export SENSECRAFT_CLI_SHA256="<hex>"
240
255
  ```
241
256
 
242
- 与下载内容不一致时安装失败。
257
+ Install fails when the download does not match.
243
258
 
244
- ### 代理
259
+ ### Proxy
245
260
 
246
- 遵循 Node / 系统代理环境变量,例如:
261
+ The installer follows Node and system proxy variables, for example:
247
262
 
248
263
  ```bash
249
264
  export HTTPS_PROXY=http://proxy.example.com:8080
@@ -252,127 +267,75 @@ export HTTP_PROXY=http://proxy.example.com:8080
252
267
 
253
268
  ---
254
269
 
255
- ## 8. 从源码构建
270
+ ## 8. Build from source
256
271
 
257
272
  ```bash
258
- git clone <本仓库 URL>
273
+ git clone <this repository URL>
259
274
  cd sensecraft-cloud-terminal
260
275
 
261
- # 本机调试
276
+ # Local debug build
262
277
  go build -o sensecraft-cli .
263
278
  ./sensecraft-cli --version
264
279
 
265
- # 全平台发布产物 → dist/
280
+ # Release artifacts for every platform → dist/
266
281
  ./script/build.sh
267
282
  ```
268
283
 
269
- 本地用源码二进制时,配置默认落在**当前目录** `sensecraft.json`。若希望与 npm 安装共用配置:
284
+ A binary built from source stores config in `sensecraft.json` in the **current directory**. To share the npm install's config:
270
285
 
271
286
  ```bash
272
287
  export SENSECRAFT_CLI_PATH="$HOME/.config/sensecraft-cli"
273
288
  ./sensecraft-cli auth info
274
289
  ```
275
290
 
276
- 开发自检:
291
+ Checks for people contributing to this repo: `./script/smoke-ai.sh` and `./script/smoke-sensecap.sh`. The isolated install check needs `./script/build.sh` first, then:
277
292
 
278
293
  ```bash
279
- ./script/smoke-ai.sh
280
- ./script/smoke-sensecap.sh
281
294
  cd packages/cli && SENSECRAFT_CLI_LOCAL_DIST=$PWD/../../dist npm run test:install
282
295
  ```
283
296
 
284
- 发版流程见 [`README.md`](README.md)。
297
+ Projects that only use the CLI do not need these scripts.
285
298
 
286
299
  ---
287
300
 
288
- ## 9. Agent Skills(Cursor 等)
289
-
290
- Skills 是给 Agent 读的 Markdown 能力说明,**不是** CLI 子命令。
301
+ ## 9. Agent Skills (Cursor and others)
291
302
 
292
- ### 安装来源
303
+ Skills are Markdown capability notes for an agent. They are not CLI subcommands. There is one entry: `skills/sensecraft-cli/SKILL.md`. Product procedures are in `references/` next to it. Turning a local project into an app uses the nested skill `skills/sensecraft-cli/create-app/`.
293
304
 
294
- | 来源 | 路径 |
295
- |------|------|
296
- | 本仓库 | `skills/` |
297
- | npm 包安装后 | 全局包目录下的 `skills/`(与 `bin`、`scripts` 同级) |
298
-
299
- 查找全局包目录:
305
+ Skills ship inside the npm package. Symlink the agent skills directory at that copy. Do not copy the files. After `sensecraft-cli update` replaces the package, the link still reads the new docs.
300
306
 
301
307
  ```bash
302
- npm root -g
303
- # 例如 …/node_modules/@seeed-studio/sensecraft-cli/skills/sensecraft-ai/SKILL.md
308
+ npm install -g @seeed-studio/sensecraft-cli
309
+ SRC="$(npm root -g)/@seeed-studio/sensecraft-cli/skills/sensecraft-cli"
310
+ mkdir -p ~/.cursor/skills
311
+ ln -sfn "$SRC" ~/.cursor/skills/sensecraft-cli
304
312
  ```
305
313
 
306
- ### 推荐布局
307
-
308
- | Skill | 路径 | 鉴权 |
309
- |-------|------|------|
310
- | Meta 路由(优先加载) | `skills/sensecraft-ai/SKILL.md` | — |
311
- | SenseCAP PaaS | `skills/sensecraft-data/` | SenseCAP |
312
- | 应用广场 | `skills/sensecraft-apps/` | Access Key |
313
- | 文件上传 | `skills/sensecraft-files/` | Access Key |
314
- | 模型库 | `skills/sensecraft-models/` | Access Key |
315
- | 经典 reCamera 40 | `skills/sensecraft-recamera/` | Access Key |
316
- | 云设备 | `skills/sensecraft-devices-cloud/` | Access Key |
317
-
318
- 更细的发现说明:[`skills/README.md`](skills/README.md)。
319
-
320
- ### 接到 Cursor
321
-
322
- 任选其一:
323
-
324
- 1. **工作区即本仓库**
325
- 打开 `sensecraft-cloud-terminal` 作为 Cursor 项目,Agent 可直接读 `skills/`。
326
-
327
- 2. **拷贝 / 软链到 Cursor skills 目录**(路径以你本机 Cursor 版本为准,常见为用户目录下的 skills 配置):
328
-
329
- ```bash
330
- # 示例:软链 meta + 各域 skill(按需调整目标目录)
331
- ln -s "$PWD/skills/sensecraft-ai" ~/.cursor/skills/sensecraft-ai
332
- ln -s "$PWD/skills/sensecraft-apps" ~/.cursor/skills/sensecraft-apps
333
- # …
334
- ```
335
-
336
- 3. **只用 npm 包里的 skills**
337
- 把 `$(npm root -g)/@seeed-studio/sensecraft-cli/skills` 链到 Agent 可发现的路径。
338
-
339
- ### 接到 Claude Code / 其他 Agent
340
-
341
- 这些 skill 只依赖标准 `SKILL.md`(YAML `name`/`description` + Markdown 正文),不包含 Cursor 私有指令。支持 Agent Skills 的宿主可以直接复制或软链整个 skill 目录:
314
+ Claude Code, same directory link:
342
315
 
343
316
  ```bash
344
- # Claude Code:项目级
345
- mkdir -p .claude/skills
346
- for d in "$PWD"/skills/*; do
347
- ln -s "$d" ".claude/skills/$(basename "$d")"
348
- done
349
-
350
- # Claude Code:用户级(可选)
351
317
  mkdir -p ~/.claude/skills
352
- ln -s "$PWD/skills/sensecraft-ai" ~/.claude/skills/sensecraft-ai
318
+ ln -sfn "$SRC" ~/.claude/skills/sensecraft-cli
353
319
  ```
354
320
 
355
- 其他 Agent:
356
-
357
- 1. 若支持 `SKILL.md` 自动发现,把 `skills/*/` 原样放入其项目级或用户级 skills 目录;具体目录以宿主文档为准。
358
- 2. 若不支持 Skills,把 `skills/sensecraft-ai/SKILL.md` 和命中的领域 skill 作为系统/项目上下文加载。
359
- 3. Agent 必须具有本机命令执行能力,才能调用 `sensecraft-cli`;纯聊天宿主只能读取说明,不能声称命令已执行。
360
- 4. 写入 Access Key、本地 USB/IP 部署与烧录仍由用户自己完成。
321
+ Link the directory, not `SKILL.md` alone. `references/` and `assets/` are reached by relative paths, and splitting them breaks those paths. Run `ln` again after Node or the npm global directory changes. If Windows cannot create a symlink, copy the directory, and copy it again after every CLI upgrade.
361
322
 
362
- 使用约定:
323
+ Usage:
363
324
 
364
- - SenseCraft AI 相关问题先走 **`sensecraft-ai`** 路由 skill。
365
- - 确保机器上 `sensecraft-cli` 在 PATH 中,且已用 `auth add` 写入 Access Key。
325
+ - Read `sensecraft-cli` first. It opens the matching file under `references/`.
326
+ - `sensecraft-cli` must be on PATH, and an Access Key must already be saved with `auth add`.
327
+ - The agent must be able to run commands on this machine. A chat-only host can read the notes and cannot claim a command ran.
328
+ - Writing the Access Key, local USB or IP deploy, and flashing stay with the user.
366
329
 
367
330
  ---
368
331
 
369
- ## 10. 验证清单
332
+ ## 10. Checks
370
333
 
371
334
  ```bash
372
335
  sensecraft-cli --version
373
336
  sensecraft-cli auth info
374
337
 
375
- # 不消耗真实配额的冒烟(需已有对应 profile 或临时 config)
338
+ # Sandbox smoke that does not spend a real quota (needs a profile or a temporary config)
376
339
  sensecraft-cli model constants --sandbox
377
340
  sensecraft-cli app list --mine --sandbox
378
341
  sensecraft-cli device list --sandbox
@@ -382,56 +345,54 @@ sensecraft-cli data latest --eui SANDBOXEUI000001 --sandbox
382
345
 
383
346
  ---
384
347
 
385
- ## 11. 常见问题
348
+ ## 11. Common problems
386
349
 
387
350
  ### `sensecraft-cli: command not found`
388
351
 
389
- - 确认已执行 `npx @seeed-studio/sensecraft-cli install` 或 `npm install -g …`
390
- - 把 `$(npm prefix -g)/bin`(Windows 为 `npm prefix -g`)加入 PATH
391
- - 新开一个终端再试
352
+ - Confirm `npx @seeed-studio/sensecraft-cli install` or `npm install -g …` finished
353
+ - Add `$(npm prefix -g)/bin` to PATH (on Windows, `npm prefix -g`)
354
+ - Open a new terminal and try again
392
355
 
393
- ### 二进制下载失败
356
+ ### Binary download failed
394
357
 
395
- 安装器会提示可尝试:
358
+ The installer suggests:
396
359
 
397
- 1. 确认发版产物已上传到 `{RELEASE_BASE}/v{version}/`
398
- 2. `SENSECRAFT_CLI_LOCAL_DIST` 指向本地 `dist/`
399
- 3. `SENSECRAFT_CLI_RELEASE_BASE` 指向可用镜像
360
+ 1. Confirm the release artifacts are at `{RELEASE_BASE}/v{version}/`
361
+ 2. Point `SENSECRAFT_CLI_LOCAL_DIST` at a local `dist/`
362
+ 3. Point `SENSECRAFT_CLI_RELEASE_BASE` at a mirror that works
400
363
 
401
- 公司网络拦截 OSS 时,优先用本地 `dist/` 或内网镜像。
364
+ When a company network blocks OSS, use a local `dist/` or an internal mirror.
402
365
 
403
- ### `auth info` 显示还没有 Access Key
366
+ ### `auth info` says there is no Access Key yet
404
367
 
405
- - 用 `sensecraft-cli auth add --key-id <Key ID> --access-key <Access Key> --site Global` 写入。`--site China` 用于国内站。
406
- - 确认读写的是同一配置文件:`echo $SENSECRAFT_CLI_PATH` / `%SENSECRAFT_CLI_PATH%`。
407
- - 设备、应用、模型和云设备使用同一把 Access Key。
368
+ - Write one with `sensecraft-cli auth add --key-id <Key ID> --access-key <Access Key> --site Global`. Use `--site China` for the China site.
369
+ - Confirm both commands use the same config file: `echo $SENSECRAFT_CLI_PATH` / `%SENSECRAFT_CLI_PATH%`.
370
+ - SenseCraft Data, SenseCraft AI, and CodeCraft Hub share that Access Key.
408
371
 
409
- ### npm 装的和 `go build` 的配置不一致
372
+ ### The npm install and a `go build` binary see different configs
410
373
 
411
- 见上文「配置文件位置」:前者默认 `~/.config/…`,后者默认 cwd。用 `SENSECRAFT_CLI_PATH` 或 `SENSECRAFT_CONFIG_FILE` 统一。
374
+ See "Config file location" above. The first defaults to `~/.config/…`, the second to the working directory. Point both at one place with `SENSECRAFT_CLI_PATH` or `SENSECRAFT_CONFIG_FILE`.
412
375
 
413
- ### Windows 杀毒软件拦截
376
+ ### Windows antivirus quarantines the binary
414
377
 
415
- 首次下载的 `sensecraft-cli.exe` 可能被隔离。将安装目录或 `vendor` 加入白名单后重装。
378
+ The first download of `sensecraft-cli.exe` may be quarantined. Allow the install directory or `vendor`, then install again.
416
379
 
417
- ### 升级后版本号不变
380
+ ### The version number does not change after an upgrade
418
381
 
419
382
  ```bash
420
383
  npm uninstall -g @seeed-studio/sensecraft-cli
421
384
  npm cache clean --force
422
- npx @seeed-studio/sensecraft-cli@<目标版本> install
385
+ npx @seeed-studio/sensecraft-cli@<target version> install
423
386
  sensecraft-cli --version
424
387
  ```
425
388
 
426
389
  ---
427
390
 
428
- ## 12. 相关文档
391
+ ## 12. Related docs
429
392
 
430
- | 文档 | 内容 |
431
- |------|------|
432
- | [`README.md`](README.md) | English overview |
433
- | [`README.zh.md`](README.zh.md) | 中文说明 |
434
- | [`docs/sensecraft-cli-smoke.md`](docs/sensecraft-cli-smoke.md) | 发版冒烟清单 |
435
- | [`docs/sensecraft-cli-test-cases.md`](docs/sensecraft-cli-test-cases.md) | 全量功能测试用例 |
436
- | [`skills/README.md`](skills/README.md) | Skills 目录与 Agent 约定 |
393
+ | Doc | Contents |
394
+ |-----|----------|
395
+ | [`README.md`](README.md) | English install and config summary |
396
+ | [`README-zh.md`](README-zh.md) | Chinese command reference |
397
+ | [`skills/README.md`](skills/README.md) | Skills layout and agent conventions |
437
398
  | [`LICENSE`](LICENSE) | MIT |