@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.
- package/INSTALL.md +151 -190
- package/README-zh.md +463 -0
- package/README.md +9 -13
- package/package.json +2 -1
- package/scripts/test-install.js +1 -1
- package/skills/README.md +14 -35
- package/skills/sensecraft-cli/SKILL.md +131 -0
- package/skills/{sensecraft-apps → sensecraft-cli}/create-app/SKILL.md +26 -17
- package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/manifest-template.json +1 -1
- package/skills/{sensecraft-apps/create-app/reference-manifest.md → sensecraft-cli/create-app/references/manifest.md} +17 -14
- package/skills/{sensecraft-apps/commands.md → sensecraft-cli/references/app-commands.md} +38 -16
- package/skills/{sensecraft-apps/reference-app-fields.md → sensecraft-cli/references/app-fields.md} +4 -3
- package/skills/{sensecraft-apps/SKILL.md → sensecraft-cli/references/apps.md} +35 -37
- package/skills/{sensecraft-devices-cloud/commands.md → sensecraft-cli/references/cloud-commands.md} +1 -1
- package/skills/{sensecraft-devices-cloud/SKILL.md → sensecraft-cli/references/cloud.md} +4 -14
- package/skills/{confirmation.md → sensecraft-cli/references/confirmation.md} +2 -2
- package/skills/{sensecraft-data/commands.md → sensecraft-cli/references/data-commands.md} +2 -2
- package/skills/{sensecraft-data/SKILL.md → sensecraft-cli/references/data.md} +10 -18
- package/skills/{sensecraft-files/commands.md → sensecraft-cli/references/file-commands.md} +1 -1
- package/skills/{sensecraft-files/SKILL.md → sensecraft-cli/references/files.md} +3 -11
- package/skills/{sensecraft-models/commands.md → sensecraft-cli/references/model-commands.md} +5 -5
- package/skills/{sensecraft-models/SKILL.md → sensecraft-cli/references/models.md} +17 -27
- package/skills/{sensecraft-recamera/commands.md → sensecraft-cli/references/recamera-commands.md} +4 -4
- package/skills/{sensecraft-recamera/SKILL.md → sensecraft-cli/references/recamera.md} +6 -16
- package/skills/{sensecraft-apps/reference-tool-blocks.md → sensecraft-cli/references/tool-blocks.md} +20 -4
- package/skills/sensecraft-ai/SKILL.md +0 -134
- /package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/validate_manifest.py +0 -0
- /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
|
-
|
|
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
|
|
10
|
-
|
|
|
11
|
-
|
|
|
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
|
-
|
|
22
|
+
Any other combination fails install with `Unsupported platform`.
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
## 2.
|
|
26
|
+
## 2. Recommended install (npm / npx)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
This path fits most people. The installer:
|
|
29
29
|
|
|
30
|
-
1.
|
|
31
|
-
2.
|
|
32
|
-
3.
|
|
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
|
-
#
|
|
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
|
-
|
|
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
|
|
54
|
-
# Linux: ~/.npm-global/bin
|
|
55
|
-
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc #
|
|
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
|
|
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
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
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`
|
|
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
|
|
85
|
-
#
|
|
86
|
-
npm install -g @seeed-studio/sensecraft-cli
|
|
84
|
+
npx @seeed-studio/sensecraft-cli@<version> install
|
|
85
|
+
# or
|
|
86
|
+
npm install -g @seeed-studio/sensecraft-cli@<version>
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
Binary URLs look like:
|
|
90
90
|
|
|
91
|
-
`{RELEASE_BASE}/v{
|
|
91
|
+
`{RELEASE_BASE}/v{version}/sensecraft-cli-{os}-{arch}[.exe]`
|
|
92
92
|
|
|
93
|
-
|
|
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
|
-
|
|
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`
|
|
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
|
|
117
|
-
|
|
|
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` |
|
|
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
|
|
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
|
-
#
|
|
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
|
-
|
|
164
|
+
When the CLI was installed with npm:
|
|
148
165
|
|
|
149
166
|
```bash
|
|
150
167
|
sensecraft-cli update
|
|
151
168
|
```
|
|
152
169
|
|
|
153
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
|
|
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
|
-
###
|
|
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
|
-
#
|
|
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
|
-
|
|
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/
|
|
223
|
-
…/sensecraft-cli/
|
|
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
|
-
###
|
|
242
|
+
### Skip the download and reuse `vendor/`
|
|
228
243
|
|
|
229
244
|
```bash
|
|
230
245
|
export SENSECRAFT_CLI_SKIP_DOWNLOAD=1
|
|
231
|
-
#
|
|
246
|
+
# Install fails when vendor has no binary for the current version
|
|
232
247
|
```
|
|
233
248
|
|
|
234
|
-
###
|
|
249
|
+
### Optional checksum
|
|
235
250
|
|
|
236
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
#
|
|
280
|
+
# Release artifacts for every platform → dist/
|
|
266
281
|
./script/build.sh
|
|
267
282
|
```
|
|
268
283
|
|
|
269
|
-
|
|
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
|
-
|
|
297
|
+
Projects that only use the CLI do not need these scripts.
|
|
285
298
|
|
|
286
299
|
---
|
|
287
300
|
|
|
288
|
-
## 9. Agent Skills
|
|
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
|
|
303
|
-
|
|
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 -
|
|
318
|
+
ln -sfn "$SRC" ~/.claude/skills/sensecraft-cli
|
|
353
319
|
```
|
|
354
320
|
|
|
355
|
-
|
|
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
|
-
-
|
|
365
|
-
-
|
|
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
|
-
#
|
|
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
|
-
-
|
|
390
|
-
-
|
|
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.
|
|
398
|
-
2. `SENSECRAFT_CLI_LOCAL_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
|
-
|
|
364
|
+
When a company network blocks OSS, use a local `dist/` or an internal mirror.
|
|
402
365
|
|
|
403
|
-
### `auth info`
|
|
366
|
+
### `auth info` says there is no Access Key yet
|
|
404
367
|
|
|
405
|
-
-
|
|
406
|
-
-
|
|
407
|
-
-
|
|
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
|
|
372
|
+
### The npm install and a `go build` binary see different configs
|
|
410
373
|
|
|
411
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
433
|
-
| [`README
|
|
434
|
-
| [`
|
|
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 |
|