@fugood/bricks-cli 2.26.0-beta.9 → 2.26.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/README.md CHANGED
@@ -123,6 +123,10 @@ bricks auth remove <profile-name>
123
123
 
124
124
  # Set custom API URL
125
125
  bricks auth set-url <url>
126
+
127
+ # Revoke every Buttress and DevTools access token of the workspace issued up to now
128
+ # (BRICKS server >= 2.26; devices apply it when they next reach BRICKS, Buttress servers do not yet)
129
+ bricks auth revoke-access-tokens [-y|--yes] [-j|--json]
126
130
  ```
127
131
 
128
132
  ### Doctor
@@ -170,9 +174,18 @@ bricks device list [-k keyword] [-j|--json]
170
174
  # Resolve a device name or ID
171
175
  bricks device resolve <query> [-l limit] [-j|--json]
172
176
 
173
- # Get device details
177
+ # Get device details (incl. stored Lock, Activity Log and Local Sync settings)
174
178
  bricks device get <device-id> [-j|--json]
175
179
 
180
+ # Update device settings (only the given settings change; other ENV variables are kept)
181
+ bricks device update <device-id> [-n name] [-d description] [--tags a,b] [--dry-run] [-j|--json]
182
+ bricks device update <device-id> [-e KEY=VALUE ...] [--env-json '{"KEY":"value"}'] [--unset-env KEY ...]
183
+ bricks device update <device-id> [--[no-]activity-log] [--activity-log-filter filter] [--[no-]activity-log-screenshot]
184
+ bricks device update <device-id> [--[no-]local-sync] [--local-sync-priority 0-9] [--[no-]local-sync-dynamic-latency] [--local-sync-latency-offset ms]
185
+ bricks device update <device-id> --lock | --unlock
186
+ # --lock / --unlock run alone. A locked device refuses other updates: unlock it first.
187
+ # ENV changes reach the running app after `bricks device refresh <device-id>` (not automatic).
188
+
176
189
  # Bind a new device with passcode
177
190
  bricks device bind <passcode> [-n device-name]
178
191
  bricks device bind <passcode> [--dry-run] [-j|--json]
@@ -206,8 +219,8 @@ bricks app resolve <query> [-l limit] [-j|--json]
206
219
  # Get application details
207
220
  bricks app get <app-id> [-c|--composed] [-j|--json]
208
221
 
209
- # Update application
210
- bricks app update <app-id> [-n name] [-d description] [-c config-json] [-f config-file] [--validate]
222
+ # Update application (`-t ''` clears the tags; a locked application refuses all changes until --unlock)
223
+ bricks app update <app-id> [-n name] [-d description] [-t tags] [--lock|--unlock] [-c config-json] [-f config-file] [--validate]
211
224
 
212
225
  # Short edit application (requires valid shortIds from app config)
213
226
  bricks app short-edit <app-id> -l '[{"shortId":"<subspace-short-id>","path":"property.name","content":"value"}]'
@@ -215,16 +228,39 @@ bricks app short-edit <app-id> -l '[{"shortId":"<subspace-short-id>","path":"pro
215
228
  # Bind/unbind devices
216
229
  bricks app bind <app-id> [-b device-ids] [-u device-ids]
217
230
  bricks app bind <app-id> [-b device-ids] [-u device-ids] [--dry-run] [-j|--json]
231
+ # Set the viewport of new or bound devices (JSON or a JSON file keyed by device ID).
232
+ # Fields: x, y, width, height, rotate, type (rotate|scroll), rotateType (crop|fit|physical-rotate),
233
+ # scrollType (crop|fit), maintainAspectRatio, forceDeviceRatio, mirrorHorizontal, mirrorVertical, content.
234
+ # Fields not given keep the current viewport, else the root layout (full size at 0,0).
235
+ # A bound device keeps its other settings (automation, cron tests, control toggles, env).
236
+ bricks app bind <app-id> --viewport '{"<device-id>":{"x":0,"y":0,"width":960,"height":540,"rotate":90}}' [--dry-run] [-j|--json]
218
237
 
219
238
  # Trigger automation
220
- bricks app trigger <app-id> <test-id> [--play|--stop] [--setup-at-launch]
239
+ bricks app trigger <app-id> <test-id> [--play|--stop] [--setup-at-launch] [-g match-group]
221
240
 
222
- # Preview a release without publishing
241
+ # Application Control pages (Runtime Editor, Canvas Control, Device Control):
242
+ # issue a page token and print the URL of each page (needs an OAuth login: `bricks auth login`);
243
+ # --no-token prints the sign-in URLs only and works with any login
244
+ bricks app control-page <app-id> -t <short-edit,canvas-control,device-control,device-control-create-only> [--token-name name] [--expires-in days] [-e KEY=VALUE] [--no-token] [--dry-run] [-j|--json]
245
+ # The printed URL is <controller>/<page>.html?workspace_secret=…&application_id=…; set BRICKS_CONTROLLER_URL to override the controller origin.
246
+
247
+ # Create a release (--dry-run checks it without publishing). A semver --version must be newer than every semver release in the cloud (see `bricks app versions <app-id> -j`); non-semver labels such as the default app name work as before.
223
248
  bricks app release <app-id> -c <config-path-or-json> [-n name] [--version version] [--changelogs text] [--dry-run] [-j|--json]
224
249
 
250
+ # CTOR projects: a config-only push (update-app) is the normal last step after edits.
251
+ bricks ctor push --auto-commit -y
252
+ # Release (deploy-app) only when a new version is requested. The version (from --version, --auto-version or package.json) must be semver and newer than every cloud release; a duplicate or lower one is refused before anything changes. There is no bypass flag: restore an old release with `bricks app switch-version`.
253
+ bricks ctor deploy --auto-commit --version <next-version> -y
254
+
255
+ # List release versions, then switch the platform config to one (ID or name).
256
+ # The local CTOR project is not changed. Unreleased changes are dropped: confirm, or pass -y.
257
+ bricks app versions <app-id> [-j|--json]
258
+ bricks app switch-version <app-id> <version-id-or-name> [-y|--yes] [--dry-run] [-j|--json]
259
+
225
260
  # Diagnose a config: schema validation + semantic lint rules
226
261
  # (data-update-race, redundant-rect-overlay, off-grid-frame, out-of-bounds-frame,
227
- # wait-async-no-op, missing-result-param, unused-data-node, z-order-cover)
262
+ # wait-async-no-op, missing-result-param, unused-data-node, z-order-cover,
263
+ # expression-global-variable, mapping-outside-items)
228
264
  # Accepts a local file path or a remote application id.
229
265
  bricks app doctor <app-id-or-path> [-c|--composed] [--strict] [--only codes] [--ignore codes] [-j|--json]
230
266
  ```
@@ -278,11 +314,37 @@ bricks group refresh <group-id> [--dry-run] [-j|--json]
278
314
  bricks group monitor <group-id> [-i interval-seconds]
279
315
  ```
280
316
 
317
+ ### Blueprints
318
+
319
+ A Blueprint is a workspace-level map of a site: its applications, modules, devices, Data Bank
320
+ properties and Media Flow boxes as nodes, with role cards and the edges between them. The CLI
321
+ reads Blueprints; edit them in CTOR. These commands need the `query_blueprint` token permission.
322
+
323
+ ```bash
324
+ # List blueprints (name, node count, revision, Orchestrator run state)
325
+ bricks blueprint list [-k keyword] [-j|--json]
326
+
327
+ # Resolve a blueprint name or ID
328
+ bricks blueprint resolve <query> [-l limit] [-j|--json]
329
+
330
+ # Get blueprint details (overview, counts, run state, referenced entities with no node)
331
+ bricks blueprint get <blueprint-id> [-j|--json]
332
+
333
+ # Nodes with authored edges and edges derived from the workspace (bindings, used modules, ...)
334
+ bricks blueprint graph <blueprint-id> [-j|--json]
335
+
336
+ # Nodes grouped by kind; removed or moved entities are flagged as missing
337
+ bricks blueprint members <blueprint-id> [-j|--json]
338
+
339
+ # Print the projection text that the Blueprint Orchestrator gets as its context
340
+ bricks blueprint projection <blueprint-id>
341
+ ```
342
+
281
343
  ### Media Flow
282
344
 
283
345
  Media Flow commands require:
284
346
  - Workspace has Media Flow enabled (`Workspace Settings → Media Flow`).
285
- - Your token includes `query_media_flow` permission (and `write_media_flow` for future upload/mutation features).
347
+ - Your token includes `query_media_flow` permission (and `write_media_flow` for upload and other changes).
286
348
 
287
349
  ```bash
288
350
  # List Media Flow boxes
@@ -299,8 +361,27 @@ bricks media files <box-id> \
299
361
 
300
362
  # Get a Media Flow file (prints original + thumbnail URLs)
301
363
  bricks media file <file-id> [-j|--json]
364
+
365
+ # Create / edit a box (OAuth login only: the workspace token API has no box mutations)
366
+ bricks media box-create -n <name> [-d description] [-t tag ...] [-j]
367
+ bricks media box-edit <box-id> [-n name] [-d description] [-t tag ... | --clear-tags] [-j]
368
+
369
+ # Passcodes (codes are hidden in all output unless --show-codes; add/remove need OAuth)
370
+ bricks media passcode list <box-id> [--show-codes] [-j]
371
+ bricks media passcode add <box-id> [-n name] (--code-stdin | --code <code>) \
372
+ [--expires-in 30m|12h|7d] [-p ALL|READ_ONLY,POST_ONLY,DELETE] [--show-codes] [-j]
373
+ bricks media passcode remove <box-id> <passcode-id> [-y] [-j]
374
+
375
+ # Files
376
+ bricks media file-edit <file-id...> [-n name] [-d description] [-t tag ... | --clear-tags] [-j]
377
+ bricks media file-copy <from-box-id> <to-box-id> <file-id...> [-j]
378
+ bricks media file-delete <box-id> <file-id...> [-y] [-j]
379
+ bricks media box-clear <box-id> [-t image,video] [-y] [-j]
380
+ bricks media box-preview <file-id> [-j]
302
381
  ```
303
382
 
383
+ `media boxes`, `media box` and `media passcode list` hide passcode codes, also with `--json`; pass `--show-codes` to include them. For passcodes made in box settings the server returns a hash, not the code. `file-delete`, `box-clear` and `passcode remove` ask for confirmation on a terminal, and need `-y` in scripts or with `--json`.
384
+
304
385
  ### Data Bank (Remote Properties)
305
386
 
306
387
  Manage the workspace Data Bank: settings and space keys go through the Workspace API
@@ -345,6 +426,9 @@ Notes:
345
426
  - When no `-v/--value-file` is given, `set` keeps the current value (useful to change only tags or the definition).
346
427
  - `-v` parses the input as JSON and falls back to a plain string (`-v '{"a":1}'` → object, `-v hello` → string).
347
428
  - Revoking the auto-provisioned `manager` / `used-by-device` keys rotates them instead of deleting them.
429
+ - Space key values come back masked (last 4 characters) unless the login may read them: the
430
+ workspace owner, a role with `update-workspace`, or a token with the `manage_devtools` scope.
431
+ A key the login creates is always returned in full, and a masked key revokes by its full value.
348
432
  - The Data Bank endpoint is derived from the configured BRICKS endpoint
349
433
  (prod → `bank.bricks.tools`, beta → `bank-beta.bricks.tools`, dev → `localhost:8080`).
350
434
  - Environment overrides for CI / custom setups: `BRICKS_BANK_SPACENAME` + `BRICKS_BANK_SPACEKEY`
@@ -353,6 +437,31 @@ Notes:
353
437
  it in the buttress `state.json`, so that server's local functions can use `context.bank`
354
438
  (`--revoke` removes it; re-running rotates the key).
355
439
 
440
+ ### Buttress binding and device authentication
441
+
442
+ `bricks buttress bind` pairs the server with the current workspace **and automatically
443
+ provisions a workspace-scoped DevTools token** in its permission-restricted `state.json`.
444
+ After restarting Buttress, agents with `local_devices = true` use it for matching-workspace
445
+ devices without passing credentials through model arguments. Normal bind/status output
446
+ hides the token; `--print` emits the complete secret state for remote provisioning.
447
+ Rebind and restart to renew an expired or revoked token (default lifetime: 30 days).
448
+ Rebinding does not revoke older tokens; `bricks auth revoke-access-tokens` (BRICKS server
449
+ >= 2.26) revokes all of the workspace's tokens on devices the next time they reach BRICKS.
450
+ Automatic device authentication assumes a trusted LAN.
451
+
452
+ When the BRICKS server issues BRICKS Registry credentials, `bind` also stores the server's
453
+ node credential and the Registry trust data in `state.json` (it needs a workspace token with
454
+ the `manage_devtools` scope, or OAuth login with `update-workspace`). An older server binds
455
+ as before. When the bind gets no credential, it still succeeds and says so.
456
+ `bricks buttress node-credential` gets a new one without a rebind; it keeps a stored
457
+ credential until its `renewAfter` unless you pass `--force`, and a failed issue never removes
458
+ the stored one. A Buttress server with the node renewer renews the credential by itself at the
459
+ Registry; the command is the way out when that fails, and its new credential also drops a
460
+ renewed credential that waits for its confirm (`nodeCredential.pending`). `bricks buttress status` shows the expiry and the issuer, never the credential.
461
+ Restart Buttress after `bind`. After `node-credential`, Buttress 2.26 or later takes the new
462
+ credential within 60 seconds when `state.json` already had the Registry trust data; restart an
463
+ older Buttress, or one that started without that data.
464
+
356
465
  ### Interactive Mode
357
466
 
358
467
  ```bash