@seeed-studio/sensecraft-cli 0.1.3 → 0.1.5
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/INSTALL.md +19 -13
- package/README.md +1 -0
- package/package.json +2 -2
- package/scripts/paths.js +3 -7
- package/scripts/paths.test.js +3 -3
- package/skills/README.md +2 -1
- package/skills/confirmation.md +4 -2
- package/skills/sensecraft-ai/SKILL.md +23 -21
- package/skills/sensecraft-apps/SKILL.md +7 -6
- package/skills/sensecraft-apps/commands.md +1 -0
- package/skills/sensecraft-apps/reference-tool-blocks.md +2 -2
- package/skills/sensecraft-data/SKILL.md +1 -2
- package/skills/sensecraft-data/commands.md +2 -2
- package/skills/sensecraft-devices-cloud/SKILL.md +4 -6
- package/skills/sensecraft-devices-cloud/commands.md +2 -3
- package/skills/sensecraft-files/SKILL.md +1 -1
- package/skills/sensecraft-files/commands.md +1 -1
- package/skills/sensecraft-models/SKILL.md +5 -5
- package/skills/sensecraft-models/commands.md +3 -0
- package/skills/sensecraft-recamera/SKILL.md +79 -0
- package/skills/sensecraft-recamera/commands.md +87 -0
package/INSTALL.md
CHANGED
|
@@ -111,13 +111,11 @@ AI 初始化时选择站点:
|
|
|
111
111
|
|------|------|
|
|
112
112
|
| Global | 国际生产 |
|
|
113
113
|
| China | 国内账号(AI API host 与 Global 相同) |
|
|
114
|
-
| Develop | 测试环境(`test-sensecraft.seeed.cc`) |
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
查看配置:
|
|
117
116
|
|
|
118
117
|
```bash
|
|
119
118
|
sensecraft-cli auth info
|
|
120
|
-
sensecraft-cli auth refresh # 仅 AI profile
|
|
121
119
|
```
|
|
122
120
|
|
|
123
121
|
无交互环境(CI)不会自动跑 `auth init`,需事先准备好配置文件或自行执行初始化。
|
|
@@ -159,23 +157,30 @@ Copy-Item .\sensecraft.json "$env:APPDATA\sensecraft-cli\sensecraft.json"
|
|
|
159
157
|
|
|
160
158
|
## 5. 升级
|
|
161
159
|
|
|
160
|
+
已通过 npm 安装时,直接运行:
|
|
161
|
+
|
|
162
162
|
```bash
|
|
163
|
-
|
|
163
|
+
sensecraft-cli update
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
命令会查询 npm 上的最新版本,并执行 `npm install -g @seeed-studio/sensecraft-cli@<版本>`。安装器接着比较 `vendor/.version` 与新包版本,不一致就重新下载二进制。配置目录里的 Access Key 会保留。
|
|
167
|
+
|
|
168
|
+
其它用法:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
sensecraft-cli update --check # 只查询,不安装
|
|
164
172
|
npm install -g @seeed-studio/sensecraft-cli@latest
|
|
165
|
-
# 或
|
|
166
|
-
npx @seeed-studio/sensecraft-cli@latest install
|
|
167
173
|
```
|
|
168
174
|
|
|
169
|
-
|
|
175
|
+
平时使用其它命令时,如果缓存里发现了更新,结束时会在 stderr 提示运行 `sensecraft-cli update`。24 小时内不会重复访问 npm。本地 `dev` 构建、CI、以及设置了 `SENSECRAFT_CLI_NO_UPDATE_NOTIFIER` 时不提示。
|
|
170
176
|
|
|
171
|
-
|
|
172
|
-
- **版本不同或缺少戳记** → 重新下载对应版本的二进制
|
|
177
|
+
当前程序如果不是 npm 安装的(例如直接运行编译出的二进制),`update` 只打印上面的手动安装命令,不会覆盖正在运行的文件。
|
|
173
178
|
|
|
174
179
|
验证:
|
|
175
180
|
|
|
176
181
|
```bash
|
|
177
182
|
sensecraft-cli --version
|
|
178
|
-
# 应与 npm
|
|
183
|
+
# 应与 npm 包版本一致
|
|
179
184
|
```
|
|
180
185
|
|
|
181
186
|
---
|
|
@@ -262,7 +267,7 @@ export HTTP_PROXY=http://proxy.example.com:8080
|
|
|
262
267
|
|
|
263
268
|
```bash
|
|
264
269
|
git clone <本仓库 URL>
|
|
265
|
-
cd sensecraft-
|
|
270
|
+
cd sensecraft-cloud-terminal
|
|
266
271
|
|
|
267
272
|
# 本机调试
|
|
268
273
|
go build -o sensecraft-cli .
|
|
@@ -287,7 +292,7 @@ export SENSECRAFT_CLI_PATH="$HOME/.config/sensecraft-cli"
|
|
|
287
292
|
cd packages/cli && SENSECRAFT_CLI_LOCAL_DIST=$PWD/../../dist npm run test:install
|
|
288
293
|
```
|
|
289
294
|
|
|
290
|
-
发版流程见 [`README.md`](README.md)
|
|
295
|
+
发版流程见 [`README.md`](README.md)。
|
|
291
296
|
|
|
292
297
|
---
|
|
293
298
|
|
|
@@ -318,6 +323,7 @@ npm root -g
|
|
|
318
323
|
| 应用广场 | `skills/sensecraft-apps/` | Access Key |
|
|
319
324
|
| 文件上传 | `skills/sensecraft-files/` | Access Key |
|
|
320
325
|
| 模型库 | `skills/sensecraft-models/` | Access Key |
|
|
326
|
+
| 经典 reCamera 40 | `skills/sensecraft-recamera/` | Access Key |
|
|
321
327
|
| 云设备 | `skills/sensecraft-devices-cloud/` | Access Key |
|
|
322
328
|
|
|
323
329
|
更细的发现说明:[`skills/README.md`](skills/README.md)。
|
|
@@ -327,7 +333,7 @@ npm root -g
|
|
|
327
333
|
任选其一:
|
|
328
334
|
|
|
329
335
|
1. **工作区即本仓库**
|
|
330
|
-
打开 `sensecraft-
|
|
336
|
+
打开 `sensecraft-cloud-terminal` 作为 Cursor 项目,Agent 可直接读 `skills/`。
|
|
331
337
|
|
|
332
338
|
2. **拷贝 / 软链到 Cursor skills 目录**(路径以你本机 Cursor 版本为准,常见为用户目录下的 skills 配置):
|
|
333
339
|
|
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ After install, Skill markdown lives under this package's `skills/` directory:
|
|
|
24
24
|
| Application Plaza | `skills/sensecraft-apps/` |
|
|
25
25
|
| File upload | `skills/sensecraft-files/` |
|
|
26
26
|
| Model library | `skills/sensecraft-models/` |
|
|
27
|
+
| Classic reCamera 40 | `skills/sensecraft-recamera/` |
|
|
27
28
|
| Cloud devices | `skills/sensecraft-devices-cloud/` |
|
|
28
29
|
|
|
29
30
|
```bash
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seeed-studio/sensecraft-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "SenseCAP / SenseCraft AI cloud CLI (devices, apps, models, files, cloud deploy)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://
|
|
8
|
+
"url": "https://github.com/Seeed-Solution/sensecraft-cloud-terminal.git",
|
|
9
9
|
"directory": "packages/cli"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
package/scripts/paths.js
CHANGED
|
@@ -43,18 +43,14 @@ function resolveConfigPath() {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* True when
|
|
47
|
-
*
|
|
48
|
-
* config (auth init --kind ai) was treated as uninitialized.
|
|
46
|
+
* True when a SenseCAP Access Key profile is present.
|
|
47
|
+
* That key is also used for SenseCraft AI /openapi.
|
|
49
48
|
*/
|
|
50
49
|
function isInitialized() {
|
|
51
50
|
const configPath = resolveConfigPath();
|
|
52
51
|
try {
|
|
53
52
|
const cfg = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
54
|
-
|
|
55
|
-
Array.isArray(cfg.app_config_list) && cfg.app_config_list.length > 0;
|
|
56
|
-
const hasAI = Array.isArray(cfg.ai_profiles) && cfg.ai_profiles.length > 0;
|
|
57
|
-
return hasSensecap || hasAI;
|
|
53
|
+
return Array.isArray(cfg.app_config_list) && cfg.app_config_list.length > 0;
|
|
58
54
|
} catch {
|
|
59
55
|
return false;
|
|
60
56
|
}
|
package/scripts/paths.test.js
CHANGED
|
@@ -54,7 +54,7 @@ function testResolveConfigPath() {
|
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
function
|
|
57
|
+
function testIsInitialized() {
|
|
58
58
|
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sc-init-'));
|
|
59
59
|
const cfg = path.join(tmp, 'sensecraft.json');
|
|
60
60
|
fs.writeFileSync(
|
|
@@ -65,7 +65,7 @@ function testIsInitializedAIOnly() {
|
|
|
65
65
|
})
|
|
66
66
|
);
|
|
67
67
|
withEnv({ SENSECRAFT_CONFIG_FILE: cfg, SENSECRAFT_CLI_PATH: undefined }, () => {
|
|
68
|
-
assert.equal(isInitialized(),
|
|
68
|
+
assert.equal(isInitialized(), false, 'token-only config is not initialized');
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
fs.writeFileSync(cfg, JSON.stringify({ app_config_list: [] }));
|
|
@@ -88,5 +88,5 @@ function testIsInitializedAIOnly() {
|
|
|
88
88
|
|
|
89
89
|
testReleaseURL();
|
|
90
90
|
testResolveConfigPath();
|
|
91
|
-
|
|
91
|
+
testIsInitialized();
|
|
92
92
|
console.log('OK: packages/cli/scripts/paths.test.js');
|
package/skills/README.md
CHANGED
|
@@ -11,6 +11,7 @@ Skills for this repo live under `skills/`.
|
|
|
11
11
|
| `skills/sensecraft-apps/` | Access Key | Application Plaza |
|
|
12
12
|
| `skills/sensecraft-files/` | Access Key | Upload file and obtain `file_url` |
|
|
13
13
|
| `skills/sensecraft-models/` | Access Key | Model library |
|
|
14
|
+
| `skills/sensecraft-recamera/` | `sensecap` Access Key | Classic reCamera 40 pick / check / open |
|
|
14
15
|
| `skills/sensecraft-devices-cloud/` | Access Key | Jetson / cloud kit deploy |
|
|
15
16
|
|
|
16
17
|
## Cursor / Agent setup
|
|
@@ -29,4 +30,4 @@ ls "$(npm root -g)/@seeed-studio/sensecraft-cli/skills"
|
|
|
29
30
|
|
|
30
31
|
## Version sync
|
|
31
32
|
|
|
32
|
-
When adding a CLI command: update the domain skill `SKILL.md` + `commands.md` in the **same change
|
|
33
|
+
When adding a CLI command: update the domain skill `SKILL.md` + `commands.md` in the **same change**.
|
package/skills/confirmation.md
CHANGED
|
@@ -15,7 +15,7 @@ These are **not** confirmation. Do **not** pass `--yes` on the same turn:
|
|
|
15
15
|
Ask in chat. **Do not run** the write command yet. The question MUST include at least:
|
|
16
16
|
|
|
17
17
|
1. **操作类型** — 删除 / 发布 / 私有化 / 部署 / 停止 / 克隆 / 修改 / 绑定 / …
|
|
18
|
-
2. **环境** — `auth info` 的 Global /
|
|
18
|
+
2. **环境** — `auth info` 的 Global / China(生产环境须点明)
|
|
19
19
|
3. **对象** — 名称 + ID(没有名称就先 `view` / `list` 再问)
|
|
20
20
|
|
|
21
21
|
Template:
|
|
@@ -33,9 +33,11 @@ Example (user said 「删除应用 demo」):
|
|
|
33
33
|
Example (user said 「删这个63760」):
|
|
34
34
|
|
|
35
35
|
```
|
|
36
|
-
将从
|
|
36
|
+
将从 China 环境删除模型 63760。删除后可能无法恢复。是否确认执行?
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
Classic reCamera flash is **not** an L2 `--yes` write. After the user picked the app/model (and firmware if several), `recamera open` may run. The user then clicks Deploy in Console (L3). Do not invent `recamera deploy`.
|
|
40
|
+
|
|
39
41
|
Wait for a **new** user reply: `确认` / `confirm` / `yes`. Only then:
|
|
40
42
|
|
|
41
43
|
```bash
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
name: sensecraft-ai
|
|
3
3
|
description: >-
|
|
4
4
|
Routes SenseCraft AI platform work for Agents: Application Plaza, model library,
|
|
5
|
-
model upload, and cloud deploy vs SenseCAP IoT CLI.
|
|
6
|
-
SenseCraft AI, 应用广场, App Square, 模型库, 上传模型,
|
|
7
|
-
which SenseCraft skill/CLI profile to use.
|
|
8
|
-
(apps/models/files) or sensecraft-data
|
|
5
|
+
model upload, classic reCamera deploy page, and cloud deploy vs SenseCAP IoT CLI.
|
|
6
|
+
Use when the user mentions SenseCraft AI, 应用广场, App Square, 模型库, 上传模型,
|
|
7
|
+
reCamera, aiserverapi, or asks which SenseCraft skill/CLI profile to use.
|
|
8
|
+
Does not replace domain skills (apps/models/files/recamera) or sensecraft-data.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# SenseCraft AI (Meta)
|
|
12
12
|
|
|
13
|
-
Router skill for **SenseCraft AI** capabilities exposed via CLI in this repo (`sensecraft-
|
|
13
|
+
Router skill for **SenseCraft AI** capabilities exposed via CLI in this repo (`sensecraft-cloud-terminal`). Domain skills and AI subcommands are rolled out in phases; this skill always applies for **intent routing, auth kind selection, and product-term disambiguation**.
|
|
14
14
|
|
|
15
15
|
Sibling (already shipped): [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md) — SenseCAP PaaS OpenAPI (`device` / `group` / `data`).
|
|
16
16
|
|
|
17
17
|
## Agent rules
|
|
18
18
|
|
|
19
19
|
1. **Pick the auth kind before any cloud call**
|
|
20
|
-
- `app` / `model` / `file` / `cloud` use SenseCAP **Access Key** → `{ai-host}/openapi` + HTTP Basic (no access_token, no `/aiserverapi`)
|
|
20
|
+
- `app` / `model` / `file` / `cloud` / `recamera` use SenseCAP **Access Key** → `{ai-host}/openapi` + HTTP Basic (no access_token, no `/aiserverapi`)
|
|
21
21
|
- Never send Access Key as a fake Bearer/JWT
|
|
22
22
|
2. **Always run auth check first** (ask user to fix if missing):
|
|
23
23
|
```bash
|
|
@@ -26,29 +26,30 @@ Sibling (already shipped): [`../sensecraft-data/SKILL.md`](../sensecraft-data/SK
|
|
|
26
26
|
Published commands require an active **SenseCAP Access Key** → `{ai-host}/openapi` + HTTP Basic.
|
|
27
27
|
3. **Never run `auth init` on behalf of the user** — browser OAuth Device Flow, interactive TTY only. Tell the user to run locally:
|
|
28
28
|
```bash
|
|
29
|
-
sensecraft-cli auth init --kind sensecap # Access Key (app/model/file/cloud)
|
|
29
|
+
sensecraft-cli auth init --kind sensecap # Access Key (app/model/file/cloud/recamera)
|
|
30
30
|
```
|
|
31
31
|
4. **L2 confirmation is a separate chat turn** — follow [`../confirmation.md`](../confirmation.md). 「删这个63760」/「删除应用 demo」is **intent, not confirmation**. Ask first (操作类型 + 环境 + 对象 ID), wait for `确认`/`confirm`, **then** `--yes`. Never add `--yes` on the same turn as the first request. Applies to: app/model create·update·publish·unpublish·delete·clone, upload attach, cloud deploy, device bind/unbind, group create/rename/delete/move.
|
|
32
32
|
5. **Treat tokens and keys as secrets** — do not echo full `access_token`, `refresh_token`, or `access_key`. **Public model artifacts are not downloadable** — if the user asks for 下载地址 / 下载链接 / download URL / 怎么下载, that is the same as asking for `file_url`: refuse the address, explain deploy-only (`cloud deploy` or Console). Never run `model download --url-only` on public models.
|
|
33
33
|
6. **Success = indented JSON on stdout**; failure = stderr + non-zero exit. Parse stdout only on success.
|
|
34
|
-
7. **Local USB /
|
|
34
|
+
7. **Local USB / IP flashing is L3** — do not pretend remote auto-flash. Classic reCamera (`40`): [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md) (`check` / `open` the AI deploy page). Other USB benches: Console `/ai/device/local/32|36|37|41|52`. Do **not** use `/ai/recamera` (it 301s to Grove `36`) or `/ai/device/local/40` (no such bench).
|
|
35
|
+
8. **Upgrading the CLI itself** is `sensecraft-cli update` (npm registry, then `npm install -g`). This is not `app update` or `model update`. Uninstall with `npm uninstall -g @seeed-studio/sensecraft-cli`. Do not delete `~/.config/sensecraft-cli` unless the user asked to clear the saved Access Key.
|
|
35
36
|
|
|
36
37
|
## Auth model (same OAuth client, different persistence)
|
|
37
38
|
|
|
38
39
|
| Kind | After Device Flow (`client_id=sensecraft-cli`) | Daily API auth |
|
|
39
40
|
|------|-----------------------------------------------|----------------|
|
|
40
|
-
| `sensecap` | Exchange for Access Key; store `key_id` + `access_key` | HTTP Basic → SenseCAP `/openapi` **and** AI `{ai-host}/openapi` (app/model/file/cloud) |
|
|
41
|
+
| `sensecap` | Exchange for Access Key; store `key_id` + `access_key` | HTTP Basic → SenseCAP `/openapi` **and** AI `{ai-host}/openapi` (app/model/file/cloud/recamera) |
|
|
41
42
|
|
|
42
43
|
### Site / `remote_type` (AI)
|
|
43
44
|
|
|
44
|
-
| `remote_type` | AI openapi |
|
|
45
|
-
|
|
45
|
+
| `remote_type` | AI openapi | Account center |
|
|
46
|
+
|---------------|------------|----------------|
|
|
46
47
|
| `Global` | `https://sensecraft.seeed.cc/openapi` | `account.seeed.cc/authapi` |
|
|
47
|
-
| `
|
|
48
|
+
| `China` | `https://sensecraft.seeed.cc/openapi` | `account.seeed.cn/authapi` |
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
China 与 Global 使用同一个 AI host,账号中心不同。
|
|
50
51
|
|
|
51
|
-
`auth info` shows
|
|
52
|
+
`auth info` shows the active Access Key (site, org, key id). Secrets are not printed.
|
|
52
53
|
|
|
53
54
|
## Intent → skill / command routing
|
|
54
55
|
|
|
@@ -61,22 +62,21 @@ Console 测试站 `test-sensecraft.seeed.cc` → CLI 必须用 **`remote_type: D
|
|
|
61
62
|
| Upload image/file/firmware/doc/archive and obtain `file_url` | [`sensecraft-files`](../sensecraft-files/SKILL.md) + `file upload` | `sensecap` | Types `1`–`2` require `--model-id`/`--app-id --yes`/`--for-app`/`--unlinked`; types `3`–`6` direct |
|
|
62
63
|
| Model library search/view/download/constants | [`sensecraft-models`](../sensecraft-models/SKILL.md) | `sensecap` | **CLI shipped** |
|
|
63
64
|
| Upload / publish / unpublish / delete model | same + `model upload --id --yes` / `create\|update\|publish\|unpublish\|delete` | `sensecap` | Attach bumps patch version like Console |
|
|
65
|
+
| Classic reCamera (`40`) pick / check / open deploy page | [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md) + `app/model list --uniform-type 40` + `recamera check` / `open` | `sensecap` | **CLI shipped**. Flash is Console L3 (IP/USB). Not `cloud deploy`. Not Pro `53`. |
|
|
64
66
|
| reCamera Pro model library | [`sensecraft-models`](../sensecraft-models/SKILL.md) + `model create --target recamera-pro` / `recamera-pro resolve` | `sensecap` | Deploy is local IP/USB L3 — not `cloud deploy` |
|
|
65
67
|
| Jetson / cloud kit list & deploy | [`sensecraft-devices-cloud`](../sensecraft-devices-cloud/SKILL.md) + `cloud …` | `sensecap` | **CLI shipped** (list/view/deploy/order); not SenseCAP `device` |
|
|
66
|
-
| Local USB/IP model deploy or firmware flash | Console
|
|
68
|
+
| Local USB/IP model deploy or firmware flash | [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md) then Console Deploy, or `/ai/device/local/32\|36\|37\|41\|52` | — | **L3 only**; CLI does not talk to the device |
|
|
67
69
|
|
|
68
70
|
## Cross-domain example
|
|
69
71
|
|
|
70
72
|
SenseCAP telemetry → pick public model → deploy to Jetson:
|
|
71
73
|
|
|
72
|
-
1. `sensecraft-cli auth info`
|
|
74
|
+
1. `sensecraft-cli auth info`
|
|
73
75
|
2. SenseCAP: `data latest --eui <sensecap-eui>` (Access Key)
|
|
74
76
|
3. AI: `model list --public --name "…"` → `model view --id …` (metadata only; **no** `model download`)
|
|
75
77
|
4. Confirm with user → `cloud deploy --eui <jetson-eui> --model-id … --yes` (device pulls firmware at apply time)
|
|
76
78
|
5. `cloud order --request-id …`
|
|
77
79
|
|
|
78
|
-
Do **not** mix AI token into SenseCAP / AI `/openapi` Access Key calls.
|
|
79
|
-
|
|
80
80
|
## Product-term disambiguation
|
|
81
81
|
|
|
82
82
|
| User says | Possible meanings | Default choice |
|
|
@@ -106,16 +106,17 @@ Published commands use **SenseCAP Access Key** (`kind=sensecap`) → `{ai-host}/
|
|
|
106
106
|
2. **Files** — `file upload` for image/model/app/firmware/doc/archive; types 1–2 require `--model-id` / `--app-id --yes` / `--for-app` / `--unlinked` before PUT (bare upload fails).
|
|
107
107
|
3. **Model library** — list/view/constants; **private** download only; public models deploy-only (no `file_url`); `model upload --id --yes` attaches and auto-bumps patch version; create/update; publish/unpublish/delete (L2).
|
|
108
108
|
4. **Cloud devices** — `cloud device` / `cloud deploy` / `cloud order`.
|
|
109
|
-
5. **
|
|
109
|
+
5. **Classic reCamera 40** — `recamera check` / `recamera open` (Console AI deploy page; flash is L3).
|
|
110
|
+
6. **Local USB** — Other benches: Console `/ai/device/local/32|36|37|41|52`.
|
|
110
111
|
|
|
111
112
|
## When something is missing
|
|
112
113
|
|
|
113
|
-
Published AI CLI is `app` / `model` / `file` / `cloud`. If a command fails:
|
|
114
|
+
Published AI CLI is `app` / `model` / `file` / `cloud` / `recamera`. If a command fails:
|
|
114
115
|
|
|
115
116
|
1. Run `sensecraft-cli auth info` — need an active SenseCAP Access Key.
|
|
116
117
|
2. Do **not** call SenseCAP `device`/`data` as a substitute.
|
|
117
118
|
3. Do **not** scrape Console cookies or invent HTTP with guessed tokens.
|
|
118
|
-
4. Prefer domain skills (`apps` / `files` / `models` / `devices-cloud`).
|
|
119
|
+
4. Prefer domain skills (`apps` / `files` / `models` / `recamera` / `devices-cloud`).
|
|
119
120
|
|
|
120
121
|
## Related files in this repo
|
|
121
122
|
|
|
@@ -125,5 +126,6 @@ Published AI CLI is `app` / `model` / `file` / `cloud`. If a command fails:
|
|
|
125
126
|
| [`../sensecraft-data/commands.md`](../sensecraft-data/commands.md) | Full SenseCAP command reference |
|
|
126
127
|
| `skills/sensecraft-apps/` | App Plaza skill + field/block refs (**shipped**) |
|
|
127
128
|
| `skills/sensecraft-models/` | Model library skill + field refs (**shipped**) |
|
|
129
|
+
| `skills/sensecraft-recamera/` | Classic reCamera 40 pick → check → open deploy page (**shipped**) |
|
|
128
130
|
| `skills/sensecraft-devices-cloud/` | Jetson / cloud kit (**shipped**) |
|
|
129
131
|
| `skills/README.md` | Skill discovery for Agents |
|
|
@@ -5,12 +5,12 @@ description: >-
|
|
|
5
5
|
view detail (docs, tool-blocks, BOM), clone to My Apps, create/edit/publish/
|
|
6
6
|
unpublish/delete apps. Use when the user mentions 应用广场, Application Store,
|
|
7
7
|
clone SenseCraft apps, app BOM, deploy tool-blocks, or SenseCraft app upload.
|
|
8
|
-
Requires Access Key (`auth init --kind sensecap`). Not for
|
|
8
|
+
Requires Access Key (`auth init --kind sensecap`). Not for SenseCAP devices.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# SenseCraft Apps (Application Plaza)
|
|
12
12
|
|
|
13
|
-
Domain skill for **SenseCraft AI applications**. Auth: **Access Key** → `{ai-host}/openapi` (HTTP Basic).
|
|
13
|
+
Domain skill for **SenseCraft AI applications**. Auth: **Access Key** → `{ai-host}/openapi` (HTTP Basic).
|
|
14
14
|
|
|
15
15
|
Parent router: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
|
|
16
16
|
SenseCAP IoT: [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md).
|
|
@@ -25,8 +25,8 @@ SenseCAP IoT: [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md).
|
|
|
25
25
|
2. **L2 confirm is a separate chat turn** ([`../confirmation.md`](../confirmation.md)) before: `clone` (also `--agree-disclaimer`), `publish` (`--agree-declaration`), `unpublish`, `delete`, **`app update` / `bom set`**. 「删除应用 demo」is **not** confirmation — ask `将从{环境}环境删除应用 demo(ID: …)。删除后可能无法恢复。是否确认执行?`, wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request.
|
|
26
26
|
**`app create` is not L2** — including `--from-json` with full fields (create + internal follow-up `update_app` on the **new** `app_id` only). Prefer one-shot create when the payload is ready. Still tell the user what will be created before running create.
|
|
27
27
|
3. **Privacy values**: submit review → `privacy` / flow uses **`2`** (pending); unpublish/private → **`0`**. **Never send `1`** (ops-approved public; Admin only).
|
|
28
|
-
4. **Clone
|
|
29
|
-
5. Tool-block **configuration** may be written into `deployment.blocks`. **Executing** flash / USB deploy / container install on hardware is **L3
|
|
28
|
+
4. **Clone stays in My Apps**. It does not install the app onto a device. Container install on hardware is L3 and is not `app clone`.
|
|
29
|
+
5. Tool-block **configuration** may be written into `deployment.blocks`. **Executing** flash / USB deploy / container install on hardware is **L3**. Classic reCamera (`40`): [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md) (`check` / `open`). Other benches: Console `/ai/device/local/32|36|37|41|52`. `flash-firmware` run is out of scope this pass.
|
|
30
30
|
6. Parse indented JSON on stdout; on failure read stderr + exit code. After `app update`, **re-read** the app — success body may be `{}`.
|
|
31
31
|
7. **Rename / edit info**: sparse `{"app_name":"…"}` is OK (CLI merges other info fields from sketch). Do not invent HTTP; do **not** put `be_public=1` in user JSON. For **already published** apps the CLI injects `be_public=1` (Console info save) and returns `sketch_saved` — plaza copy is unchanged until `app publish`.
|
|
32
32
|
8. **Lifecycle vs Console**: edit / publish / unpublish / delete / BOM / cover only for **your** apps (`user_id` == profile). Others' plaza apps: **clone** then edit the copy. `be_public=2` locks owner edit. `be_public=1` owner may save sketch then `app publish` (草稿). Delete only `be_public=0`.
|
|
@@ -54,6 +54,7 @@ When a command exists, prefer it. When it does not, explain the gap and use fiel
|
|
|
54
54
|
sensecraft-cli auth info
|
|
55
55
|
sensecraft-cli app list --public --name "<keyword>" --scene <id>
|
|
56
56
|
sensecraft-cli app list --public --uniform-type 40
|
|
57
|
+
sensecraft-cli app list --mine --uniform-type 40
|
|
57
58
|
sensecraft-cli app view --id <app_id>
|
|
58
59
|
```
|
|
59
60
|
|
|
@@ -68,7 +69,7 @@ sensecraft-cli app clone --id <app_id> --agree-disclaimer --yes
|
|
|
68
69
|
sensecraft-cli app clone --id <app_id> --name "Clone_MyName" --agree-disclaimer --yes
|
|
69
70
|
```
|
|
70
71
|
|
|
71
|
-
`app clone` matches Console 「克隆应用」: show https://sensecraft.seeed.cc/legal/en/disclaimer (使用免责声明) and only then pass `--agree-disclaimer --yes`. Missing either flag → non-zero. API body is still only `{app_id, app_name}` (agreement is client-side, like Console `disclaimerAccepted`). Clone
|
|
72
|
+
`app clone` matches Console 「克隆应用」: show https://sensecraft.seeed.cc/legal/en/disclaimer (使用免责声明) and only then pass `--agree-disclaimer --yes`. Missing either flag → non-zero. API body is still only `{app_id, app_name}` (agreement is client-side, like Console `disclaimerAccepted`). Clone copies the app into My Apps; it does not install it onto a device.
|
|
72
73
|
|
|
73
74
|
### Rename an existing app (L2)
|
|
74
75
|
|
|
@@ -162,7 +163,7 @@ Structure: `deployment.blocks` flat array.
|
|
|
162
163
|
| `flash-firmware` | Burn firmware to supported board | Config = L1/L2 write; **run flash = L3** |
|
|
163
164
|
| `deploy-ai-model` | Vision / audio AI model to device (task/device in config) | Config OK; **run deploy = L3** |
|
|
164
165
|
| `ai-vibration` | Vibration detection on XIAO-class device | Config OK; run = L3 |
|
|
165
|
-
| `deploy-container-app` | Edge container app
|
|
166
|
+
| `deploy-container-app` | Edge container app in the app doc | Config OK; **install on devices ≠ App Plaza clone** |
|
|
166
167
|
| `node-red` / `aily-blockly` | Flow / Blockly projects | Lower priority unless user asks |
|
|
167
168
|
|
|
168
169
|
Details: [reference-tool-blocks.md](reference-tool-blocks.md).
|
|
@@ -34,6 +34,7 @@ List apps.
|
|
|
34
34
|
# Application Plaza
|
|
35
35
|
sensecraft-cli app list --public --name "vision" --scene <scene_id> --page 1 --length 20
|
|
36
36
|
sensecraft-cli app list --public --uniform-type 40
|
|
37
|
+
sensecraft-cli app list --mine --uniform-type 40
|
|
37
38
|
|
|
38
39
|
# My Apps / marked apps
|
|
39
40
|
sensecraft-cli app list --mine
|
|
@@ -77,9 +77,9 @@ Multiple tool-blocks may appear in one step (e.g. paragraph → flash → paragr
|
|
|
77
77
|
|
|
78
78
|
### `deploy-container-app`
|
|
79
79
|
|
|
80
|
-
Used for **container / edge app** deployment UI inside the application doc
|
|
80
|
+
Used for **container / edge app** deployment UI inside the application doc.
|
|
81
81
|
|
|
82
|
-
**Agent:** configure the block for documentation
|
|
82
|
+
**Agent:** configure the block for documentation. Installing the container is **not** `app clone`. Prefer linking users to Console preview deploy when the CLI has no container control.
|
|
83
83
|
|
|
84
84
|
## Other tool-blocks
|
|
85
85
|
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
|
|
11
11
|
# SenseCraft Data (SenseCAP PaaS)
|
|
12
12
|
|
|
13
|
-
SenseCraft CLI wrappers for the [SenseCAP HTTP OpenAPI](https://sensecap-docs.seeed.cc/). Every `device`, `group`, and `data` command sends authenticated HTTP requests to the user's configured site (Global / China
|
|
13
|
+
SenseCraft CLI wrappers for the [SenseCAP HTTP OpenAPI](https://sensecap-docs.seeed.cc/). Every `device`, `group`, and `data` command sends authenticated HTTP requests to the user's configured site (Global / China). The CLI unwraps the API envelope (`code`, `msg`, `data`) and prints only the `data` payload as indented JSON on stdout.
|
|
14
14
|
|
|
15
15
|
Parent router: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
|
|
16
16
|
|
|
@@ -70,7 +70,6 @@ Resolved path priority: `SENSECRAFT_CONFIG_FILE` (absolute or relative to `SENSE
|
|
|
70
70
|
|------|------------------|
|
|
71
71
|
| Global (International) | `https://sensecap.seeed.cc/openapi` |
|
|
72
72
|
| China | `https://sensecap.seeed.cn/openapi` |
|
|
73
|
-
| Develop (test) | Selected during `auth init` / `auth add`; stored in config |
|
|
74
73
|
|
|
75
74
|
Authentication: HTTP Basic Auth with Key ID (username) and Access Key (password), obtained via `auth init` (OAuth Device Flow) or `auth add` (manual import).
|
|
76
75
|
|
|
@@ -18,7 +18,7 @@ Interactive setup wizard (OAuth Device Flow). Obtains an Access Key and writes `
|
|
|
18
18
|
|
|
19
19
|
### Wizard steps
|
|
20
20
|
|
|
21
|
-
1. Select site: Global (International)
|
|
21
|
+
1. Select site: Global (International) or China
|
|
22
22
|
2. Browser OAuth Device Flow authorization
|
|
23
23
|
3. Organization selection
|
|
24
24
|
4. Access Key creation
|
|
@@ -47,7 +47,7 @@ Site defaults to Global when omitted. In an interactive terminal, missing `--key
|
|
|
47
47
|
|------|----------|---------|-------------|
|
|
48
48
|
| `--key-id` | Yes* | — | Access Key ID (API ID) |
|
|
49
49
|
| `--access-key` | Yes* | — | Access Key secret |
|
|
50
|
-
| `--site` | No | `Global` | Site: `Global
|
|
50
|
+
| `--site` | No | `Global` | Site: `Global` or `China` |
|
|
51
51
|
|
|
52
52
|
\* Required unless running interactively (then prompted).
|
|
53
53
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sensecraft-devices-cloud
|
|
3
3
|
description: >-
|
|
4
|
-
Manages SenseCraft AI cloud devices (Jetson /
|
|
4
|
+
Manages SenseCraft AI cloud devices (Jetson / cloud kits via {ai-host}/openapi
|
|
5
5
|
list_node): list/view devices, deploy models with update_stream, poll order
|
|
6
6
|
records. Use when the user mentions Jetson 部署, 云端设备, cloud device,
|
|
7
7
|
Requires Access Key (`auth init --kind sensecap`). Not SenseCAP device CLI,
|
|
8
|
-
not
|
|
8
|
+
not local USB flash.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# SenseCraft Devices Cloud
|
|
@@ -18,8 +18,7 @@ Auth: **Access Key** (`auth init --kind sensecap`) → `{ai-host}/openapi`. Pare
|
|
|
18
18
|
2. **Never** use SenseCAP `device` commands here (`device list` = SenseCAP OpenAPI).
|
|
19
19
|
3. **L2 confirm is a separate chat turn** ([`../confirmation.md`](../confirmation.md)) before `cloud deploy --yes` (and device output / order writes). 「部署到这台设备」is **not** confirmation — ask (部署 + 环境 + EUI + model_id), wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request.
|
|
20
20
|
4. Local USB / Web Serial = **L3** → guide Console `/ai/device/local/...`.
|
|
21
|
-
5.
|
|
22
|
-
6. **reCamera Pro** (`uniform_type=53`) local IP/USB RC2/ALPKG deploy is **not** `cloud deploy` / `update_stream` — guide users to Console device workspace (L3).
|
|
21
|
+
5. **reCamera Pro** (`uniform_type=53`) local IP/USB RC2/ALPKG deploy is **not** `cloud deploy` / `update_stream` — guide users to Console device workspace (L3).
|
|
23
22
|
|
|
24
23
|
## CLI status
|
|
25
24
|
|
|
@@ -39,7 +38,7 @@ sensecraft-cli cloud deploy --eui <EUI> --model-id <id> --from-json ./stream.jso
|
|
|
39
38
|
sensecraft-cli cloud order --request-id <request_id> --device-uuid <uuid>
|
|
40
39
|
```
|
|
41
40
|
|
|
42
|
-
`uniform_type` 26 is common for Jetson
|
|
41
|
+
`uniform_type` 26 is common for the Jetson cloud device UI; model deploy pages may pass other types / `adapteds`.
|
|
43
42
|
|
|
44
43
|
Full flag reference and copyable examples: [commands.md](commands.md).
|
|
45
44
|
|
|
@@ -49,5 +48,4 @@ Full flag reference and copyable examples: [commands.md](commands.md).
|
|
|
49
48
|
|------|-----|
|
|
50
49
|
| SenseCAP node/gateway telemetry | `sensecraft-cli device …` (Access Key) |
|
|
51
50
|
| Jetson / AI cloud kit | `cloud device …` (this skill) |
|
|
52
|
-
| Fleet multi-host Docker apps | `fleet …` + [`sensecraft-fleet`](../sensecraft-fleet/SKILL.md) |
|
|
53
51
|
| USB flash | Console local device (L3) |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# sensecraft-devices-cloud — CLI commands
|
|
2
2
|
|
|
3
|
-
Binary: `sensecraft-cli`. Auth:
|
|
3
|
+
Binary: `sensecraft-cli`. Auth: Access Key (`auth init --kind sensecap`).
|
|
4
4
|
|
|
5
5
|
## `cloud device list`
|
|
6
6
|
|
|
7
7
|
| Flag | Default | Notes |
|
|
8
8
|
|------|---------|-------|
|
|
9
|
-
| `--uniform-type` | `26` | Device type; Jetson
|
|
9
|
+
| `--uniform-type` | `26` | Device type; Jetson cloud UI commonly uses `26` |
|
|
10
10
|
| `--adapteds` | — | Optional adapted-device/model filter |
|
|
11
11
|
| `--name` | — | Filter by `device_name` |
|
|
12
12
|
| `--page` / `--length` | `1` / `20` | Pagination |
|
|
@@ -54,5 +54,4 @@ This command only polls deployment status and is not L2.
|
|
|
54
54
|
|
|
55
55
|
- `cloud device …`: SenseCraft AI Jetson / cloud kit.
|
|
56
56
|
- `device …`: SenseCAP node/gateway OpenAPI.
|
|
57
|
-
- `fleet …`: Seeed Fleet Docker apps.
|
|
58
57
|
- Local USB / Web Serial flashing: Console L3, not this CLI.
|
|
@@ -30,7 +30,7 @@ Auth: **Access Key** → `{ai-host}/openapi`. Parent: [`../sensecraft-ai/SKILL.m
|
|
|
30
30
|
6. Upload alone is not L2; attaching to a model/app (`--id` / `--model-id` / `--app-id`) **is L2**. Follow [`../confirmation.md`](../confirmation.md): ask first, wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request. `--unlinked` is an explicit orphan opt-in (not L2).
|
|
31
31
|
7. Do not pass oversized files or more than 16 app image URLs; CLI rejects them before upload/update.
|
|
32
32
|
8. Types `3`–`6` have no model/app attach path and upload directly (no `--unlinked` needed).
|
|
33
|
-
9. **Security gates**: empty (0 B) files rejected; type 2–6
|
|
33
|
+
9. **Security gates**: empty (0 B) files rejected; type 2–6 ≤ **100 MB**; images 2 MB (model) / 5 MB (app). Upload frequency is enforced by the server, not this CLI.
|
|
34
34
|
|
|
35
35
|
## Examples
|
|
36
36
|
|
|
@@ -14,7 +14,7 @@ Domain skill for **SenseCraft AI models**. Auth: **Access Key** → `{ai-host}/o
|
|
|
14
14
|
|
|
15
15
|
Parent: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
|
|
16
16
|
Apps: [`../sensecraft-apps/SKILL.md`](../sensecraft-apps/SKILL.md).
|
|
17
|
-
|
|
17
|
+
Library `model download` is the published model file, not a training-job export.
|
|
18
18
|
|
|
19
19
|
## Agent rules
|
|
20
20
|
|
|
@@ -38,10 +38,10 @@ Training artifacts (train job model download): [`sensecraft-train`](../sensecraf
|
|
|
38
38
|
- **Do not clone** — the platform has no model clone (unlike `app clone`). Do not copy `model view` JSON into `model create` (including `id` / `model_id` / `from_id` / `file_url` / checksum). CLI `model create` refuses public-library sources. Tell the user to **deploy** instead.
|
|
39
39
|
- **Do not download.** Phrases like 下载地址 / 下载链接 / `file_url` / download URL / 怎么下载 / 给我链接 are the **same leak** as `model download --url-only`. Do **not** run `model download` (`--apply` / `--url-only` included).
|
|
40
40
|
- Do **not** print, quote, or reconstruct `file_url`, `apply_model` URLs, CDN/OSS paths, or signed query strings — even if they appear in a tool error, browser, or prior message.
|
|
41
|
-
- Answer the **method**, not an address: browse metadata, then deploy so the device pulls firmware at apply time (`cloud deploy` or
|
|
41
|
+
- Answer the **method**, not an address: browse metadata, then deploy so the device pulls firmware at apply time (`cloud deploy` for Jetson/`26`, or classic reCamera `40` via [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md)).
|
|
42
42
|
- Owner file download is only for **private** My Models (`be_public=0`). Even then, do not paste signed URLs into chat unless the user explicitly needs `--url-only` for a local script; prefer `--out` file path. Treat remaining `file_url`, checksums, and tokens as secrets.
|
|
43
43
|
6. Success = indented JSON stdout; failure = stderr + non-zero exit.
|
|
44
|
-
7. reCamera
|
|
44
|
+
7. Classic reCamera (`uniform_type=40`): list with `--uniform-type 40`, then [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md) `check` / `open`. **Do not** `cloud deploy`. **Do not** download public models. reCamera Pro (`53`) is a different device — use `model recamera-pro resolve`, then Console local L3 (not this 40 flow).
|
|
45
45
|
|
|
46
46
|
## CLI status
|
|
47
47
|
|
|
@@ -70,11 +70,11 @@ Report: name, description, **task/category**, **supported devices** (`uniform_ty
|
|
|
70
70
|
|
|
71
71
|
If they ask to **clone** a public model into My Models, refuse. There is no `model clone`. Do not `model create` from that model's view JSON. Reply that others' public models cannot be cloned; deploy instead:
|
|
72
72
|
|
|
73
|
-
>
|
|
73
|
+
> 他人公开模型不支持克隆。Jetson/云套件用 `cloud deploy`;经典 reCamera(40)用 `recamera check` / `recamera open` 后在 Console 点部署;Pro(53)走 Console 本地工作区。
|
|
74
74
|
|
|
75
75
|
If they ask for a **download address / link / URL / 怎么下载** on a public model, do **not** fetch a URL. Reply that public models have no download link; the way to get the artifact is to **deploy** (device pulls firmware). Example:
|
|
76
76
|
|
|
77
|
-
>
|
|
77
|
+
> 公开模型不提供下载地址。Jetson/云套件用 `cloud deploy`;经典 reCamera(40)用 `recamera open` 后在 Console 点部署。设备会在 apply 时拉取固件。
|
|
78
78
|
|
|
79
79
|
### Download (private / My Models only)
|
|
80
80
|
|
|
@@ -33,11 +33,14 @@ sensecraft-cli auth init --kind sensecap
|
|
|
33
33
|
# Public library (default when neither --public nor --mine is set)
|
|
34
34
|
sensecraft-cli model list --public --task 1 --name "vision" --page 1 --length 20
|
|
35
35
|
sensecraft-cli model list --public --uniform-type 40
|
|
36
|
+
sensecraft-cli model list --mine --uniform-type 40
|
|
36
37
|
|
|
37
38
|
# My Models
|
|
38
39
|
sensecraft-cli model list --mine --name "custom"
|
|
39
40
|
```
|
|
40
41
|
|
|
42
|
+
Classic reCamera (`40`) pick-and-open: [`../sensecraft-recamera/commands.md`](../sensecraft-recamera/commands.md). Do not `cloud deploy` those models.
|
|
43
|
+
|
|
41
44
|
### `model view --id <id>`
|
|
42
45
|
|
|
43
46
|
**Status: implemented.** Return name, description, task, format, labels/classes, uniform_types, version, size, be_public, etc.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sensecraft-recamera
|
|
3
|
+
description: >-
|
|
4
|
+
Picks classic reCamera (uniform_type 40) public or My Apps / My Models, checks
|
|
5
|
+
compatibility, then opens the Console AI deploy page so the user flashes over
|
|
6
|
+
IP or USB. Use when the user mentions reCamera, 烧录, 刷机, 部署到 recamera,
|
|
7
|
+
uniform_type 40, or picking a model/app for reCamera. Not reCamera Pro (53),
|
|
8
|
+
not Jetson cloud deploy, not CodeCraft App Square.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# SenseCraft reCamera (classic, uniform_type 40)
|
|
12
|
+
|
|
13
|
+
Orchestration skill: **list → pick → check → open Console → user clicks Deploy**.
|
|
14
|
+
|
|
15
|
+
Parent: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
|
|
16
|
+
List/view/clone: [`../sensecraft-apps/SKILL.md`](../sensecraft-apps/SKILL.md), [`../sensecraft-models/SKILL.md`](../sensecraft-models/SKILL.md).
|
|
17
|
+
Commands: [`commands.md`](commands.md).
|
|
18
|
+
|
|
19
|
+
**This skill does not flash.** Flash is L3 in the browser (IP or USB). There is no `recamera deploy` and no device HTTP in this CLI.
|
|
20
|
+
|
|
21
|
+
## Agent rules
|
|
22
|
+
|
|
23
|
+
1. Auth first:
|
|
24
|
+
```bash
|
|
25
|
+
sensecraft-cli auth info
|
|
26
|
+
```
|
|
27
|
+
Need **SenseCAP Access Key** (`auth init --kind sensecap`) for `app` / `model` / `recamera`. Never run init for them.
|
|
28
|
+
2. **Classic reCamera only (`40`)**. Do **not** treat Pro `53`, XIAO `32`, or Grove `36` as the same device. `/ai/recamera` redirects to Grove `36` — do not send users there.
|
|
29
|
+
3. Filter **only** with API `--uniform-type 40`. Do not guess from local materials, SKU strings, or adapteds-only. Public **and** mine:
|
|
30
|
+
```bash
|
|
31
|
+
sensecraft-cli app list --public --uniform-type 40
|
|
32
|
+
sensecraft-cli app list --mine --uniform-type 40
|
|
33
|
+
sensecraft-cli model list --public --uniform-type 40
|
|
34
|
+
sensecraft-cli model list --mine --uniform-type 40
|
|
35
|
+
```
|
|
36
|
+
4. **Empty list: say so and stop.** Do not drop `--uniform-type` or widen to 53/32.
|
|
37
|
+
5. After the user picks an app or model, `recamera check`. If `ok` is false, say it is not classic reCamera and stop.
|
|
38
|
+
6. **Multiple firmwares / models** (`ask_pick: true` or several candidates): **ask again** which one to flash. Do not pick for them.
|
|
39
|
+
7. Both allowed:
|
|
40
|
+
- Flash the model already on the app `deploy-ai-model` block
|
|
41
|
+
- Flash a **separately picked** model from the 40 list
|
|
42
|
+
8. **Public models are deploy-only.** Never `model download`, never print `file_url`, never clone a public model into My Models. Private My Models may be used as-is. **Apps may be cloned** (`app clone`, L2) if the user wants their own copy — clone is optional, not required to flash.
|
|
43
|
+
9. **Do not `cloud deploy`.** That path is Jetson / cloud kit (`26`), not reCamera.
|
|
44
|
+
10. **`flash-firmware` blocks are out of scope** this pass. Do not invent a firmware-flash CLI.
|
|
45
|
+
11. After a successful check, if the user wants to flash, run `recamera open` (or `--print-only` if they will paste the URL). Success = they say the Console page worked and they clicked Deploy. Opening a page is **not** an L2 `--yes` write.
|
|
46
|
+
12. If there is **no device / no IP**: still open the Console deploy page and stop. Do not invent a device protocol. Do not require an IP to confirm.
|
|
47
|
+
13. Retry list/check/open at most **5 times per run**. Then stop and report the last error.
|
|
48
|
+
14. CodeCraft App Square is unrelated — do not route plaza-upload work here.
|
|
49
|
+
|
|
50
|
+
## Typical workflow
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
sensecraft-cli auth info
|
|
54
|
+
sensecraft-cli model list --public --uniform-type 40
|
|
55
|
+
sensecraft-cli app list --public --uniform-type 40
|
|
56
|
+
# optional: mine
|
|
57
|
+
sensecraft-cli model list --mine --uniform-type 40
|
|
58
|
+
sensecraft-cli app list --mine --uniform-type 40
|
|
59
|
+
|
|
60
|
+
sensecraft-cli recamera check --model-id <id>
|
|
61
|
+
# or
|
|
62
|
+
sensecraft-cli recamera check --app-id <id>
|
|
63
|
+
|
|
64
|
+
# After the user chose the item (and, if ask_pick, which firmware):
|
|
65
|
+
sensecraft-cli recamera open --model-id <id>
|
|
66
|
+
# or --print-only if a browser cannot be opened
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Then tell the user: on the opened **model/app detail** page, click **Deploy**, connect classic reCamera over **IP or USB**, and finish in Console. Do not download the public weights.
|
|
70
|
+
|
|
71
|
+
## CLI status
|
|
72
|
+
|
|
73
|
+
| Area | Status |
|
|
74
|
+
|------|--------|
|
|
75
|
+
| `app/model list --uniform-type 40` | **Implemented** |
|
|
76
|
+
| `recamera check` / `recamera open` | **Implemented** (P2) |
|
|
77
|
+
| `app clone` | Use apps skill (L2) |
|
|
78
|
+
| Device flash / `recamera deploy` | **Not implemented** (L3 Console) |
|
|
79
|
+
| `model recamera-pro resolve` | Pro `53` only — not this skill |
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# sensecraft-recamera — CLI commands
|
|
2
|
+
|
|
3
|
+
Target binary: `sensecraft-cli` (this repo). Auth: active **SenseCAP Access Key** (`auth init --kind sensecap`) → `{ai-host}/openapi`.
|
|
4
|
+
|
|
5
|
+
> Status: **shipped (P1 list + P2 check/open)**. Flash stays in Console. There is no `recamera deploy`.
|
|
6
|
+
|
|
7
|
+
## Auth prerequisite
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
sensecraft-cli auth info
|
|
11
|
+
sensecraft-cli auth init --kind sensecap # user only, interactive
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## List (existing commands)
|
|
15
|
+
|
|
16
|
+
Always pass `--uniform-type 40`. Empty list → stop.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
sensecraft-cli app list --public --uniform-type 40
|
|
20
|
+
sensecraft-cli app list --mine --uniform-type 40
|
|
21
|
+
sensecraft-cli model list --public --uniform-type 40
|
|
22
|
+
sensecraft-cli model list --mine --uniform-type 40
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## `recamera check`
|
|
26
|
+
|
|
27
|
+
**Status: implemented.**
|
|
28
|
+
|
|
29
|
+
Verify the id is classic reCamera (`40`). Does not open a browser.
|
|
30
|
+
|
|
31
|
+
| Flag | Required | Notes |
|
|
32
|
+
| ------------ | -------- | ------------------------------------------ |
|
|
33
|
+
| `--model-id` | one of | Model id |
|
|
34
|
+
| `--app-id` | one of | App id |
|
|
35
|
+
| `--sandbox` | no | Sample JSON, no network |
|
|
36
|
+
|
|
37
|
+
Exactly one of `--model-id` / `--app-id`.
|
|
38
|
+
|
|
39
|
+
Stdout JSON includes `ok`, `device` (40), `flash` (`local`), `console_url`, `candidates`, `ask_pick`.
|
|
40
|
+
`ok=false` → non-zero exit. Do not loosen the filter.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
sensecraft-cli recamera check --model-id <model_id>
|
|
44
|
+
sensecraft-cli recamera check --app-id <app_id>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If `ask_pick` is true, ask the user which candidate to flash.
|
|
48
|
+
|
|
49
|
+
## `recamera open`
|
|
50
|
+
|
|
51
|
+
**Status: implemented.**
|
|
52
|
+
|
|
53
|
+
Runs the same check, then opens `console_url` (or prints it). Sandbox never opens a browser.
|
|
54
|
+
|
|
55
|
+
| Flag | Required | Notes |
|
|
56
|
+
| ------------- | -------- | --------------------------------------------- |
|
|
57
|
+
| `--model-id` | one of | Model detail = AI deploy page (click 部署) |
|
|
58
|
+
| `--app-id` | one of | App detail; plaza omits `from=my-apps` |
|
|
59
|
+
| `--print-only`| no | Print URL only |
|
|
60
|
+
| `--sandbox` | no | Sample JSON; never open a browser |
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
sensecraft-cli recamera open --model-id <model_id>
|
|
64
|
+
sensecraft-cli recamera open --app-id <app_id> --print-only
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`console_url` is `/ai/model/detail?id=…` or `/ai/application/detail/…`.
|
|
68
|
+
**Not** `/ai/device/local/40` (that family is 32/36/37/41/52). **Not** `/ai/recamera` (301 → Grove 36).
|
|
69
|
+
|
|
70
|
+
## Out of scope
|
|
71
|
+
|
|
72
|
+
| Action | What to do instead |
|
|
73
|
+
|--------|--------------------|
|
|
74
|
+
| `cloud deploy` | Jetson / cloud kit only |
|
|
75
|
+
| Public model download / clone | Refuse; deploy-only |
|
|
76
|
+
| `recamera deploy` / device HTTP | Do not invent; user flashes in Console |
|
|
77
|
+
| `flash-firmware` block | Later |
|
|
78
|
+
| reCamera Pro `53` | `sensecraft-models` + `model recamera-pro resolve` |
|
|
79
|
+
| CodeCraft App Square | Unrelated |
|
|
80
|
+
|
|
81
|
+
## Optional: clone an app first (L2)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
sensecraft-cli app clone --id <app_id> --agree-disclaimer --yes
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Follow [`../confirmation.md`](../confirmation.md). Clone is not required to open the plaza app and click Deploy.
|