@fugood/bricks-cli 2.25.0-beta.40 → 2.25.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/lib/10.js +1 -1
- package/lib/117.js +1 -1
- package/lib/index.js +104 -68
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -258,6 +258,55 @@ bricks media files <box-id> \
|
|
|
258
258
|
bricks media file <file-id> [-j|--json]
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
+
### Data Bank (Remote Properties)
|
|
262
|
+
|
|
263
|
+
Manage the workspace Data Bank: settings and space keys go through the Workspace API
|
|
264
|
+
(workspace token); property CRUD talks to the Data Bank API directly using a space key.
|
|
265
|
+
On the first property command the CLI issues a key via the Workspace API and saves it
|
|
266
|
+
to the active profile (`~/.bricks-cli/config.json`) — no manual setup needed.
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
# Workspace-level settings
|
|
270
|
+
bricks data status [-j|--json] # also shows the stored CLI key (masked)
|
|
271
|
+
bricks data enable
|
|
272
|
+
bricks data disable
|
|
273
|
+
|
|
274
|
+
# Stored CLI key management
|
|
275
|
+
bricks data login [--name <keyName>] # (re)issue a key and save it to the profile
|
|
276
|
+
bricks data logout [--revoke] # remove the stored key; --revoke also revokes it
|
|
277
|
+
|
|
278
|
+
# Space key management (human output masks key values; --json includes them)
|
|
279
|
+
bricks data keys list [-j|--json]
|
|
280
|
+
bricks data keys new <name> \
|
|
281
|
+
[--expire-at <ISO date>] \ # between 1 hour and 90 days from now
|
|
282
|
+
[--read <propId,...>] \ # limit readable properties
|
|
283
|
+
[--write <propId,...>] \ # limit writable properties
|
|
284
|
+
[-j|--json]
|
|
285
|
+
bricks data keys revoke <keyValue|name> [-y] [-j|--json]
|
|
286
|
+
|
|
287
|
+
# Property CRUD (Data Bank API, uses the stored key)
|
|
288
|
+
bricks data list [-k keyword] [-m InSubspace|Global] [-j|--json]
|
|
289
|
+
bricks data get <propertyId> [-j|--json]
|
|
290
|
+
bricks data set <propertyId> \
|
|
291
|
+
[-v <json-or-string> | --value-file <path>] \
|
|
292
|
+
[-d <definition-json> | --definition-file <path>] \
|
|
293
|
+
[-m InSubspace|Global] [-t tag1,tag2] [-n "<update note>"] \
|
|
294
|
+
[--no-upsert] \ # fail when the property does not exist
|
|
295
|
+
[--no-notify] \ # skip notifying subscribed devices
|
|
296
|
+
[--dry-run] [-j|--json]
|
|
297
|
+
bricks data remove <propertyId> [-y] [--dry-run] [-j|--json]
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Notes:
|
|
301
|
+
- `set` is an upsert by default and notifies subscribed devices, the same as editing in the controller Bank page.
|
|
302
|
+
- When no `-v/--value-file` is given, `set` keeps the current value (useful to change only tags or the definition).
|
|
303
|
+
- `-v` parses the input as JSON and falls back to a plain string (`-v '{"a":1}'` → object, `-v hello` → string).
|
|
304
|
+
- Revoking the auto-provisioned `manager` / `used-by-device` keys rotates them instead of deleting them.
|
|
305
|
+
- The Data Bank endpoint is derived from the configured BRICKS endpoint
|
|
306
|
+
(prod → `bank.bricks.tools`, beta → `bank-beta.bricks.tools`, dev → `localhost:8080`).
|
|
307
|
+
- Environment overrides for CI / custom setups: `BRICKS_BANK_SPACENAME` + `BRICKS_BANK_SPACEKEY`
|
|
308
|
+
(skip the stored key) and `BRICKS_BANK_ENDPOINT` (custom Bank URL).
|
|
309
|
+
|
|
261
310
|
### Interactive Mode
|
|
262
311
|
|
|
263
312
|
```bash
|