@melius-ai/cli 0.16.1 → 0.46.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
@@ -74,12 +74,13 @@ The API key's team is auto-injected
74
74
  ### Canvases
75
75
 
76
76
  | Command | Description |
77
- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
78
- | `mel canvas create <projectId>` | Create a canvas (returns `id` for all subsequent commands) |
77
+ | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ |
78
+ | `mel canvas create <projectId>` | Create a canvas (returns `id` for all subsequent commands and `canvasUrl` to open it) |
79
79
  | `mel canvas list <projectId>` | List canvases in a project |
80
80
  | `mel canvas get <canvasId>` | Get canvas metadata |
81
81
  | `mel canvas content <canvasId>` | **Primary read** — returns live CRDT state; add `--node-id` and `--include-all-versions` to inspect one node plus its incident edges |
82
82
  | `mel canvas plan-layout <canvasId>` | Compute positions for planned nodes (read-only, no writes) |
83
+ | `mel canvas autoformat <canvasId>` | Tidy existing cards and sticky notes into a grid (`--node-ids` or `--group-id`), with optional `--columns <n | auto>`, `--column-gap`, `--row-gap`, `--group-padding` |
83
84
  | `mel canvas delete <canvasId>` | Delete a canvas and all its content |
84
85
 
85
86
  ### Nodes
@@ -91,6 +92,7 @@ All node mutations write directly to the CRDT document. Changes are synced to co
91
92
  | `mel node create <canvasId> --type <t>` | Add a node. Types: `text`, `image`, `video`, `file`, `group` |
92
93
  | `mel node bulk-create <canvasId> --json -` | Create multiple nodes + edges in one call |
93
94
  | `mel node update <canvasId> <nodeId>` | Update node fields (prompt, title, geometry, model) |
95
+ | `mel node bulk-update <canvasId> --nodes -` | Update up to 200 nodes in one call (same fields as `bulk-create`, plus `nodeId`) |
94
96
  | `mel node delete <canvasId> <nodeId>` | Remove a node and its orphaned edges |
95
97
  | `mel node get <canvasId> <nodeId>` | Legacy persisted-node read; prefer `mel canvas content <canvasId> --node-id <nodeId> --include-all-versions` for live inspection |
96
98
  | `mel node set-version <nodeId> --version-id <id>` | Switch the active output version |
@@ -106,9 +108,12 @@ All node mutations write directly to the CRDT document. Changes are synced to co
106
108
  --prompt <text> Text prompt (maps to textPrompt)
107
109
  --model <m> Model name (requires --variant)
108
110
  --variant <v> Model variant (requires --model)
111
+ --quality <q> Image quality ID from qualityOptions (requires --model and --variant). Omit for defaultQuality; affects credits
109
112
  --tier <t> Speed tier of that model+variant (fast, pro, turbo; requires --model and --variant). Omit for standard speed
110
113
  --aspect-ratio <r> 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21
111
114
  --duration <n> Output duration in seconds (video only)
115
+ --generate-audio Enable audio on a selected video model with supportsAudioToggle: true
116
+ --no-generate-audio Disable generated audio (ignored in Auto model mode)
112
117
  --x, --y, --w, --h Geometry (defaults per type: text 380x200, image 520x293)
113
118
  --z-index <n> Stacking order
114
119
  --group-id <uuid> Parent group
@@ -116,6 +121,35 @@ All node mutations write directly to the CRDT document. Changes are synced to co
116
121
 
117
122
  **Node update:** same options, all optional. Geometry must be updated as a complete set (`--x --y --w --h` together).
118
123
 
124
+ Audio settings persist for later single and bulk runs. Omitting both audio flags preserves the existing setting. Bulk-create JSON accepts `generateAudio: false` or `true`. Check `mel model list --category video` for `supportsAudioToggle` before selecting a model for silent generation.
125
+
126
+ ### Elements
127
+
128
+ Create reusable avatar, product, or general Elements from **1–10 existing image asset IDs**. Get IDs from `mel upload`, `mel asset search`, or generated image outputs in `mel canvas content`. Elements are currently in beta and must be enabled for your team. The same team access and image ownership checks apply as in the app.
129
+
130
+ | Command | Description |
131
+ | ------------------------------------------------------ | ------------------------------------------------------------------------------------- |
132
+ | `mel element avatars` | List available avatars; use `--scope team` or `--scope global` to separate them |
133
+ | `mel element add-avatar <avatarId> --kind <kind>` | Save a custom (team) or curated (global) avatar as a ready Element |
134
+ | `mel element create --asset-ids <ids...>` | Create an Element and start reference-image generation |
135
+ | `mel element list` | List the current team's Elements; supports `--limit` and `--offset` |
136
+ | `mel element get <elementId>` | Inspect versions, reference readiness, and generation errors |
137
+ | `mel element place <elementId> --canvas-id <canvasId>` | Place the ready default version, returning `nodeId`, `elementVersionId`, and `reused` |
138
+
139
+ ```bash
140
+ mel upload ./product.png
141
+ mel element create --asset-ids <assetId> --name "Hero product" --type product --guidelines "Keep the label legible"
142
+ mel element get <elementId>
143
+ # Once defaultVersion has status ready:
144
+ mel element place <elementId> --canvas-id <canvasId>
145
+ ```
146
+
147
+ Saved Elements belong to the team. Their `castAvatar.kind`, when present, records whether they came from a custom (team) or curated (global) avatar; a saved global copy is team-scoped with global origin.
148
+
149
+ Creation returns the Element immediately; its reference image can still be `pending`. Check `latestVersion.status` with `mel element get`; `failed` versions include `errorMessage`. Placement requires a ready default version. An omitted name is generated automatically; `--type` defaults to `product` and also accepts `avatar` or `general`.
150
+
151
+ Optional `--image-descriptions` accepts a JSON array of `{ "assetId": "<assetId>", "description": "Front view" }`. Avatar Elements also accept `--voice` JSON: `{ "kind": "stock", "catalog": "elevenlabs", "voiceId": "<voiceId>" }` or `{ "kind": "custom", "customVoiceId": "<customVoiceId>" }`. Discover stock voices with `mel audio voice list`. Names support up to 80 characters; guidelines and each image description support up to 2,000 characters.
152
+
119
153
  ### Edges
120
154
 
121
155
  | Command | Description |
@@ -126,8 +160,136 @@ All node mutations write directly to the CRDT document. Changes are synced to co
126
160
 
127
161
  Edge type determines data flow: `text` passes text output, `image` passes image output. ID is auto-generated if `--id` is omitted.
128
162
 
163
+ ### Cast script videos
164
+
165
+ Cast creates a video from a saved avatar and your script. Access and available settings depend on your team's plan and Cast rollout. Discover choices available to your API key before preparing:
166
+
167
+ ```bash
168
+ mel cast options
169
+ mel cast library --kind avatar
170
+ mel cast library --kind background
171
+ mel cast templates
172
+ mel cast templates --id <templateId>
173
+ mel audio voice list
174
+ ```
175
+
176
+ Save a request as `request.json`, using an exact avatar selector from the library:
177
+
178
+ ```json
179
+ {
180
+ "avatar": { "kind": "custom", "id": "<avatarId>" },
181
+ "sections": [
182
+ {
183
+ "text": "Welcome to our product demo.",
184
+ "action": "Smile at the camera",
185
+ "title": "Welcome"
186
+ }
187
+ ],
188
+ "engine": "seedance",
189
+ "aspectRatio": "9:16"
190
+ }
191
+ ```
192
+
193
+ `avatar` also accepts `{ "name": "Alice" }`; duplicate names require an exact selector. Omit `voice` to use the avatar's saved voice, or choose `{ "kind": "auto" }`, `{ "kind": "stock", "voiceId": "<voiceId>" }`, or `{ "kind": "custom", "customVoiceId": "<customVoiceId>" }`. Optional settings include `backgroundId`, `props` (1–4 items with `assetId` and optional `name`), `tone`, `resolution`, `subtitles`, and `creationSettings`. Use `mel cast options` for supported values. A template reference is `"scriptTemplate": { "id": "<templateId>", "revision": 1, "source": "database" }`; use the revision returned by `mel cast templates`. Scripts have 1–30 sections, each with `text` up to 5,000 characters, optional `action` up to 2,000, and optional `title` up to 200.
194
+
195
+ ```bash
196
+ # Validate and estimate without rendering; save the complete JSON response
197
+ mel cast prepare --input-file request.json > prepared.json
198
+
199
+ # Review status, choices and estimatedCredits in prepared.json before submitting
200
+ mel cast run --input-file prepared.json
201
+
202
+ # Use attemptId from prepared.json (also returned as generationId by run)
203
+ mel cast status --id <attemptId>
204
+ mel cast wait --id <attemptId> --timeout 60 --interval 3
205
+ mel cast result --id <attemptId>
206
+ mel cast download --id <attemptId> --output video.mp4
207
+ ```
208
+
209
+ `prepare` returns `status`, `attemptId`, normalized `input`, review labels, and estimated credits. `run` accepts only a complete `ready` preparation document; `invalid` and `estimate_unavailable` preparations cannot be submitted. The estimate does not reserve credits, guarantee a final price, or enforce a spending cap. The server checks access, balance and member limits when executing.
210
+
211
+ **After a lost submission response, reuse the same prepared file.** `mel cast run --input-file prepared.json` recovers that attempt; automatic retries also preserve its ID and input. Changed input under an accepted ID is a conflict. Preparing again creates a new attempt and requests a separate render when submitted. You can also use `mel cast wait --id <attemptId>` to recover accepted work directly.
212
+
213
+ States are `submitting`, `running`, `captioning`, `ready`, and `failed`. `status` and `result` each read once; `wait` polls for at most 60 seconds including requests, retries and sleeps, then exits `4` with recovery instructions. Timeout does not cancel rendering. Ready results include the exact `outputVersionId`, `assetId`, and `url`; a subtitle failure can return the original video with a `warning`. Download keeps these references and warnings, returns a signed URL, and optionally streams to a new local file. It never overwrites an existing file or forwards API credentials to the download host. Transfers have a five-minute total deadline and a 30-second network inactivity limit; failed transfers remove partial files, reporting any cleanup failure.
214
+
215
+ `mel cast library`, `templates`, and `history` print arrays to stdout and pagination metadata to stderr. Use `--page-size` (1–100), `--cursor <nextCursor>`, and optional `--include-count`. Default page sizes are 50, 25, and 24 respectively. History defaults to your generations; `mel cast history --scope team` includes authorized team history, and `--include-replacements` or `--operation replacement` includes Ditto jobs. Existing `mel ditto` and `mel cast replacement` commands remain available.
216
+
217
+ ### Ditto video replacement
218
+
219
+ Replace multiple characters, props, and backgrounds together in a supplied video with Melius Ditto. Each replacement has one reference image and an optional description identifying what to change. All replacements share one generation, quote, attempt ID, and finalized output. These commands use the same access rules, model eligibility, pricing, and finalized results as Cast. They do not require a canvas, script, or saved avatar. Scripts written against `mel cast replacement` keep working; it runs the same commands.
220
+
221
+ ```bash
222
+ # Upload a supplied source and each reference, or reuse authorized asset IDs
223
+ mel ditto upload <video.mp4> --role source
224
+ mel ditto upload <character.png> --role reference
225
+ mel ditto upload <prop.png> --role reference
226
+ mel ditto upload <background.png> --role reference
227
+
228
+ # Review eligibility and price without starting a generation
229
+ mel ditto prepare --input-file <input.json> > <review.json>
230
+ mel ditto prepare --input '{"sourceAssetId":"<sourceAssetId>","replacements":[{"referenceAssetId":"<characterAssetId>","targetKind":"character"},{"referenceAssetId":"<propAssetId>","targetKind":"prop"},{"referenceAssetId":"<backgroundAssetId>","targetKind":"background"}]}'
231
+
232
+ # Save the normalized input from the review and submit its exact quoted attempt
233
+ jq '.input' <review.json> > <normalized-input.json>
234
+ mel ditto run --input-file <normalized-input.json> --attempt-id <attemptId> --quote-id <quoteId>
235
+ mel ditto run --input-file <normalized-input.json> --attempt-id <attemptId> --quote-id <quoteId> --max-credits 500
236
+
237
+ # Recover accepted work and wait in bounded intervals
238
+ mel ditto status <generationId>
239
+ mel ditto status <generationId> --fields generationId,status,url
240
+ mel ditto wait <generationId>
241
+ mel ditto wait <generationId> --timeout 30 --interval 5
242
+
243
+ # Inspect and download only the finalized result
244
+ mel ditto result <generationId>
245
+ mel ditto result <generationId> --fields status,videoUrl
246
+ mel ditto download <generationId>
247
+ mel ditto download <generationId> --fields url
248
+ ```
249
+
250
+ Replacement input JSON:
251
+
252
+ ```json
253
+ {
254
+ "sourceAssetId": "<sourceAssetId>",
255
+ "replacements": [
256
+ {
257
+ "referenceAssetId": "<characterAssetId>",
258
+ "targetKind": "character",
259
+ "targetDescription": "The person on the left"
260
+ },
261
+ {
262
+ "referenceAssetId": "<propAssetId>",
263
+ "targetKind": "prop",
264
+ "targetDescription": "The mug held in the right hand"
265
+ },
266
+ {
267
+ "referenceAssetId": "<backgroundAssetId>",
268
+ "targetKind": "background"
269
+ }
270
+ ],
271
+ "additionalInstructions": "Preserve the lighting",
272
+ "sourceRange": { "startMs": 12000, "endMs": 30000 },
273
+ "audioMode": "original"
274
+ }
275
+ ```
276
+
277
+ `replacements` contains 1–30 ordered items. Each item's `targetKind` is `character`, `prop`, or `background`; multiple items may have the same kind. Targeting text is optional per item, while `additionalInstructions` applies to the whole edit. Omit `sourceRange` to use the entire source; otherwise provide both endpoints in milliseconds. The source is never silently shortened. Optional `modelId` honors the specified model; `resolution` is `480p`, `720p`, or `1080p`, subject to model eligibility. `audioMode` is `original` (default) or `mute`.
278
+
279
+ Seedance 2.5 accepts up to 30 replacement images. A model must support both the selected duration and every reference. Unsupported models stay visible with reasons; items are never dropped or split into separate paid generations. Legacy single-item JSON with top-level `referenceAssetId`, `targetKind`, and optional `targetDescription` is still accepted. Do not combine those legacy fields with `replacements`.
280
+
281
+ `prepare` returns `{ attemptId, input, sourceDurationMs, selectedDurationMs, models, quote }`. Ineligible models remain in `models` with structured reasons. A missing quote means the input must be corrected before running. Save the returned `attemptId`, normalized `input`, and `quote.id`.
282
+
283
+ `run` starts paid work and returns `{ generationId, status, url, ... }`. After a lost response, replay the **identical** input with the **same** attempt ID and quote ID. The submission transport does not automatically retry. Creating a new attempt ID requests another paid result. A maximum-credit budget is enforced by the server.
284
+
285
+ If a failed result returns `canRetryFinalization: true`, its `retryCommand` is ready to paste into a POSIX shell such as bash or zsh (`retryCommandShell: "posix"`). Do not paste that string into PowerShell or cmd.exe. For cross-platform automation, use `retryArgv`: its first element is the executable (`mel`) and the remaining elements are literal arguments. Pass them directly through an argument-array process API without a shell; do not join or quote them. Both forms contain the exact accepted input, attempt ID, and retry quote, so recovery also works after reopening the CLI. The `--retry-finalization` flag reuses the rendered video; it does not pay for another generation.
286
+
287
+ States are `preparing`, `rendering`, `finalizing`, `ready`, and `failed`. `wait` allows up to 60 seconds per call and exits `4` on timeout; repeat it with the same generation ID to resume. Timeout does not cancel or resubmit work. `result` exposes output fields only after finalization. `download` returns `{ generationId, assetId, url, filename, castUrl }` for the exact ready output; it refreshes the authorized signed URL rather than writing a local file.
288
+
129
289
  ### Runs (single node)
130
290
 
291
+ `mel run start <nodeId> --canvas-id <canvasId> --no-generate-audio` disables audio for that generation. Use `--generate-audio` to enable it, or omit both flags to inherit the saved node setting when using the node's saved model. When overriding the model, pass the desired audio flag explicitly. These flags do not mute an existing video.
292
+
131
293
  | Command | Description |
132
294
  | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
133
295
  | `mel run start <nodeId> --canvas-id <canvasId>` | Start a generation. Returns `{ id }` |
@@ -138,10 +300,14 @@ Edge type determines data flow: `text` passes text output, `image` passes image
138
300
  | `mel run download <runId>` | Presigned ZIP URL for a finished run's output |
139
301
  | `mel run magic-resize <sourceNodeId> --canvas-id <canvasId> --ratios <list>` | Resize an image into multiple aspect ratios in one call. Returns `{ nodeId, nodeRunId, creditCost }` |
140
302
 
303
+ **Image Angles (Beta):** requires the `angles-node` feature and editor access. `mel run angles <canvasId> <sourceNodeId> --angles '[{"rotationDeg":37,"tiltDeg":12}]' --request-key <key>` generates one independent Qwen Angle node per pair. Use `mel angle quote` with the same canvas, source and `--angles` to estimate credits. The response includes `nodeId`, `nodeRunId`, `creditCost`, and `results` for batches; wait on each `nodeRunId` with `mel run wait`. Reuse the same request key and input after a transport failure. `mel angle regenerate` creates a new version; `mel angle retry` reuses the failed run's saved source, model and settings. Run each command with `--help` for examples.
304
+
141
305
  **Magic resize:** `mel run magic-resize` creates a magic-resize node, wires the source image in, and runs it — all in one call. The source node must already have a finished image asset. `--ratios` is comma-separated (1–5): presets `21:9, 16:9, 4:3, 1:1, 3:4, 9:16, 9:21` render at 1K, or pass custom `WxH` pixel sizes (each side 64–4096, e.g. `1080x1350`). Pass the returned `nodeId` to `mel run wait` to block until the variants are ready.
142
306
 
143
307
  **Node tools:** `mel run tool` post-processes a node's finished asset in place and creates a new active version. The currently supported tool is `remove-background` for image and image-backed file nodes. Pass the returned run ID to `mel run wait` before inspecting the result with `mel canvas content <canvasId> --node-id <nodeId> --include-all-versions`.
144
308
 
309
+ **Image quality:** `mel node create`, `mel node update`, and `mel run start` accept `--quality` with `--model` and `--variant`. Use a `qualityOptions` ID from `mel model list --category image`, such as `max` for GPT Image 2.5. Bulk-create JSON accepts `quality` on each node. Omitting it uses the model's default quality; a run without model overrides keeps the node's saved settings. Quality changes the credit quote. `--auto` cannot be combined with `--quality`.
310
+
145
311
  **Speed tiers:** a model can serve the same variant at more than one speed, and a speed word attached to a model names a tier rather than a separate model — "Wan 3.0 Fast" is `--model wan-3.0 --variant text-to-video --tier fast`. Each variant's `tier` comes from `mel model list`, and tiers can be priced differently from the standard speed.
146
312
 
147
313
  **Auto-model resolution:** when `--model`/`--variant` are omitted, `mel run start` automatically resolves the correct model from the platform defaults. `--canvas-id` is required so the CLI can verify the node is on the canvas and the backend can do edge-aware detection (picks `image-to-image` when the node has incoming image edges). Always source the node ID from the latest `mel canvas content` output or the current-turn `idMap` returned by `mel node bulk-create`.
@@ -163,6 +329,46 @@ mel run start <nodeId> --canvas-id <canvasId> --prompt "Override prompt" --varia
163
329
  mel run tool <imageNodeId> --canvas-id <canvasId> --tool remove-background
164
330
  ```
165
331
 
332
+ ### Recover a submission
333
+
334
+ `run start`, `run tool`, `run magic-resize` and `bulk-run start` accept
335
+ `--idempotency-key <key>`. Omit it to create a fresh key for a new intended run.
336
+ Retain a supplied key across processes and reuse it only with identical input.
337
+ Changing input with the same accepted key returns `IDEMPOTENCY_KEY_REUSED`; the
338
+ CLI never replaces that key to force a submission through.
339
+
340
+ Before sending, the CLI saves an owner-only receipt under `~/.mel/receipts/` and
341
+ writes a JSON `submission_receipt` record to stderr with `receipt`,
342
+ `idempotencyKey` and a `retry` command array. Success JSON on stdout stays unchanged.
343
+ If a connection drops or the server returns `5xx`, use the saved receipt:
344
+
345
+ ```bash
346
+ mel run retry <receipt>
347
+ ```
348
+
349
+ This explicitly resends the exact resolved route, params and body with the same
350
+ key. It preserves expanded bulk node IDs, free-generation selection and authorized
351
+ partial-run decisions instead of rereading the canvas. The API returns the
352
+ original run or approval response; poll that ID for current progress. A failed
353
+ generation is not restarted. `IDEMPOTENCY_REQUEST_IN_PROGRESS` preserves
354
+ `retryAfterSeconds`: wait that long before explicitly replaying the receipt.
355
+
356
+ Recovery requires the original server URL, team selector and API key. Receipts
357
+ store a one-way credential fingerprint, not credentials, and reject a changed
358
+ context, including a rotated key. They contain request data such as prompts and
359
+ asset URLs: keep them private. Delete receipts only when you no longer need their
360
+ recovery reference. An insufficient-credit `describe` request has a changed body
361
+ and gets its own receipt and key; it is not a retry of the original submission.
362
+
363
+ These commands add no automatic network or `5xx` retries. Existing `429` handling
364
+ remains. Older or custom servers can ignore the header: confirm server support
365
+ before an explicit replay. Cast and Ditto keep their existing `attemptId` recovery;
366
+ other media routes and canvas setup mutations are outside this receipt workflow.
367
+
368
+ Release order: deploy the idempotency API fully, then publish the CLI by merging
369
+ its release PR and roll out hosted MCP. Merging the client source PR alone does
370
+ not publish a CLI version.
371
+
166
372
  ### Bulk runs (entire canvas)
167
373
 
168
374
  | Command | Description |
@@ -182,12 +388,18 @@ mel bulk-run start <canvasId> --wait
182
388
  # Run specific nodes only
183
389
  mel bulk-run start <canvasId> --node-ids <id1>,<id2>,<id3>
184
390
 
391
+ # Credits cover only part of the run (a CREDIT_SHORTFALL error): run the nodes that fit
392
+ mel bulk-run start <canvasId> --run-affordable --wait
393
+
185
394
  # Start without blocking, then check later
186
395
  mel bulk-run start <canvasId>
187
396
  mel bulk-run get <bulkRunId>
188
397
  mel bulk-run wait <bulkRunId> --timeout 120
189
398
 
190
399
  # Get per-node status
400
+ # With run-input-provenance enabled, read selected outputs' recorded inputs
401
+ mel bulk-run get <bulkRunId> --include-inputs --node-ids <id1>,<id2>
402
+
191
403
  mel bulk-run get <bulkRunId> --fields status,completedNodes,failedNodes,skippedNodes
192
404
 
193
405
  # Download leaf node outputs as ZIP after completion
@@ -217,7 +429,7 @@ mel bulk-run start <canvasId> --wait
217
429
 
218
430
  ### Templates
219
431
 
220
- Templates are reusable workflows applied server-side as collapsed boxes. Listing includes global templates and templates scoped to the current team. The CLI exposes only template metadata, declared ports, and the applied box IDs; internal workflow nodes and configuration stay private.
432
+ Templates are reusable workflows applied server-side as collapsed boxes. Listing includes the global templates offered on the canvas and templates scoped to the current team. The CLI exposes only template metadata, declared ports, and the applied box IDs; internal workflow nodes and configuration stay private.
221
433
 
222
434
  | Command | Description |
223
435
  | -------------------------------------------- | ------------------------------------------------------------------------ |
@@ -296,6 +508,7 @@ Use a `familyName` from `mel font list` with the `better-font-32b` image model b
296
508
  | `mel upload <filePath>` | Upload a local image to Melius |
297
509
  | `mel upload <filePath> --node-id <id>` | Upload and associate with an existing node |
298
510
  | `mel upload <filePath> --canvas-id <id>` | Upload and associate with a canvas |
511
+ | `mel upload <filePath> --tags <a,b>` | Upload and tag the file in Assets |
299
512
 
300
513
  Supported formats: PNG, JPEG, GIF, WebP, AVIF.
301
514
 
@@ -305,6 +518,9 @@ Returns `{ assetId, s3Bucket, s3Key, url }`. Without `--node-id`, the image is s
305
518
  # Upload a standalone asset to the Files/DAM library
306
519
  mel upload ./photo.png
307
520
 
521
+ # Upload and tag it; a tag name the team does not have yet is created
522
+ mel upload ./photo.png --tags brand,hero
523
+
308
524
  # Upload and attach to an existing file node
309
525
  mel upload ./photo.png --node-id <nodeId> --canvas-id <canvasId>
310
526
  ```
@@ -319,7 +535,7 @@ Requires the Pro or Enterprise plan.
319
535
  | `mel asset folders` | List the library's folders (`id`, `name`, `path`, `fileCount`) so you can resolve a folder name to an id for `--folder-id` |
320
536
  | `mel asset place <canvasId> <assetIds...>` | Place existing library assets onto a canvas by id — references the **original** asset (no duplicate) |
321
537
 
322
- `mel asset search` searches by meaning (semantic), with exact filename/title matches ranked first, so query with a filename or a description of the content. Pass an exact filename verbatim, including its extension. It returns `{ query, total, results: [{ assetId, filename, fileType, previewUrl, ... }] }`. Filter by origin with `--source <upload|generated>`, by media type with `--file-type <image|video|audio|pdf|text>`, and by page size with `--limit <1-20>`; page deeper with `--offset <n>` (skip the first N matches — page until the running count reaches `total`); scope to one canvas with `--canvas-id` (omit to search the whole team library).
538
+ `mel asset search` searches by meaning (semantic), with exact filename/title matches ranked first, so query with a filename or a description of the content. Pass an exact filename verbatim, including its extension. It returns `{ query, total, results: [{ assetId, filename, fileType, previewUrl, ... }], hasMore, nextCursor }`. Filter by origin with `--source <upload|generated>`, by media type with `--file-type <image|video|audio|pdf|text>`, and by page size with `--limit <1-20>`; while `hasMore` is true, pass `nextCursor` to `--cursor` with the same query and filters for the next page (`--offset <n>` also skips the first N matches); scope to one canvas with `--canvas-id` (omit to search the whole team library). Every filter applies together. `total` is the full match count, except for a search by meaning, where it counts the results through this page plus one while more remain.
323
539
 
324
540
  Scope to a **folder** with `--folder-id` (from `mel asset folders`): with a query it filters within that folder and its subfolders; **omit the query** to bring in the _whole_ folder (every asset in it). `mel asset folders` returns each folder's root-relative `path` (e.g. `Brand / Logos`) to disambiguate same-named folders.
325
541
 
@@ -374,6 +590,8 @@ mel canvas content <canvasId>
374
590
  # 3. Discover models
375
591
  mel model list --category image
376
592
  mel model defaults
593
+ # Check a complete image request when Auto capability discovery is enabled
594
+ mel model defaults --image-aspect-ratio 4:5 --image-resolution 4k --image-input-count 3
377
595
 
378
596
  # 4a. Build a generation pipeline from scratch
379
597
  TEXT=$(mel node create <canvasId> --type text --prompt "Describe a product photo")
@@ -399,8 +617,10 @@ mel bulk-run start <canvasId> --wait
399
617
  # 6. Inspect results
400
618
  mel canvas content <canvasId> --node-id $(echo $IMAGE | jq -r .id) --include-all-versions
401
619
 
402
- # 7. Organize — group related nodes together
403
- mel node group <canvasId> --node-ids <id1>,<id2>,<id3> --label "Hero section"
620
+ # 7. Organize — group related nodes together (nodes already in one group get a nested group)
621
+ mel node group <canvasId> --node-ids <id1>,<id2>,<id3> --label "Hero section" --color blue
622
+ # Take one node back out of its group, keeping its place on the canvas
623
+ mel node update <canvasId> <id3> --ungroup
404
624
 
405
625
  # 8. Leave feedback
406
626
  mel comment create <canvasId> --body "Generation complete" --x 0 --y 0
@@ -441,7 +661,9 @@ Every error includes a machine-readable `code`, a human-readable `message`, and
441
661
 
442
662
  ### Rate limiting
443
663
 
444
- There is no monthly request quota on any plan, but a burst of requests can still be rate limited. On a `429` the CLI prints a `Rate limited — waiting Ns…` notice to **stderr** and automatically backs off and retries — honoring the `Retry-After` header, otherwise exponential backoff — so polling commands like `mel run wait` ride through a limit instead of failing. stdout stays clean for parsing. After repeated `429`s it gives up with a structured `RATE_LIMITED` error (exit `1`).
664
+ There is no monthly request quota on any plan, but a burst of requests can still be rate limited. Most commands print a `Rate limited — waiting Ns…` notice to **stderr** on `429` and automatically retry — honoring `Retry-After`, otherwise exponential backoff. After repeated `429`s they return a structured `RATE_LIMITED` error (exit `1`). Paid Ditto replacement submissions do not automatically retry.
665
+
666
+ Cast script-video commands use at most three attempts for network failures, timeouts, `429`, and server errors. Their retry notices are JSON on stderr, with a 95-second overall request deadline and a 30-second per-attempt deadline. `wait` uses its shorter overall deadline. `Retry-After` is capped at 60 seconds and the remaining deadline. Submission retries reuse the saved attempt ID; authentication, validation and conflict errors are not retried. Exhausted network failures exit `5`, and timeouts exit `4`, with the attempt ID and recovery command where available. stdout stays clean for parsing.
445
667
 
446
668
  ### Global flags
447
669
 
@@ -456,3 +678,50 @@ There is no monthly request quota on any plan, but a burst of requests can still
456
678
  ## How it works
457
679
 
458
680
  The CLI is a thin, stateless wrapper around the Melius REST API. Node and edge mutations write directly to the CRDT document via the backend's direct mutation service — changes sync to connected browser clients in real-time via WebSocket.
681
+
682
+ ## Sticky notes
683
+
684
+ `mel canvas content <canvasId>` includes a `notes` array with note text, color, geometry and group membership. Use `--note-id <noteId>` to inspect one note, or `--note-offset 0` to read notes in pages of 50; continue with `nextNoteOffset` until it is null. Positions are relative to the parent group when `groupId` is set.
685
+
686
+ ```bash
687
+ mel note create <canvasId> --body "Alex" --color blue --font-size large --x 0 --y -120 --width 1500 --height 120
688
+ mel note update <canvasId> <noteId> --color purple
689
+ mel note update <canvasId> <noteId> --body "Alex — character sheets" --height 320
690
+ mel note update <canvasId> <noteId> --font-size auto --wrap-width 180 --group-id <groupId>
691
+ mel note update <canvasId> <noteId> --clear-wrap-width --ungroup
692
+ mel canvas content <canvasId> --note-id <noteId>
693
+ mel note delete <canvasId> <noteId>
694
+ ```
695
+
696
+ Choose `--font-size auto|small|medium|large|xl` on create or update. New notes default to `medium`. Updates preserve the saved font size when you omit the option. Auto notes keep their on-screen size as you zoom. Their positive `--width` and `--height` values seed the initial measurement; the app remeasures them to fit content. Auto height always follows content.
697
+
698
+ Use `--wrap-width <pixels>` to persist an Auto note's wrapping width. The value must be finite and at least 48 screen pixels. Use `--clear-wrap-width` to restore content-fitting width; these two flags are mutually exclusive. Omitting both preserves the saved value on update.
699
+
700
+ Use `--group-id <uuid>` to assign a note to a group from `mel canvas content`, or `--ungroup` to place it at the canvas root. These flags are mutually exclusive. New notes default to the root; updates preserve the group when both are omitted. Changing the group preserves each omitted coordinate's absolute canvas position. Supplied `--x` and `--y` are relative to the new group, or the canvas root when ungrouped.
701
+
702
+ For fixed font sizes (`small`, `medium`, `large`, `xl`), `--width` (minimum 240) and `--height` (120–960) are set separately in canvas units. Values outside these bounds are clamped. Widths such as 1500 are supported, so a short wide note works as a label bar. Text stays at its chosen size when the note is resized; long text scrolls inside the note. A side stored outside its range keeps its size until that flag changes it. Switching from `auto` to a fixed font size resets each omitted dimension to 320 canvas units and clamps any supplied dimensions to the fixed-size bounds.
703
+
704
+ Create and update return the saved note, including its `color`, `fontSize`, `wrapWidth` and `groupId`. Choose `--color yellow|pink|blue|green|purple`; new notes default to yellow, and updates preserve omitted fields. Delete returns `{ "message": "Deleted", "noteId": "<note-id>" }`. All three write commands require editor access.
705
+
706
+ To switch an existing image or video back to Auto, run `mel node update <canvasId> <nodeId> --auto`. Omitting model options preserves its saved model.
707
+
708
+ ### Replace a shot
709
+
710
+ `mel stitch get <canvasId> <stitchNodeId>` returns the saved edit revision and its list indexes or timeline clip IDs. Pass that revision and exactly one slot to `mel stitch clip-replace`. The new take must cover the existing duration. Other shots and audio tracks stay as saved, and the response identifies a wired recovery copy.
711
+
712
+ ```sh
713
+ mel stitch clip-replace <canvasId> <stitchNodeId> --revision <revision> --source <oldNodeId> --replacement <newNodeId> --index 2
714
+ mel stitch clip-replace <canvasId> <stitchNodeId> --revision <revision> --source <oldNodeId> --replacement <newNodeId> --clip-id <clipId> --on-duplicate
715
+ ```
716
+
717
+ A saved edit is not a rendered video. Run the returned `nodeId` when ready to render.
718
+
719
+ ### Custom text presentation
720
+
721
+ Use `--text-view raw` or `--text-view markdown` on `mel node create`, `mel node update`, or `mel node set-text`. Bulk node payloads accept `textView`. A view-only update preserves the source text:
722
+
723
+ ```sh
724
+ mel node update <canvasId> <nodeId> --text-view markdown
725
+ ```
726
+
727
+ New custom text defaults to Raw. Omitting the option on an update preserves the saved choice. Markdown preview availability follows the canvas rollout; source text and generation inputs are unchanged.
package/dist/bin/mel.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  printUpgradeNoticeIfNeeded,
8
8
  withDefaultHelp,
9
9
  writeError
10
- } from "../chunk-II5TPJQQ.js";
10
+ } from "../chunk-HF2PL2BN.js";
11
11
 
12
12
  // bin/mel.ts
13
13
  var program = createProgram();