@oiioii/cli 0.1.7 → 0.1.9

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 +201 -8
  2. package/dist/cli.js +34 -31
  3. package/package.json +6 -8
package/README.md CHANGED
@@ -15,16 +15,22 @@ human-readable output and a stable JSON envelope for AI agents and automation.
15
15
  | `auth login` | Browser authorization for terminal/Codex/WorkBuddy/Kimi/Claude Code/DeepSeek, or explicit API Key persistence | Implemented |
16
16
  | `auth status` | Check configured authentication without exposing the API Key | Implemented |
17
17
  | `auth logout` | Remove locally persisted authentication without exposing the API Key | Implemented |
18
- | `workspace create/set/current/rename` | Create, configure, inspect, and rename workspaces | Implemented |
18
+ | `workspace create/set/current/rename/open/delete` | Create, configure, inspect, and rename workspaces, including folder and subgroup placement | Implemented |
19
+ | `workspaces list` / `workspace list` | List visible workspaces with names, conversation counts, pagination, and search in production | Implemented |
20
+ | `workspace folder` / `workspace subgroup list` | Manage workspace folders and discover visible subgroup creation choices | Implemented |
19
21
  | `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 |
22
+ | `workspace canvas create` | Create ordered blank nodes, prompts, references, and groups without client-side layout | Implemented |
23
+ | `workspace canvas node update` | Update prompt, generation parameters, and references on an empty canvas node | Implemented |
24
+ | `workspace canvas group create` | Group two or more existing canvas nodes without changing their layout | Implemented |
25
+ | `library create/list/search/members` | Create and query role, scene, item, and collection assets, including collection members | Implemented |
21
26
  | `image text` | Text-to-image generation | Implemented |
22
27
  | `image edit` | Image-to-image editing | Implemented |
23
28
  | `video text` | Text-to-video generation | Implemented |
24
29
  | `video image` | Image-to-video generation | Implemented |
25
30
  | `video generate` | Model-validated mixed image/video/audio reference generation | Implemented |
26
31
  | `audio generate` | Seed Audio and Suno audio/music generation | Implemented |
27
- | `upload file` | Upload local image/video/audio resources | Implemented |
32
+ | `upload resource` | Upload image/video/audio resources without a workspace | Implemented |
33
+ | `upload file` | Upload image/video/audio and attach it to a workspace | Implemented |
28
34
  | `record get/open` | Query generation metadata and download resources | Implemented |
29
35
  | `inspect capabilities/models` | Inspect declared capabilities and live backend models | Implemented |
30
36
  | `preview latest/bundle` | Read local preview bundles created by generation commands | Implemented |
@@ -42,14 +48,15 @@ Important current limitations:
42
48
  - 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
49
  - Image, video, and audio generation create local preview bundles after a queried task reaches a terminal state.
44
50
  - `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.
51
+ - 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
52
 
47
53
  ## Requirements
48
54
 
49
55
  - Node.js 18.18 or newer when running from source or the npm package.
50
56
  - 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
57
+ - A workspace ID for image/video/audio generation and `upload file`. It can be
52
58
  created with `oiioii workspace create` or supplied from an existing project.
59
+ `upload resource` does not require a workspace.
53
60
  - `npm` is the repository package manager.
54
61
 
55
62
  The hosted installer uses Node.js 18.18 or newer when available. If no compatible
@@ -130,7 +137,7 @@ The default backend URL and browser authorization page are embedded into the gen
130
137
 
131
138
  | Build command | Environment | Embedded default backend | Authorization page |
132
139
  |---|---|---|---|
133
- | `npm run build:production` | production | `https://api.oiioii.ai` (optional `OIIOII_PRODUCTION_BASE_URL` override) | `https://oiioii.tv/auth/cli` |
140
+ | `npm run build:production` | production | `https://api.oiioii.ai` (optional `OIIOII_PRODUCTION_BASE_URL` override) | `https://oiioii.ai/auth/cli` |
134
141
  | `npm run build:test` | test | `OIIOII_TEST_BASE_URL` from `.env` | Build-specific test authorization page |
135
142
  | `npm run build:local` | local | `http://localhost:4000` | `http://localhost:3000/auth/cli` |
136
143
 
@@ -256,6 +263,54 @@ oiioii workspace set <workspace_id> --json
256
263
  oiioii workspace current --json
257
264
  ```
258
265
 
266
+ Open a workspace in the browser, or retrieve its URL without opening a browser:
267
+
268
+ ```bash
269
+ oiioii workspace open <workspace_id>
270
+ oiioii workspace open --no-browser --json
271
+ ```
272
+
273
+ Workspace URLs use the authorization page's origin and `/space/<workspace_id>`:
274
+ `https://oiioii.ai/space/<workspace_id>` in production. Omit the ID to use the
275
+ active workspace. The browser uses its own login session; no API key is added to
276
+ the URL.
277
+
278
+ List workspaces or move one workspace to the recycle bin:
279
+
280
+ ```bash
281
+ oiioii workspaces list --limit 20 --search "Project" --json
282
+ oiioii workspace list --cursor <next_cursor> --json
283
+ oiioii workspace delete <workspace_id> --json
284
+ ```
285
+
286
+ Deletion uses the same lifecycle permission as the Web: the account owner or the
287
+ workspace subgroup leader. It is soft deletion, and retries preserve the original
288
+ trash timestamp. Omit the ID to delete the active workspace. These commands require
289
+ a backend with `GET /v1/workspaces` and `POST /v1/workspace/delete`; they do not
290
+ fall back to debug or the legacy text-list endpoint.
291
+
292
+ Folder and subgroup placement is optional. Omit `--subgroup` to use the account's default subgroup, or pass `--public` to request public placement; `--public` and `--subgroup` cannot be combined. Sub-accounts can create only in their permitted subgroup. Creation preserves the active workspace unless `--set-current` is supplied.
293
+
294
+ ```bash
295
+ oiioii workspace subgroup list --json
296
+ oiioii workspace folder list --limit 20 --json
297
+ oiioii workspace folder create --name "Project folder" --subgroup <subgroup_id> --json
298
+ oiioii workspace create --name "New project" --folder <folder_id> --subgroup <subgroup_id> --json
299
+ oiioii workspace create --name "Public project" --public --json
300
+ oiioii workspace folder get <folder_id> --json
301
+ oiioii workspace folder workspaces <folder_id> --limit 20 --json
302
+ oiioii workspace folder move <folder_id> --workspace-id <workspace_id> --json
303
+ oiioii workspace folder remove --workspace-id <workspace_id> --json
304
+ oiioii workspace folder rename <folder_id> --name "Renamed folder" --json
305
+ oiioii workspace folder favorite <folder_id> --json
306
+ oiioii workspace folder unfavorite <folder_id> --json
307
+ oiioii workspace folder trash <folder_id> --json
308
+ oiioii workspace folder restore <folder_id> --json
309
+ oiioii workspace folder purge <folder_id> --json
310
+ ```
311
+
312
+ List responses include `has_more` and, when more rows exist, `next_cursor`. Pass that cursor using `--cursor` to fetch the next page. Trashing/restoring a folder applies to its contained projects; `purge` permanently deletes a trashed folder and its projects.
313
+
259
314
  Rename the active workspace, or pass an explicit workspace ID:
260
315
 
261
316
  ```bash
@@ -276,17 +331,137 @@ oiioii workspace assets download <asset_id> --output ./downloads --json
276
331
  identity to the asset's downloadable `uri`; loading, uploading, empty, failed,
277
332
  or URI-less assets fail before the download request.
278
333
 
279
- Query or search reusable library assets before generation:
334
+ Create blank canvas nodes and groups from a JSON file. The file contains only
335
+ composition data; select the workspace with the normal root option, environment
336
+ variable, local default, or the optional command argument:
337
+
338
+ ```json
339
+ {
340
+ "nodes": [
341
+ {
342
+ "client_id": "cover",
343
+ "type": "image",
344
+ "title": "Cover",
345
+ "prompt": "A cat based on @图片1 in a neon street",
346
+ "generation_config": {
347
+ "mcp_method_name": "generate_image_nanopro",
348
+ "model_version": "nano-banana-pro",
349
+ "ratio": "16:9",
350
+ "resolution": "2k",
351
+ "quality": "high"
352
+ },
353
+ "references": [
354
+ { "kind": "media", "media_type": "image", "uri": "hogi://image/cat.png" }
355
+ ]
356
+ },
357
+ { "client_id": "motion", "type": "video", "title": "Motion" }
358
+ ],
359
+ "groups": [
360
+ {
361
+ "client_id": "story",
362
+ "title": "Story",
363
+ "members": [
364
+ { "client_node_id": "motion" },
365
+ { "client_node_id": "cover" }
366
+ ]
367
+ }
368
+ ]
369
+ }
370
+ ```
371
+
372
+ ```bash
373
+ oiioii workspace canvas create --input ./composition.json --json
374
+ oiioii workspace canvas create <workspace_id> \
375
+ --input ./composition.json \
376
+ --idempotency-key canvas-request-1 \
377
+ --json
378
+ ```
379
+
380
+ Node order follows `nodes`; `groups[].members` controls group membership order.
381
+ The CLI does not accept coordinates or compute layout. Use the same explicit
382
+ idempotency key only when replaying the same uncertain request. Optional
383
+ `generation_config` caches the empty node's model selection and generation
384
+ parameters for the existing Web editor. It accepts `mcp_method_name`,
385
+ `model_version`, `ratio`, `duration`, `resolution`, and `quality`; a
386
+ `model_version` requires a matching `mcp_method_name`.
387
+ For create and node update, indexed prompt mentions are converted by the CLI to
388
+ the self-contained protocol used by the Web canvas before the request is sent.
389
+ `@图N` / `@图片N` address image and role/scene/item references, while
390
+ `@音频N` and `@视频N` address their own media reference sequences. For example,
391
+ `@图片1` with `hogi://image/cat.png` becomes `[Image:image/cat.png]`.
392
+ Unresolved indexes remain unchanged. OpenAPI/curl callers must send the
393
+ self-contained protocol directly; this shorthand is a CLI-only capability.
394
+
395
+ Group two or more existing canvas nodes by their asset IDs:
396
+
397
+ ```bash
398
+ oiioii workspace canvas group create <asset_id_1> <asset_id_2> \
399
+ --title "Story" \
400
+ --workspace-id <workspace_id> \
401
+ --idempotency-key group-request-1 \
402
+ --json
403
+ ```
404
+
405
+ The command rejects duplicate members and nodes that already belong to another
406
+ group. It changes group membership only: it does not move nodes, compute a
407
+ layout, or accept coordinates. Reuse an idempotency key only for the identical
408
+ workspace, member order, and title.
409
+
410
+ Update an existing empty node with explicit field options:
411
+
412
+ ```bash
413
+ oiioii workspace canvas node update <asset_id> \
414
+ --workspace-id <workspace_id> \
415
+ --prompt "Use @图片1: a cat looking through a rainy window" \
416
+ --model "Nano Pro" \
417
+ --variant "nano-banana-pro" \
418
+ --ratio "16:9" \
419
+ --quality high \
420
+ --reference 'hogi://image/<reference-id>' 'hogi://role_asset/<role-id>' \
421
+ --json
422
+ ```
423
+
424
+ `--model` and optional `--variant` resolve through the active model catalog;
425
+ `--model-id` selects the catalog row directly. Use `--clear-prompt`,
426
+ `--clear-model`, `--clear-ratio`, `--clear-duration`, `--clear-resolution`,
427
+ `--clear-quality`, or `--clear-references` for explicit clears. Omitted options
428
+ keep their existing values. The server accepts this operation only when the
429
+ global `enable_cli_empty_canvas_node_update` flag is enabled for the caller and
430
+ the current asset status is `empty`. URI, status, type, position, title, group,
431
+ and raw metadata updates are not accepted. Completed, loading, uploading, and
432
+ failed nodes are rejected.
433
+
434
+ Create, query, or search reusable library assets before generation:
280
435
 
281
436
  ```bash
437
+ oiioii library create role --name "Hero" --emo-image 'hogi://image/<expression-id>' --json
438
+ oiioii library create collection --name "Cast" --member 'hogi://role_asset/<id>' 'group:<id>' --json
439
+ oiioii library create scene --input ./scene.json --idempotency-key scene-import-001 --json
282
440
  oiioii library list role --limit 20 --json
441
+ oiioii library list collection --limit 20 --json
283
442
  oiioii library search role "球球" --limit 20 --json
443
+ oiioii library search collection "主要角色" --limit 20 --json
284
444
  oiioii library search scene "森林" --cursor '<next_cursor>' --json
445
+ oiioii library members <collection-id> --type role --keyword "主角" --limit 20 --json
446
+ oiioii library members <collection-id> --cursor '<next_cursor>' --json
447
+ oiioii library add-members <collection-id> 'hogi://role_asset/<id>' 'group:<id>' --json
448
+ oiioii library remove-members <collection-id> 'hogi://role_asset/<id>' 'group:<id>' --json
285
449
  ```
286
450
 
451
+ Collection list items use their `asset_id` as the stable identity and return
452
+ `asset_uri: null`. They include `member_count` without expanding the complete
453
+ member list. Use `next_cursor` with `--cursor` to continue pagination.
454
+ `library members` returns normalized role, scene, item, and group entries. Each
455
+ entry includes an `asset_ref` that can be passed directly to collection member
456
+ commands (`hogi://<type>_asset/<id>` or `group:<id>`).
457
+ `library remove-members` is idempotent and applies removals against the latest
458
+ Backend collection state instead of fetching and replacing the full member list
459
+ from the CLI.
460
+
287
461
  Use the returned `asset_uri` with `--asset`, or bind a prompt mention explicitly
288
462
  with `--bind <name=asset-uri>`. Explicit bindings avoid silently selecting the
289
463
  wrong asset when the library contains duplicate display names.
464
+ Reuse the returned `idempotency_key` when retrying an uncertain create request.
290
465
 
291
466
  Workspace resolution order is:
292
467
 
@@ -322,6 +497,13 @@ oiioii image edit \
322
497
  --json
323
498
  ```
324
499
 
500
+ For GPT Image 2, add `--transparent` to either `image text` or `image edit`
501
+ to request a transparent-background PNG. Other models reject this option.
502
+
503
+ ```bash
504
+ oiioii image text --prompt "an isolated sticker" --model gpt-image2 --transparent --json
505
+ ```
506
+
325
507
  Current behavior:
326
508
 
327
509
  - Accepts `--model-id <id>` from `inspect models` for exact backend model
@@ -481,6 +663,12 @@ record, and creates the terminal preview bundle. The CLI does not issue a second
481
663
  Upload image, video, or audio bytes:
482
664
 
483
665
  ```bash
666
+ # Pure resource upload for library/collection inputs; no workspace required
667
+ oiioii upload resource ./image.png --json
668
+ oiioii upload resource ./clip.mp4 --json
669
+ oiioii upload resource ./voice.mp3 --json
670
+
671
+ # Upload and attach to the active workspace
484
672
  oiioii upload file ./image.png --json
485
673
  oiioii upload file ./clip.mp4 --json
486
674
  oiioii upload file ./voice.mp3 --json
@@ -503,6 +691,11 @@ oiioii upload file ./voice.mp3 --after-asset-id <asset_id> --json
503
691
 
504
692
  Upload behavior:
505
693
 
694
+ - `upload resource` uploads small media through `POST /v1/res/uploadFile` and returns
695
+ only the reusable resource URI; it does not read or update a workspace.
696
+ - MOV files and videos of 10 MB or larger use the standalone VOD flow for
697
+ `upload resource`: `media_uploads/prepare` -> direct VOD upload -> `commit` -> `status`.
698
+ - `upload file` preserves the original workspace-bound behavior below.
506
699
  - Images, audio, and videos smaller than 10 MB use raw `application/octet-stream` bytes at
507
700
  `POST /v1/workspace/uploadAsset` with `workspace_id`, `file_type`, and optional
508
701
  `file_name` / `after_asset_id` query parameters.
@@ -523,7 +716,7 @@ Upload behavior:
523
716
  - `--attach` is retained as a no-op compatibility flag because uploads are now
524
717
  always attached.
525
718
  - A storage or workspace-write failure fails the upload command.
526
- - Arbitrary documents and URL uploads are outside the current scope.
719
+ - Arbitrary URL uploads are outside the current scope.
527
720
 
528
721
  Supported extensions:
529
722