@oiioii/cli 0.1.7 → 0.1.8

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.
Files changed (3) hide show
  1. package/README.md +149 -6
  2. package/dist/cli.js +34 -31
  3. package/package.json +6 -8
package/README.md CHANGED
@@ -17,14 +17,18 @@ human-readable output and a stable JSON envelope for AI agents and automation.
17
17
  | `auth logout` | Remove locally persisted authentication without exposing the API Key | Implemented |
18
18
  | `workspace create/set/current/rename` | Create, configure, inspect, and rename workspaces | Implemented |
19
19
  | `workspace assets list/download` | List workspace assets and download ready resources | Implemented |
20
- | `library list/search` | Query and search reusable role, scene, and item assets | Implemented |
20
+ | `workspace canvas create` | Create ordered blank nodes, prompts, references, and groups without client-side layout | Implemented |
21
+ | `workspace canvas node update` | Update prompt, generation parameters, and references on an empty canvas node | Implemented |
22
+ | `workspace canvas group create` | Group two or more existing canvas nodes without changing their layout | Implemented |
23
+ | `library create/list/search/members` | Create and query role, scene, item, and collection assets, including collection members | Implemented |
21
24
  | `image text` | Text-to-image generation | Implemented |
22
25
  | `image edit` | Image-to-image editing | Implemented |
23
26
  | `video text` | Text-to-video generation | Implemented |
24
27
  | `video image` | Image-to-video generation | Implemented |
25
28
  | `video generate` | Model-validated mixed image/video/audio reference generation | Implemented |
26
29
  | `audio generate` | Seed Audio and Suno audio/music generation | Implemented |
27
- | `upload file` | Upload local image/video/audio resources | Implemented |
30
+ | `upload resource` | Upload image/video/audio resources without a workspace | Implemented |
31
+ | `upload file` | Upload image/video/audio and attach it to a workspace | Implemented |
28
32
  | `record get/open` | Query generation metadata and download resources | Implemented |
29
33
  | `inspect capabilities/models` | Inspect declared capabilities and live backend models | Implemented |
30
34
  | `preview latest/bundle` | Read local preview bundles created by generation commands | Implemented |
@@ -42,14 +46,15 @@ Important current limitations:
42
46
  - REST metadata requests time out after 30 seconds; raw resource uploads/downloads use a 5-minute transfer timeout, and VOD transcode polling has a 10-minute overall deadline.
43
47
  - Image, video, and audio generation create local preview bundles after a queried task reaches a terminal state.
44
48
  - `inspect capabilities` is local metadata; `inspect models` requires authentication and queries the active backend.
45
- - Asset-library update/delete and style-library commands are not available. Reusable asset query/search and workspace-scoped asset listing/download are available.
49
+ - Style-library mutation commands are not available. Reusable asset creation, query, update, deletion, collection membership management, and workspace-scoped asset listing/download are available.
46
50
 
47
51
  ## Requirements
48
52
 
49
53
  - Node.js 18.18 or newer when running from source or the npm package.
50
54
  - A Hogi account for browser authorization, or an existing Hogi MCP API Key.
51
- - A workspace ID for image/video/audio generation and resource upload. It can be
55
+ - A workspace ID for image/video/audio generation and `upload file`. It can be
52
56
  created with `oiioii workspace create` or supplied from an existing project.
57
+ `upload resource` does not require a workspace.
53
58
  - `npm` is the repository package manager.
54
59
 
55
60
  The hosted installer uses Node.js 18.18 or newer when available. If no compatible
@@ -276,17 +281,137 @@ oiioii workspace assets download <asset_id> --output ./downloads --json
276
281
  identity to the asset's downloadable `uri`; loading, uploading, empty, failed,
277
282
  or URI-less assets fail before the download request.
278
283
 
279
- Query or search reusable library assets before generation:
284
+ Create blank canvas nodes and groups from a JSON file. The file contains only
285
+ composition data; select the workspace with the normal root option, environment
286
+ variable, local default, or the optional command argument:
287
+
288
+ ```json
289
+ {
290
+ "nodes": [
291
+ {
292
+ "client_id": "cover",
293
+ "type": "image",
294
+ "title": "Cover",
295
+ "prompt": "A cat based on @图片1 in a neon street",
296
+ "generation_config": {
297
+ "mcp_method_name": "generate_image_nanopro",
298
+ "model_version": "nano-banana-pro",
299
+ "ratio": "16:9",
300
+ "resolution": "2k",
301
+ "quality": "high"
302
+ },
303
+ "references": [
304
+ { "kind": "media", "media_type": "image", "uri": "hogi://image/cat.png" }
305
+ ]
306
+ },
307
+ { "client_id": "motion", "type": "video", "title": "Motion" }
308
+ ],
309
+ "groups": [
310
+ {
311
+ "client_id": "story",
312
+ "title": "Story",
313
+ "members": [
314
+ { "client_node_id": "motion" },
315
+ { "client_node_id": "cover" }
316
+ ]
317
+ }
318
+ ]
319
+ }
320
+ ```
280
321
 
281
322
  ```bash
323
+ oiioii workspace canvas create --input ./composition.json --json
324
+ oiioii workspace canvas create <workspace_id> \
325
+ --input ./composition.json \
326
+ --idempotency-key canvas-request-1 \
327
+ --json
328
+ ```
329
+
330
+ Node order follows `nodes`; `groups[].members` controls group membership order.
331
+ The CLI does not accept coordinates or compute layout. Use the same explicit
332
+ idempotency key only when replaying the same uncertain request. Optional
333
+ `generation_config` caches the empty node's model selection and generation
334
+ parameters for the existing Web editor. It accepts `mcp_method_name`,
335
+ `model_version`, `ratio`, `duration`, `resolution`, and `quality`; a
336
+ `model_version` requires a matching `mcp_method_name`.
337
+ For create and node update, indexed prompt mentions are converted by the CLI to
338
+ the self-contained protocol used by the Web canvas before the request is sent.
339
+ `@图N` / `@图片N` address image and role/scene/item references, while
340
+ `@音频N` and `@视频N` address their own media reference sequences. For example,
341
+ `@图片1` with `hogi://image/cat.png` becomes `[Image:image/cat.png]`.
342
+ Unresolved indexes remain unchanged. OpenAPI/curl callers must send the
343
+ self-contained protocol directly; this shorthand is a CLI-only capability.
344
+
345
+ Group two or more existing canvas nodes by their asset IDs:
346
+
347
+ ```bash
348
+ oiioii workspace canvas group create <asset_id_1> <asset_id_2> \
349
+ --title "Story" \
350
+ --workspace-id <workspace_id> \
351
+ --idempotency-key group-request-1 \
352
+ --json
353
+ ```
354
+
355
+ The command rejects duplicate members and nodes that already belong to another
356
+ group. It changes group membership only: it does not move nodes, compute a
357
+ layout, or accept coordinates. Reuse an idempotency key only for the identical
358
+ workspace, member order, and title.
359
+
360
+ Update an existing empty node with explicit field options:
361
+
362
+ ```bash
363
+ oiioii workspace canvas node update <asset_id> \
364
+ --workspace-id <workspace_id> \
365
+ --prompt "Use @图片1: a cat looking through a rainy window" \
366
+ --model "Nano Pro" \
367
+ --variant "nano-banana-pro" \
368
+ --ratio "16:9" \
369
+ --quality high \
370
+ --reference 'hogi://image/<reference-id>' 'hogi://role_asset/<role-id>' \
371
+ --json
372
+ ```
373
+
374
+ `--model` and optional `--variant` resolve through the active model catalog;
375
+ `--model-id` selects the catalog row directly. Use `--clear-prompt`,
376
+ `--clear-model`, `--clear-ratio`, `--clear-duration`, `--clear-resolution`,
377
+ `--clear-quality`, or `--clear-references` for explicit clears. Omitted options
378
+ keep their existing values. The server accepts this operation only when the
379
+ global `enable_cli_empty_canvas_node_update` flag is enabled for the caller and
380
+ the current asset status is `empty`. URI, status, type, position, title, group,
381
+ and raw metadata updates are not accepted. Completed, loading, uploading, and
382
+ failed nodes are rejected.
383
+
384
+ Create, query, or search reusable library assets before generation:
385
+
386
+ ```bash
387
+ oiioii library create role --name "Hero" --emo-image 'hogi://image/<expression-id>' --json
388
+ oiioii library create collection --name "Cast" --member 'hogi://role_asset/<id>' 'group:<id>' --json
389
+ oiioii library create scene --input ./scene.json --idempotency-key scene-import-001 --json
282
390
  oiioii library list role --limit 20 --json
391
+ oiioii library list collection --limit 20 --json
283
392
  oiioii library search role "球球" --limit 20 --json
393
+ oiioii library search collection "主要角色" --limit 20 --json
284
394
  oiioii library search scene "森林" --cursor '<next_cursor>' --json
395
+ oiioii library members <collection-id> --type role --keyword "主角" --limit 20 --json
396
+ oiioii library members <collection-id> --cursor '<next_cursor>' --json
397
+ oiioii library add-members <collection-id> 'hogi://role_asset/<id>' 'group:<id>' --json
398
+ oiioii library remove-members <collection-id> 'hogi://role_asset/<id>' 'group:<id>' --json
285
399
  ```
286
400
 
401
+ Collection list items use their `asset_id` as the stable identity and return
402
+ `asset_uri: null`. They include `member_count` without expanding the complete
403
+ member list. Use `next_cursor` with `--cursor` to continue pagination.
404
+ `library members` returns normalized role, scene, item, and group entries. Each
405
+ entry includes an `asset_ref` that can be passed directly to collection member
406
+ commands (`hogi://<type>_asset/<id>` or `group:<id>`).
407
+ `library remove-members` is idempotent and applies removals against the latest
408
+ Backend collection state instead of fetching and replacing the full member list
409
+ from the CLI.
410
+
287
411
  Use the returned `asset_uri` with `--asset`, or bind a prompt mention explicitly
288
412
  with `--bind <name=asset-uri>`. Explicit bindings avoid silently selecting the
289
413
  wrong asset when the library contains duplicate display names.
414
+ Reuse the returned `idempotency_key` when retrying an uncertain create request.
290
415
 
291
416
  Workspace resolution order is:
292
417
 
@@ -322,6 +447,13 @@ oiioii image edit \
322
447
  --json
323
448
  ```
324
449
 
450
+ For GPT Image 2, add `--transparent` to either `image text` or `image edit`
451
+ to request a transparent-background PNG. Other models reject this option.
452
+
453
+ ```bash
454
+ oiioii image text --prompt "an isolated sticker" --model gpt-image2 --transparent --json
455
+ ```
456
+
325
457
  Current behavior:
326
458
 
327
459
  - Accepts `--model-id <id>` from `inspect models` for exact backend model
@@ -481,6 +613,12 @@ record, and creates the terminal preview bundle. The CLI does not issue a second
481
613
  Upload image, video, or audio bytes:
482
614
 
483
615
  ```bash
616
+ # Pure resource upload for library/collection inputs; no workspace required
617
+ oiioii upload resource ./image.png --json
618
+ oiioii upload resource ./clip.mp4 --json
619
+ oiioii upload resource ./voice.mp3 --json
620
+
621
+ # Upload and attach to the active workspace
484
622
  oiioii upload file ./image.png --json
485
623
  oiioii upload file ./clip.mp4 --json
486
624
  oiioii upload file ./voice.mp3 --json
@@ -503,6 +641,11 @@ oiioii upload file ./voice.mp3 --after-asset-id <asset_id> --json
503
641
 
504
642
  Upload behavior:
505
643
 
644
+ - `upload resource` uploads small media through `POST /v1/res/uploadFile` and returns
645
+ only the reusable resource URI; it does not read or update a workspace.
646
+ - MOV files and videos of 10 MB or larger use the standalone VOD flow for
647
+ `upload resource`: `media_uploads/prepare` -> direct VOD upload -> `commit` -> `status`.
648
+ - `upload file` preserves the original workspace-bound behavior below.
506
649
  - Images, audio, and videos smaller than 10 MB use raw `application/octet-stream` bytes at
507
650
  `POST /v1/workspace/uploadAsset` with `workspace_id`, `file_type`, and optional
508
651
  `file_name` / `after_asset_id` query parameters.
@@ -523,7 +666,7 @@ Upload behavior:
523
666
  - `--attach` is retained as a no-op compatibility flag because uploads are now
524
667
  always attached.
525
668
  - A storage or workspace-write failure fails the upload command.
526
- - Arbitrary documents and URL uploads are outside the current scope.
669
+ - Arbitrary URL uploads are outside the current scope.
527
670
 
528
671
  Supported extensions:
529
672