@oiioii/cli 0.1.5 → 0.1.7

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 +66 -14
  2. package/dist/cli.js +32 -31
  3. package/package.json +11 -2
package/README.md CHANGED
@@ -13,8 +13,11 @@ human-readable output and a stable JSON envelope for AI agents and automation.
13
13
  | Command | Capability | Status |
14
14
  |---|---|---|
15
15
  | `auth login` | Browser authorization for terminal/Codex/WorkBuddy/Kimi/Claude Code/DeepSeek, or explicit API Key persistence | Implemented |
16
+ | `auth status` | Check configured authentication without exposing the API Key | Implemented |
17
+ | `auth logout` | Remove locally persisted authentication without exposing the API Key | Implemented |
16
18
  | `workspace create/set/current/rename` | Create, configure, inspect, and rename workspaces | Implemented |
17
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 |
18
21
  | `image text` | Text-to-image generation | Implemented |
19
22
  | `image edit` | Image-to-image editing | Implemented |
20
23
  | `video text` | Text-to-video generation | Implemented |
@@ -32,14 +35,14 @@ human-readable output and a stable JSON envelope for AI agents and automation.
32
35
  Important current limitations:
33
36
 
34
37
  - API keys are stored in `~/.oiioii/config.json` after `oiioii auth login`; the file is owner-readable only (`0600`).
35
- - Generation submits `submit_async_media_generation` and returns immediately with the authoritative backend `task_id` plus a `local_task_id`.
38
+ - Generation submits `POST /v1/media/generations` by default and returns immediately with the authoritative backend `task_id` plus a `local_task_id`.
36
39
  - The backend task ID, workspace, media type, asset ID, progress, and terminal outputs are cached in the owner-only local task store.
37
- - `task status/wait` query `query_async_media_generation` for non-terminal cached tasks and accept either the backend or local task ID.
40
+ - `task status/wait` query the stored task transport for non-terminal cached tasks and accept either the backend or local task ID.
38
41
  - If submission times out or disconnects before the backend task ID is received, the task remains `submitting`; `task retry <local_task_id>` resends the saved request with the original idempotency key.
39
42
  - 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.
40
43
  - Image, video, and audio generation create local preview bundles after a queried task reaches a terminal state.
41
44
  - `inspect capabilities` is local metadata; `inspect models` requires authentication and queries the active backend.
42
- - Asset search/update/delete and style-library commands are not available. Workspace-scoped asset listing and download are available.
45
+ - Asset-library update/delete and style-library commands are not available. Reusable asset query/search and workspace-scoped asset listing/download are available.
43
46
 
44
47
  ## Requirements
45
48
 
@@ -208,6 +211,23 @@ The CLI writes the API Key to `~/.oiioii/config.json` with file permissions
208
211
  `OIIOII_API_KEY` remains available as a temporary process override. A legacy
209
212
  `~/.oiioii/credentials.json` file, if present, is ignored.
210
213
 
214
+ Check whether the current process is authenticated, or remove the locally
215
+ persisted API Key:
216
+
217
+ ```bash
218
+ oiioii auth status
219
+ oiioii auth logout
220
+ ```
221
+
222
+ Neither command prints the API Key. `auth status` exits with status `0` when an
223
+ API Key is configured for the current process and `1` when unauthenticated. It identifies only whether
224
+ the credential comes from local configuration or `OIIOII_API_KEY`. `auth logout`
225
+ is idempotent and preserves unrelated settings such as the Base URL and active
226
+ workspace. It cannot unset an inherited `OIIOII_API_KEY`; when that override is
227
+ present, the command reports that effective authentication remains active. If
228
+ the local config is unreadable, logout removes that unusable file so credential
229
+ fragments cannot remain on disk.
230
+
211
231
  Remove an existing backend override and return to the default embedded in the
212
232
  current CLI build:
213
233
 
@@ -256,6 +276,18 @@ oiioii workspace assets download <asset_id> --output ./downloads --json
256
276
  identity to the asset's downloadable `uri`; loading, uploading, empty, failed,
257
277
  or URI-less assets fail before the download request.
258
278
 
279
+ Query or search reusable library assets before generation:
280
+
281
+ ```bash
282
+ oiioii library list role --limit 20 --json
283
+ oiioii library search role "球球" --limit 20 --json
284
+ oiioii library search scene "森林" --cursor '<next_cursor>' --json
285
+ ```
286
+
287
+ Use the returned `asset_uri` with `--asset`, or bind a prompt mention explicitly
288
+ with `--bind <name=asset-uri>`. Explicit bindings avoid silently selecting the
289
+ wrong asset when the library contains duplicate display names.
290
+
259
291
  Workspace resolution order is:
260
292
 
261
293
  1. Root `--workspace <id>` option.
@@ -272,6 +304,11 @@ oiioii image text \
272
304
  --model seedream45 \
273
305
  --resolution 2K \
274
306
  --json
307
+
308
+ oiioii image text \
309
+ --prompt "让@球球坐在窗边" \
310
+ --bind 球球=hogi://role_asset/<role_id> \
311
+ --json
275
312
  ```
276
313
 
277
314
  Image editing:
@@ -289,11 +326,11 @@ Current behavior:
289
326
 
290
327
  - Accepts `--model-id <id>` from `inspect models` for exact backend model
291
328
  selection, or `--model <key> --variant <variant>` as an alternative.
292
- - Calls `POST /mcp/genai/sse` with JSON-RPC `tools/call` and `submit_async_media_generation`.
329
+ - Calls `POST /v1/media/generations` with Bearer authentication and an idempotency header.
293
330
  - Authenticates with `x-hogi-api-key`.
294
331
  - Requires an active workspace.
295
332
  - Returns after submission; use `task status` or `task wait` to query progress and terminal `hogi://image/...` output.
296
- - Image editing adapts the source URI to the async service's `referenceImages` contract.
333
+ - Image editing sends the source URI through the structured `references` contract.
297
334
  - When image shape options are omitted, the CLI uses the exact selected model
298
335
  catalog row's first aspect ratio and resolution (falling back only when the
299
336
  catalog leaves those fields empty).
@@ -340,6 +377,13 @@ oiioii video generate \
340
377
  --duration 8 \
341
378
  --resolution 720p \
342
379
  --json
380
+
381
+ oiioii video generate \
382
+ --prompt "小猫跳舞@球球" \
383
+ --bind 球球=hogi://role_asset/<role_id> \
384
+ --asset hogi://scene_asset/<scene_id> \
385
+ --model seedance25 \
386
+ --json
343
387
  ```
344
388
 
345
389
  When video duration, aspect ratio, or resolution is omitted, the CLI resolves
@@ -351,15 +395,20 @@ Current behavior:
351
395
 
352
396
  - Accepts `--model-id <id>` from `inspect models` for exact backend model
353
397
  selection, or `--model <key> --variant <variant>` as an alternative.
354
- - Calls `submit_async_media_generation` through `/mcp/genai/sse` with `x-hogi-api-key` authentication.
398
+ - Calls `POST /v1/media/generations` with Bearer authentication.
355
399
  - Returns after submission; terminal video URI validation happens during `task status/wait`.
356
400
  - Text-to-video sends `prompt`, `duration`, `aspectRatio`, `resolution`, and
357
401
  `workspace_id`.
358
- - Model-specific `imageUrl`/`images` fields are validated locally, then adapted
359
- to the async service's `referenceImages` field with `generateMode` preserved.
402
+ - Model-specific reference fields are validated locally, then sent through the
403
+ structured OpenAPI `references` list with `generateMode` preserved.
360
404
  - `video generate` accepts zero or more `--image`, `--video`, and `--audio`
361
405
  references in the same request. `--mode auto` derives `text2Video` or
362
406
  `omni2Video`; frame semantics can be selected explicitly with `--mode`.
407
+ - Seedance 2.5 omni requests accept `--task-type reference|edit|extend`.
408
+ - `--asset` adds role/scene/item assets as visual references. `--bind` also
409
+ rewrites an exact `@name` occurrence to `[Role:<id>]`, `[Scene:<id>]`, or
410
+ `[Item:<id>]`. Workspace-asset references use OpenAPI so the backend can apply
411
+ visibility checks, main-image resolution, and Seedance role head-combo selection.
363
412
  - Reference fields, combinations, and limits are validated against an exact
364
413
  backend-tool contract before MCP submission. The current mixed-input matrix is:
365
414
  Seedance 2.0/2.5 (image + video + audio), MiniMax H3
@@ -414,17 +463,16 @@ unbounded automated loops, and do not retry failures blindly.
414
463
 
415
464
  ## Async Generation and Workspace Assets
416
465
 
417
- Image, video, and audio commands submit through:
466
+ Image, video, and audio commands submit through OpenAPI by default:
418
467
 
419
468
  ```text
420
- POST /mcp/genai/sse
421
- method: tools/call
422
- name: submit_async_media_generation
469
+ POST /v1/media/generations
470
+ GET /v1/media/generations/:task_id
423
471
  ```
424
472
 
425
473
  The backend creates the loading workspace asset and returns its `assetId` and
426
- authoritative `taskId`. The CLI caches both IDs. `task status/wait` calls
427
- `query_async_media_generation`, reconciles progress/error/output into the local
474
+ authoritative `taskId`. The CLI caches both IDs and the selected transport.
475
+ `task status/wait` queries the same transport, reconciles progress/error/output into the local
428
476
  record, and creates the terminal preview bundle. The CLI does not issue a second
429
477
  `create_asset` call, which avoids duplicate workspace assets.
430
478
 
@@ -897,6 +945,10 @@ Environment variables:
897
945
  |---|---|
898
946
  | `OIIOII_CONFIG_DIR` | Override the local configuration directory |
899
947
  | `OIIOII_BASE_URL` | Override the backend URL at runtime |
948
+ | `OIIOII_GENERATION_TRANSPORT` | Select `openapi` (default) or the `mcp` rollback transport |
949
+
950
+ The MCP rollback transport preserves the legacy media-reference payload. Prompt
951
+ references to role, scene, or item workspace assets require the default OpenAPI transport.
900
952
  | `OIIOII_WORKSPACE_ID` | Override the active workspace |
901
953
  | `OIIOII_BUILD_ENV` | Select `production`, `test`, or `local` while building |
902
954
  | `OIIOII_PRODUCTION_BASE_URL` | Optional override for the production build's canonical backend URL |