@wji.ai/cli 0.1.1 → 0.2.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.
@@ -83,6 +83,10 @@ wji ws use <workspaceId>
83
83
  After that, `wji ws get`, `wji fs`, `wji gen` and `wji preset list` all default
84
84
  to that workspace. Use `wji ws use` rather than repeating `--workspace`.
85
85
 
86
+ `wji ws create <name>` seeds the default template — Dataset, DatasetImageGeneration and
87
+ InfiniteCanvas — because the API creates no apps on its own; pass `-a` to choose apps or
88
+ `--no-apps` for an empty workspace.
89
+
86
90
  ## Reading and editing the tree
87
91
 
88
92
  ```bash
@@ -95,12 +99,15 @@ wji fs get <nodeId> --json | jq .content
95
99
  wji fs mkdir <parentId> characters --nickname 角色
96
100
  wji dataset new <folderId> "Ada" -t character -d "a tired detective"
97
101
  wji fs describe <nodeId> @description.md
98
- wji fs set <nodeId> --images <assetId> <assetId>
102
+ wji fs set <nodeId> --merge content=@body.md --merge viewMode=content # merged into content
103
+ wji fs set <nodeId> --add-images <assetId> <assetId> # appended
104
+ wji fs set <nodeId> --images <assetId> <assetId> # replaced
99
105
  ```
100
106
 
101
- `wji fs set --content` **replaces** the whole content object. To change one
102
- field, read it first (`wji fs get <id> --json | jq .content`), merge, then
103
- write — or use `wji fs describe`, which merges `content.description` for you.
107
+ `wji fs set --content` **replaces** the whole content object, and so does
108
+ `--set content.x=…`. To change fields inside `content`, use `--merge key=value`
109
+ (dotted keys, `@file` values) — it reads the node and deep-merges for you, like
110
+ `wji fs describe` does for `content.description`.
104
111
 
105
112
  Several GET endpoints are cached server-side for 10 seconds, so a plain read
106
113
  immediately after a write can come back stale. `wji fs describe` and
@@ -242,11 +249,11 @@ a Ref model.
242
249
 
243
250
  ```bash
244
251
  wji fs get <datasetId> --scope full --json | jq '{images: [.images[]? | {id, type}], icon, primaryAudio}'
245
- wji fs set <datasetId> --images <headshot> <sheet> <voice> --icon <headshot> --set primaryAudio=<voice>
252
+ wji fs set <datasetId> --add-images <headshot> <sheet> <voice> --icon <headshot> --set primaryAudio=<voice>
246
253
  ```
247
254
 
248
- `--images` replaces the whole list — read the current list first and keep
249
- what is already there.
255
+ `--add-images` appends; `--images` replaces the whole list — use it only when
256
+ the user wants the list rewritten, after reading what is there.
250
257
 
251
258
  ## Assets
252
259
 
@@ -302,12 +309,19 @@ use `skill push` for large files.
302
309
 
303
310
  ## Canvas
304
311
 
305
- An Infinite Canvas holds **nodes** (text, title, comment, image, video, audio…)
306
- and **edges** between them. An edge into a media node makes the source one of
307
- its **references**, numbered per kind in edge order: `@image1`, `@image2`,
308
- `@video1`. A media node is either a **display** node (shows an existing asset)
309
- or a **generate** node (prompt + model + settings; generating fills in its
310
- asset).
312
+ An Infinite Canvas holds **nodes** (text, title, comment, image, video, audio,
313
+ dataset…) and **edges** between them. An edge into a media node makes the
314
+ source one of its **references**, numbered per kind in edge order: `@image1`,
315
+ `@image2`, `@video1`. A media node is either a **display** node (shows an
316
+ existing asset) or a **generate** node (prompt + model + settings; generating
317
+ fills in its asset). A **dataset** node is a card bound to a workspace dataset
318
+ (`canvas add dataset --dataset <fsnodeId>`) — good for showing a character
319
+ or scene next to its sheets, but `canvas gen` cannot take it as a reference:
320
+ reference the image display node that shows the asset instead.
321
+
322
+ A workspace's InfiniteCanvas app can hold several canvases (`wji canvas list`);
323
+ `wji canvas create <name>` adds an empty one — e.g. one canvas per episode or
324
+ per character set.
311
325
 
312
326
  **The link.** The user opens a canvas in the browser and presses the link
313
327
  button in its top bar. That stores the open workspace, canvas and **the nodes
@@ -321,8 +335,11 @@ wji canvas nodes # every node; * marks generate nodes
321
335
  wji canvas get <nodeId> # full detail incl. references
322
336
  wji asset download <assetId…> -o <dir> # then look at the images yourself
323
337
 
338
+ wji canvas create E01 -w <workspaceId> # new empty canvas; then --canvas <id>
324
339
  wji canvas add video --from <imgNode> <imgNode> -m <model> -r 16:9 -d 8 -p "@image1 … @image2 …"
325
340
  wji canvas add text -t "shot list…" --at 0,600
341
+ wji canvas add image --asset <assetId> -n "Ada sheet" # display node for an existing asset
342
+ wji canvas add dataset --dataset <fsnodeId> # card bound to a workspace dataset
326
343
  wji canvas set <nodeId> -p "new prompt" # merges: other settings stay
327
344
  wji canvas set <nodeId> -m <model> --resolution 720p --set seed=42
328
345
  wji canvas connect <from> <to> / wji canvas disconnect <from> <to>
@@ -412,8 +429,9 @@ wji org list && wji org use <orgId>
412
429
  anything you find afterwards — new targets need a new question.
413
430
  - **Overwrites don't prompt at all.** `fs set --content`, `--images` and
414
431
  `--tags`, and the update commands' tag options, replace the whole value.
415
- Read the current value first, and check with the user before replacing
416
- anything they did not ask to change.
432
+ Prefer the merging forms (`--merge`, `--add-images`, `fs describe`); when
433
+ you must replace, read the current value first and check with the user
434
+ before replacing anything they did not ask to change.
417
435
  - **Generation costs credits — one image just runs; video and batches ask
418
436
  first.** This is the user's standing policy. Follow it without asking them
419
437
  to restate it:
@@ -67,7 +67,7 @@ switch endpoint.
67
67
  | `ws list [-k keyword] [-s all\|me\|shared\|favorite] [--page] [--limit]` | `GET /workspace/search` — `--limit` max 100, `-1` returns at most 500 |
68
68
  | `ws get [id]` | `GET /workspace/list/:id` |
69
69
  | `ws use <id>` | stores the default workspace locally |
70
- | `ws create <name> [-d] [-r ratio] [-l lang] [-t type] [-a app...]` | `POST /workspace/create` |
70
+ | `ws create <name> [-d] [-r ratio] [-l lang] [-t type] [-a app...] [--no-apps]` | `POST /workspace/create` — without `-a` the workspace gets the default template `dataset datasetimagegeneration canvas`; `--no-apps` creates it empty (the API itself adds nothing) |
71
71
  | `ws update [id] [-n] [-d] [-r] [-l] [--set]` | `PUT /workspace/list/:id` |
72
72
  | `ws rm <id> [-y]` | `DELETE /workspace/list/:id` (owner only) |
73
73
  | `ws favorite <id> [--off]` | `PUT /workspace/list/:id/favorite` |
@@ -99,7 +99,7 @@ Restriction from the backend: `Dataset`, `Draw`, `DatasetImageGeneration` and
99
99
  | `fs path <id>` | `GET /fsnode/list/:id/path` |
100
100
  | `fs mkdir <parent> <name> [--nickname] [--content]` | `POST /fsnode/create` type=folder |
101
101
  | `fs touch <parent> <name> [--mimetype] [--asset] [--content]` | `POST /fsnode/create` type=file |
102
- | `fs set <id> [-n] [--nickname] [--content] [--tags] [--images] [--icon] [--asset] [--sort] [--set]` | `PATCH /fsnode/list/:id` |
102
+ | `fs set <id> [-n] [--nickname] [--content] [--tags] [--images] [--add-images] [--icon] [--asset] [--sort] [--set] [--merge]` | `PATCH /fsnode/list/:id` — `--merge key=value` deep-merges into `content` (reads first; `@file` values), `--add-images` appends to `images`; `--content`, `--images`, `--set content.*` replace |
103
103
  | `fs describe <id> <text>` | merges `content.description` |
104
104
  | `fs rm <id> [-y]` | `DELETE /fsnode/list/:id` (soft delete, whole subtree) |
105
105
  | `fs sort <parent> <ids...>` | `PATCH /fsnode/list/:id/children/sort` |
@@ -161,10 +161,11 @@ updates live.
161
161
  | `canvas status` (`link`) | `GET /canvas-link`, then the selected nodes read fresh from the canvas |
162
162
  | `canvas unlink` | `DELETE /canvas-link`; the tab turns its button off at its next heartbeat (≤ 60s) |
163
163
  | `canvas list [-w]` | canvases under each InfiniteCanvas app: `GET /workspace/list/:id/fs/:appId` → `workspace-v2/canvases` children |
164
+ | `canvas create <name> [-w] [--app]` | `POST /fsnode/create` a `workspace-v2/canvas` folder under that `canvases` folder with the web's initial content (`{data:{viewport, backgroundMode:'dots'}, metadata:{}}`) |
164
165
  | `canvas nodes [-c] [-k kind]` | `GET /fsnode/list/:canvasId/children?limit=-1` + `POST /assets/check-status` |
165
166
  | `canvas get <nodeId> [-c]` | same load; one node with references (`@image1 ← id`) and frame slots |
166
167
  | `canvas edges [-c] [--node]` | the `canvas/edge` children |
167
- | `canvas add <kind> [-c] [-n] [-t\|--text-file] [--asset] [-p\|--prompt-file] [-m] [-r] [--resolution] [-d] [--set] [--from ids…] [--at x,y]` | `POST /fsnode/create` (`canvas/node/<kind>`), then one `canvas/edge` per `--from`. Kinds: text, title, comment, image, video, audio |
168
+ | `canvas add <kind> [-c] [-n] [-t\|--text-file] [--asset] [--dataset] [-p\|--prompt-file] [-m] [-r] [--resolution] [-d] [--set] [--from ids…] [--at x,y]` | `POST /fsnode/create` (`canvas/node/<kind>`), then one `canvas/edge` per `--from`. Kinds: text, title, comment, image, video, audio, dataset. `add dataset --dataset <fsnodeId>` writes `content {datasetId, datasetName, datasetType, datasetParentName, description}` from the dataset node (must be `workspace/dataset`); it takes no `--from` |
168
169
  | `canvas set <nodeId> [-c] [-n] [-t] [--move x,y] [-p] [-m] [-r] [--resolution] [-d] [--set]` | read → merge → `PATCH /fsnode/list/:id` |
169
170
  | `canvas connect <from> <to> [-c]` | `POST /fsnode/create` (`canvas/edge`); a first/last-frame video model gets `videoFrameSlot` start, then end |
170
171
  | `canvas disconnect <from> <to> [-c]` | `DELETE /fsnode/list/:edgeId` |