@mux/cli 1.0.0-beta.7 → 1.0.0-beta.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 (2) hide show
  1. package/README.md +432 -893
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -5,41 +5,23 @@ A command-line interface for interacting with the Mux API, designed to provide a
5
5
  ## Table of Contents
6
6
 
7
7
  - [Installation](#installation)
8
- - [Install via npm](#install-via-npm)
9
- - [Shell installer](#shell-installer)
10
- - [Download the binary](#download-the-binary)
8
+ - [Shell Completions](#shell-completions)
11
9
  - [Getting Started](#getting-started)
12
- - [Authentication](#authentication)
10
+ - [Common Options](#common-options)
13
11
  - [Commands](#commands)
14
12
  - [Asset Management](#asset-management)
15
- - [Create Assets](#mux-assets-create)
16
- - [List Assets](#mux-assets-list)
17
- - [Get Asset](#mux-assets-get-asset-id)
18
- - [Update Asset](#mux-assets-update-asset-id)
19
- - [Delete Asset](#mux-assets-delete-asset-id)
20
- - [Interactive Management](#mux-assets-manage)
21
- - [Playback ID Management](#playback-id-management)
22
- - [Static Renditions Management](#static-renditions-management)
23
13
  - [Live Stream Management](#live-stream-management)
24
- - [Create Live Stream](#mux-live-create)
25
- - [List Live Streams](#mux-live-list)
26
- - [Get Live Stream](#mux-live-get-stream-id)
27
- - [Delete Live Stream](#mux-live-delete-stream-id)
28
- - [Playback ID Management (Live)](#playback-id-management-1)
14
+ - [Uploads](#uploads)
29
15
  - [Playback ID Lookup](#playback-id-lookup)
16
+ - [Playback Restrictions](#playback-restrictions)
30
17
  - [Signing Keys & Secure Playback](#signing-keys--secure-playback)
31
- - [Create Signing Key](#mux-signing-keys-create)
32
- - [List Signing Keys](#mux-signing-keys-list)
33
- - [Get Signing Key](#mux-signing-keys-get-key-id)
34
- - [Delete Signing Key](#mux-signing-keys-delete-key-id)
35
- - [Sign Playback ID](#mux-sign-playback-id)
18
+ - [Transcription Vocabularies](#transcription-vocabularies)
19
+ - [Delivery Usage](#delivery-usage)
20
+ - [DRM Configurations](#drm-configurations)
21
+ - [Mux Data](#mux-data)
36
22
  - [Authentication & Environment Management](#authentication--environment-management)
37
23
  - [Configuration](#configuration)
38
24
  - [Development](#development)
39
- - [Prerequisites](#prerequisites)
40
- - [Setup](#setup)
41
- - [Testing](#testing)
42
- - [Project Structure](#project-structure)
43
25
  - [License](#license)
44
26
  - [Support](#support)
45
27
 
@@ -118,48 +100,37 @@ Restart your shell or source the config file to activate completions.
118
100
 
119
101
  Before using the Mux CLI, you need to authenticate with your Mux API credentials. You can obtain these from the [Mux Dashboard](https://dashboard.mux.com/settings/access-tokens).
120
102
 
121
- #### Interactive Login
122
-
123
- The simplest way to authenticate:
124
-
125
103
  ```bash
104
+ # Interactive login (prompts for Token ID and Secret)
126
105
  mux login
127
- ```
128
-
129
- You'll be prompted to enter your Mux Token ID and Token Secret. The CLI will validate your credentials before saving them.
130
-
131
- #### Login with .env File
132
-
133
- If you have your credentials in a `.env` file:
134
106
 
135
- ```bash
107
+ # Login with .env file (expects MUX_TOKEN_ID and MUX_TOKEN_SECRET)
136
108
  mux login --env-file .env
137
- ```
138
-
139
- Your `.env` file should contain:
140
109
 
141
- ```bash
142
- MUX_TOKEN_ID=your_token_id
143
- MUX_TOKEN_SECRET=your_token_secret
110
+ # Named environments for multi-environment workflows
111
+ mux login --name production
112
+ mux login --name staging --env-file .env.staging
144
113
  ```
145
114
 
146
- #### Named Environments
115
+ The first environment you add becomes the default. See [Authentication & Environment Management](#authentication--environment-management) for more details.
147
116
 
148
- You can manage multiple environments (e.g., production, staging, development):
117
+ ## Common Options
149
118
 
150
- ```bash
151
- # Add a production environment
152
- mux login --name production
119
+ These options are available on most commands and are not repeated in individual command docs below.
153
120
 
154
- # Add a staging environment
155
- mux login --name staging
156
- ```
157
-
158
- The first environment you add becomes the default. You can switch between environments later.
121
+ | Option | Description |
122
+ |--------|-------------|
123
+ | `--json` | Output raw JSON instead of pretty-printed format. Useful for scripting and piping to `jq`. |
124
+ | `--compact` | One-line-per-item output, grep-friendly. Available on `list` commands. |
125
+ | `--limit <n>` | Number of results to return (default: 25). Available on `list` commands. |
126
+ | `--page <n>` | Page number for pagination (default: 1). Available on `list` commands. |
127
+ | `-f, --force` | Skip confirmation prompts on destructive actions. **Required** when combining `--json` with `delete` commands. |
128
+ | `--wait` | Poll until the resource is ready before returning. Available on `create` commands. |
159
129
 
160
130
  ## Commands
161
131
 
162
- ### Asset Management
132
+ <details open>
133
+ <summary><h3>Asset Management</h3></summary>
163
134
 
164
135
  #### `mux assets create`
165
136
 
@@ -167,45 +138,30 @@ Create a new Mux video asset from a URL, local file, or JSON configuration.
167
138
 
168
139
  **Options:**
169
140
  - `--url <url>` - Video URL to ingest from the web
170
- - `--upload <path>` - Local file(s) to upload (supports glob patterns like `*.mp4` or `videos/**/*.mp4`)
141
+ - `--upload <path>` - Local file(s) to upload (supports glob patterns like `*.mp4`)
171
142
  - `--file, -f <path>` - JSON configuration file for complex asset creation
172
- - `--playback-policy <policy>` - Playback policy: `public` or `signed` (can be specified multiple times)
143
+ - `--playback-policy <policy>` - `public` or `signed` (repeatable)
173
144
  - `--test` - Create test asset (watermarked, 10s limit, deleted after 24h)
174
145
  - `--passthrough <string>` - User metadata (max 255 characters)
175
- - `--static-renditions <resolution>` - Static rendition resolutions: `highest`, `audio-only`, `2160p`, `1440p`, `1080p`, `720p`, `540p`, `480p`, `360p`, `270p` (can be specified multiple times)
176
- - `--video-quality <quality>` - Video quality level: `basic`, `plus`, or `premium`
146
+ - `--static-renditions <resolution>` - e.g. `1080p`, `720p`, `highest`, `audio-only` (repeatable)
147
+ - `--video-quality <quality>` - `basic`, `plus`, or `premium`
177
148
  - `--normalize-audio` - Normalize audio loudness level
178
149
  - `-y, --yes` - Skip confirmation prompts
179
- - `--json` - Output JSON instead of pretty format
180
- - `--wait` - Wait for asset processing to complete (polls until ready)
181
150
 
182
151
  **Examples:**
183
152
 
184
153
  ```bash
185
- # Create asset from remote URL
154
+ # Create from URL
186
155
  mux assets create --url https://example.com/video.mp4 --playback-policy public
187
156
 
188
- # Upload a single local file
189
- mux assets create --upload video.mp4 --playback-policy public --test
190
-
191
- # Upload multiple files with glob pattern
157
+ # Upload local files (glob supported, each file becomes a separate asset)
192
158
  mux assets create --upload ./videos/*.mp4 --playback-policy public
193
- # Shows confirmation prompt with file list and total size
194
159
 
195
- # Skip confirmation for multiple files
196
- mux assets create --upload ./videos/*.mp4 --playback-policy public -y
197
-
198
- # Create asset with complex configuration from JSON file
160
+ # Complex config from JSON file (overlays, subtitles, multiple inputs)
199
161
  mux assets create --file asset-config.json
200
162
 
201
- # Override config file options with flags
202
- mux assets create --file asset-config.json --test --playback-policy signed
203
-
204
- # Wait for asset to be ready
163
+ # Wait for processing to complete
205
164
  mux assets create --url https://example.com/video.mp4 --playback-policy public --wait
206
-
207
- # Get JSON output for scripting
208
- mux assets create --url https://example.com/video.mp4 --playback-policy public --json
209
165
  ```
210
166
 
211
167
  **JSON Configuration File:**
@@ -226,10 +182,7 @@ For complex asset creation (overlays, subtitles, multiple input tracks), use a J
226
182
  "opacity": "80%"
227
183
  },
228
184
  "generated_subtitles": [
229
- {
230
- "language_code": "en",
231
- "name": "English"
232
- }
185
+ { "language_code": "en", "name": "English" }
233
186
  ]
234
187
  }
235
188
  ],
@@ -241,1072 +194,672 @@ For complex asset creation (overlays, subtitles, multiple input tracks), use a J
241
194
  }
242
195
  ```
243
196
 
244
- Then create the asset:
245
-
246
197
  ```bash
247
198
  mux assets create --file asset-config.json
248
199
  ```
249
200
 
250
- **Multiple File Uploads:**
251
-
252
- When using glob patterns, each file creates a separate asset:
253
-
254
- ```bash
255
- mux assets create --upload ./videos/*.mp4 --playback-policy public
256
- # Creates 3 separate assets if 3 files match
257
-
258
- # Output:
259
- # Found 3 files to upload:
260
- # - intro.mp4 (45.2 MB)
261
- # - main.mp4 (128.7 MB)
262
- # - outro.mp4 (23.1 MB)
263
- # Total size: 197.1 MB
264
- # Continue with upload? (y/n):
265
- ```
266
-
267
201
  #### `mux assets list`
268
202
 
269
- List all video assets with pagination and filtering options.
203
+ List all video assets with pagination and filtering.
270
204
 
271
- **Options:**
272
- - `--limit <number>` - Number of results to return (default: 25)
273
- - `--page <number>` - Page number for pagination (default: 1)
274
- - `--upload-id <id>` - Filter assets by upload ID
275
- - `--live-stream-id <id>` - Filter assets by live stream ID
276
- - `--json` - Output JSON instead of pretty format
277
- - `--compact` - Output one line per asset in grep-friendly format
278
-
279
- **Examples:**
205
+ **Unique options:**
206
+ - `--upload-id <id>` - Filter by upload ID
207
+ - `--live-stream-id <id>` - Filter by live stream ID
280
208
 
281
209
  ```bash
282
- # List assets with default settings (25 assets, page 1)
283
210
  mux assets list
284
-
285
- # List first 10 assets
286
- mux assets list --limit 10
287
-
288
- # List second page of results
289
- mux assets list --page 2
290
-
291
- # Filter by upload ID
292
- mux assets list --upload-id abc123xyz
293
-
294
- # Get JSON output for scripting
295
- mux assets list --json
296
-
297
- # Get compact output for grep and parsing
298
- mux assets list --compact
299
- ```
300
-
301
- **Output (default pretty format):**
302
-
303
- ```
304
- Found 3 asset(s):
305
-
306
- sRkgb02SMJOjf72PFIkegcrZR3knHPEPG ready 0:09 07/25 14:16
307
- Details:
308
- ├─ Aspect Ratio: 240:427
309
- ├─ Resolution: 720p
310
- └─ Quality: plus
311
- Meta:
312
- └─ Title: golf-swing
313
- Playback IDs:
314
- ├─ 🔓 rFHdcXSf95EHT32qYnf6ZnBz01D7VyKR4
315
- └─ 🔒 qo5Y6CpYtdZBgQlI6VskadqdNcQQVdPh
316
- ```
317
-
318
- **Output (with --compact flag):**
319
-
320
- ```
321
- sRkgb02SMJOjf72PFIkegcrZR3knHPEPG ready 0:09 07/25 14:16 720p "golf-swing" public,signed -
211
+ mux assets list --limit 10 --page 2
212
+ mux assets list --live-stream-id abc123
322
213
  ```
323
214
 
324
215
  #### `mux assets get <asset-id>`
325
216
 
326
217
  Get detailed information about a specific video asset.
327
218
 
328
- **Arguments:**
329
- - `<asset-id>` - The ID of the asset to retrieve
330
-
331
- **Options:**
332
- - `--json` - Output JSON instead of pretty format
333
-
334
- **Examples:**
335
-
336
219
  ```bash
337
- # Get asset details
338
220
  mux assets get abc123xyz
339
-
340
- # Get asset details as JSON
341
- mux assets get abc123xyz --json
342
- ```
343
-
344
- **Output:**
345
-
346
- ```
347
- Asset ID: abc123xyz
348
- Status: ready
349
- Duration: 120.45s
350
- Created: 1234567890
351
- Aspect Ratio: 16:9
352
- Resolution Tier: 1080p
353
- Video Quality: plus
354
- Max Resolution: HD
355
- Max Frame Rate: 30.00 fps
356
-
357
- Playback IDs:
358
- - playback123 (public)
359
- URL: https://stream.mux.com/playback123.m3u8
360
-
361
- Tracks:
362
- - audio: audio_track_id
363
- Duration: 120.45s
364
- - video: video_track_id
365
- Duration: 120.45s
366
-
367
- Passthrough: my-video-metadata
368
-
369
- WARNING: This is a test asset (will be deleted after 24 hours)
370
221
  ```
371
222
 
372
223
  #### `mux assets update <asset-id>`
373
224
 
374
- Update metadata fields on a video asset.
375
-
376
- **Arguments:**
377
- - `<asset-id>` - The ID of the asset to update
225
+ Update metadata fields on a video asset. At least one field flag must be provided.
378
226
 
379
227
  **Options:**
380
228
  - `--title <string>` - Set `meta.title` (max 512 characters)
381
229
  - `--creator-id <string>` - Set `meta.creator_id` (max 128 characters)
382
230
  - `--external-id <string>` - Set `meta.external_id` (max 128 characters)
383
231
  - `--passthrough <string>` - Set `passthrough` (max 255 characters)
384
- - `--json` - Output JSON instead of pretty format
385
-
386
- At least one field flag must be provided.
387
-
388
- **Examples:**
389
232
 
390
233
  ```bash
391
- # Set a title on an asset
392
- mux assets update abc123xyz --title "My Video"
393
-
394
- # Set multiple fields at once
395
- mux assets update abc123xyz --title "My Video" --creator-id "user-42" --external-id "vid-001"
396
-
397
- # Update passthrough metadata
398
- mux assets update abc123xyz --passthrough "my-custom-metadata"
399
-
400
- # Clear a field by passing an empty string
401
- mux assets update abc123xyz --title ""
402
-
403
- # Get JSON output
404
- mux assets update abc123xyz --title "My Video" --json
405
- ```
406
-
407
- **Output:**
408
-
409
- ```
410
- Asset updated successfully.
411
-
412
- Asset ID: abc123xyz
413
- Status: ready
414
- Duration: 120.45s
415
- ...
234
+ mux assets update abc123xyz --title "My Video" --creator-id "user-42"
235
+ mux assets update abc123xyz --title "" # clear a field
416
236
  ```
417
237
 
418
238
  #### `mux assets delete <asset-id>`
419
239
 
420
240
  Delete a video asset permanently.
421
241
 
422
- **Arguments:**
423
- - `<asset-id>` - The ID of the asset to delete
424
-
425
- **Options:**
426
- - `-f, --force` - Skip confirmation prompt
427
- - `--json` - Output JSON instead of pretty format
428
-
429
- **Examples:**
430
-
431
242
  ```bash
432
- # Delete asset with confirmation prompt
433
- mux assets delete abc123xyz
434
-
435
- # Delete asset without confirmation
436
- mux assets delete abc123xyz --force
437
-
438
- # Delete asset with JSON output (requires --force for safety)
439
- mux assets delete abc123xyz --json --force
243
+ mux assets delete abc123xyz # with confirmation prompt
244
+ mux assets delete abc123xyz --force # skip confirmation
440
245
  ```
441
246
 
442
- **Important:** When using `--json` output mode, you must also provide the `--force` flag. This safety feature prevents accidental deletions in automated scripts.
247
+ #### `mux assets manage`
443
248
 
444
- **Output:**
249
+ Interactive terminal UI (TUI) to browse assets, view details, manage playback IDs, and copy URLs. Navigate with arrow keys, Enter, and `q` to quit.
445
250
 
446
- ```
447
- Are you sure you want to delete asset abc123xyz? (y/n): y
448
- Asset abc123xyz deleted successfully
251
+ ```bash
252
+ mux assets manage
449
253
  ```
450
254
 
451
- #### `mux assets manage`
255
+ **Note:** Requires an interactive terminal (TTY). For scripting, use `mux assets list`, `mux assets get`, etc.
452
256
 
453
- Interactively manage Mux video assets using a terminal user interface (TUI). This command provides a visual interface to browse assets, view details, manage playback IDs, and copy URLs directly from your terminal.
257
+ #### `mux assets input-info <asset-id>`
454
258
 
455
- **Examples:**
259
+ Retrieve input info for an asset, including file details, tracks, and encoding settings.
456
260
 
457
261
  ```bash
458
- # Launch the interactive asset management TUI
459
- mux assets manage
262
+ mux assets input-info abc123xyz
460
263
  ```
461
264
 
462
- **Features:**
463
-
464
- - Browse all video assets with pagination
465
- - View detailed asset information
466
- - Create and delete playback IDs
467
- - Copy stream URLs (HLS) to clipboard
468
- - Copy player URLs to clipboard
469
- - Delete assets with confirmation
470
- - Automatic URL signing for signed playback policies
471
-
472
- **Navigation:**
265
+ #### `mux assets update-master-access <asset-id>`
473
266
 
474
- - **Arrow keys** - Navigate through assets and menu options
475
- - **Enter** - Select an asset or action
476
- - **q** - Quit or go back to previous view
477
- - **Escape** - Cancel current operation
267
+ Update master access settings for an asset (`temporary` or `none`).
478
268
 
479
- **Note:** This command requires an interactive terminal (TTY). For scripting and non-interactive use cases, use `mux assets list`, `mux assets get`, and related commands instead.
269
+ ```bash
270
+ mux assets update-master-access abc123xyz --master-access temporary
271
+ ```
480
272
 
481
273
  #### Playback ID Management
482
274
 
483
- Playback IDs control access to your video assets. Each asset can have multiple playback IDs with different policies (public or signed).
275
+ Manage playback IDs on assets. Each asset can have multiple playback IDs with different policies.
484
276
 
485
- ##### `mux assets playback-ids list <asset-id>`
277
+ ```bash
278
+ mux assets playback-ids list <asset-id>
279
+ mux assets playback-ids create <asset-id> [--policy signed]
280
+ mux assets playback-ids delete <asset-id> <playback-id> [--force]
281
+ ```
486
282
 
487
- List all playback IDs for a specific asset.
283
+ #### Static Renditions Management
488
284
 
489
- **Arguments:**
490
- - `<asset-id>` - The ID of the asset
285
+ Static renditions are downloadable MP4 versions of your video assets at specific resolutions.
491
286
 
492
- **Options:**
493
- - `--json` - Output JSON instead of pretty format
287
+ ```bash
288
+ mux assets static-renditions list <asset-id>
289
+ mux assets static-renditions create <asset-id> --resolution 1080p [--wait]
290
+ mux assets static-renditions delete <asset-id> <rendition-id> [--force]
291
+ ```
494
292
 
495
- **Examples:**
293
+ **Resolution options:** `highest`, `audio-only`, `2160p`, `1440p`, `1080p`, `720p`, `540p`, `480p`, `360p`, `270p`
496
294
 
497
- ```bash
498
- # List playback IDs for an asset
499
- mux assets playback-ids list abc123xyz
295
+ #### Track Management
500
296
 
501
- # Get JSON output
502
- mux assets playback-ids list abc123xyz --json
503
- ```
297
+ Manage text and audio tracks (subtitles, captions, audio) on video assets.
504
298
 
505
- **Output:**
299
+ ##### `mux assets tracks create <asset-id>`
506
300
 
507
- ```
508
- Found 2 playback ID(s) for asset abc123xyz:
301
+ Add a text or audio track to an asset.
509
302
 
510
- Playback ID: playback123
511
- Policy: public
512
- URL: https://stream.mux.com/playback123.m3u8
303
+ **Options:**
304
+ - `--url <url>` - URL of the track file (required)
305
+ - `--type <type>` - Track type: `text` or `audio` (required)
306
+ - `--language-code <code>` - BCP 47 language code, e.g., `en-US` (required)
307
+ - `--name <name>` - Human-readable name for the track
308
+ - `--text-type <type>` - Text track type: `subtitles` or `captions`
309
+ - `--closed-captions` - Indicates the track provides SDH
310
+ - `--passthrough <string>` - Passthrough metadata (max 255 characters)
513
311
 
514
- Playback ID: playback456
515
- Policy: signed
516
- URL: https://stream.mux.com/playback456.m3u8
312
+ ```bash
313
+ mux assets tracks create abc123xyz --url https://example.com/subs.vtt --type text --language-code en --text-type subtitles
517
314
  ```
518
315
 
519
- ##### `mux assets playback-ids create <asset-id>`
316
+ ##### `mux assets tracks delete <asset-id> <track-id>`
520
317
 
521
- Create a new playback ID for an asset.
318
+ Delete a track from an asset. Supports `--force`.
522
319
 
523
- **Arguments:**
524
- - `<asset-id>` - The ID of the asset
320
+ ##### `mux assets tracks generate-subtitles <asset-id> <track-id>`
525
321
 
526
- **Options:**
527
- - `--policy <policy>` - Playback policy: `public` or `signed` (default: `public`)
528
- - `--json` - Output JSON instead of pretty format
322
+ Generate subtitles for an audio track using automatic speech recognition.
529
323
 
530
- **Examples:**
324
+ **Options:** `--language-code <code>`, `--name <name>`, `--passthrough <string>`
531
325
 
532
326
  ```bash
533
- # Create a public playback ID
534
- mux assets playback-ids create abc123xyz
535
-
536
- # Create a signed playback ID
537
- mux assets playback-ids create abc123xyz --policy signed
538
-
539
- # Get JSON output
540
- mux assets playback-ids create abc123xyz --policy public --json
327
+ mux assets tracks generate-subtitles abc123xyz track456 --language-code en --name "English (auto)"
541
328
  ```
542
329
 
543
- **Output:**
544
-
545
- ```
546
- Playback ID created: playback123
547
- Policy: public
548
- URL: https://stream.mux.com/playback123.m3u8
549
- ```
330
+ </details>
550
331
 
551
- ##### `mux assets playback-ids delete <asset-id> <playback-id>`
332
+ <details>
333
+ <summary><h3>Live Stream Management</h3></summary>
552
334
 
553
- Delete a playback ID from an asset.
335
+ #### `mux live create`
554
336
 
555
- **Arguments:**
556
- - `<asset-id>` - The ID of the asset
557
- - `<playback-id>` - The ID of the playback ID to delete
337
+ Create a new Mux live stream for broadcasting.
558
338
 
559
339
  **Options:**
560
- - `-f, --force` - Skip confirmation prompt
561
- - `--json` - Output JSON instead of pretty format
562
-
563
- **Examples:**
340
+ - `--playback-policy <policy>` - `public` or `signed` (repeatable)
341
+ - `--new-asset-settings <settings>` - Auto-create asset from stream. Use `none` to disable, or JSON string (e.g., `'{"playback_policies": ["public"]}'`)
342
+ - `--reconnect-window <seconds>` - Reconnect timeout (default: 60)
343
+ - `--latency-mode <mode>` - `low`, `reduced`, or `standard` (default: `low`)
344
+ - `--test` - Create test stream (deleted after 24h)
564
345
 
565
346
  ```bash
566
- # Delete a playback ID with confirmation
567
- mux assets playback-ids delete abc123xyz playback123
347
+ mux live create --playback-policy public
348
+ mux live create --playback-policy public --latency-mode low --test
349
+ mux live create --playback-policy public --new-asset-settings '{"playback_policies": ["public"]}'
350
+ ```
568
351
 
569
- # Delete without confirmation
570
- mux assets playback-ids delete abc123xyz playback123 --force
352
+ Once created, stream using:
353
+ - **RTMP URL:** `rtmp://global-live.mux.com/app`
354
+ - **Stream Key:** returned in the response
571
355
 
572
- # Delete with JSON output
573
- mux assets playback-ids delete abc123xyz playback123 --force --json
574
- ```
356
+ #### `mux live list`
575
357
 
576
- **Output:**
358
+ List all live streams with pagination.
577
359
 
578
- ```
579
- Are you sure you want to delete playback ID playback123 from asset abc123xyz? (y/n): y
580
- Playback ID playback123 deleted successfully
360
+ ```bash
361
+ mux live list
362
+ mux live list --limit 10 --compact
581
363
  ```
582
364
 
583
- #### Static Renditions Management
365
+ #### `mux live get <stream-id>`
584
366
 
585
- Static renditions are downloadable MP4 versions of your video assets at specific resolutions. Unlike streaming playback, these are complete files that can be downloaded.
367
+ Get detailed information about a specific live stream.
586
368
 
587
- ##### `mux assets static-renditions list <asset-id>`
369
+ ```bash
370
+ mux live get abc123xyz
371
+ ```
588
372
 
589
- List all static renditions for a specific asset.
373
+ #### `mux live update <stream-id>`
590
374
 
591
- **Arguments:**
592
- - `<asset-id>` - The ID of the asset
375
+ Update configuration on a live stream. At least one option must be provided.
593
376
 
594
377
  **Options:**
595
- - `--json` - Output JSON instead of pretty format
596
-
597
- **Examples:**
378
+ - `--latency-mode <mode>` - `low`, `reduced`, or `standard`
379
+ - `--reconnect-window <seconds>` - Reconnect window (0-1800)
380
+ - `--max-continuous-duration <seconds>` - Max continuous duration (60-43200)
381
+ - `--passthrough <string>` - Passthrough metadata (max 255 characters)
382
+ - `--reconnect-slate-url <url>` - Image to display during reconnect
383
+ - `--use-slate-for-standard-latency` - Display slate for standard latency streams
384
+ - `--title <string>` - Title for the live stream
598
385
 
599
386
  ```bash
600
- # List static renditions for an asset
601
- mux assets static-renditions list abc123xyz
602
-
603
- # Get JSON output
604
- mux assets static-renditions list abc123xyz --json
387
+ mux live update abc123xyz --latency-mode standard
388
+ mux live update abc123xyz --reconnect-window 300 --title "My Stream"
605
389
  ```
606
390
 
607
- **Output:**
391
+ #### `mux live delete <stream-id>`
608
392
 
609
- ```
610
- Static renditions for asset abc123xyz:
393
+ Delete a live stream permanently.
611
394
 
612
- 1080p.mp4 [ready] 1920x1080 5.2 Mbps 42.3 MB
613
- ID: rendition123
614
- 720p.mp4 [preparing] 1280x720 - -
615
- ID: rendition456
395
+ ```bash
396
+ mux live delete abc123xyz # with confirmation
397
+ mux live delete abc123xyz --force # skip confirmation
616
398
  ```
617
399
 
618
- ##### `mux assets static-renditions create <asset-id>`
619
-
620
- Create a new static rendition for an asset.
621
-
622
- **Arguments:**
623
- - `<asset-id>` - The ID of the asset
400
+ #### `mux live complete <stream-id>`
624
401
 
625
- **Options:**
626
- - `-r, --resolution <resolution>` - Target resolution (required): `highest`, `audio-only`, `2160p`, `1440p`, `1080p`, `720p`, `540p`, `480p`, `360p`, `270p`
627
- - `-p, --passthrough <string>` - Custom metadata for the rendition (max 255 characters)
628
- - `-w, --wait` - Wait for the rendition to be ready instead of returning immediately
629
- - `--json` - Output JSON instead of pretty format
402
+ Signal that a live stream has ended and Mux should complete the recording.
630
403
 
631
- **Examples:**
404
+ #### `mux live enable <stream-id>`
632
405
 
633
- ```bash
634
- # Create a 1080p rendition
635
- mux assets static-renditions create abc123xyz --resolution 1080p
406
+ Enable a disabled live stream, allowing it to accept new connections.
636
407
 
637
- # Create and wait for completion
638
- mux assets static-renditions create abc123xyz --resolution 720p --wait
408
+ #### `mux live disable <stream-id>`
639
409
 
640
- # Create with custom metadata
641
- mux assets static-renditions create abc123xyz --resolution 1080p --passthrough "web-download"
410
+ Disable a live stream, preventing it from accepting new connections.
642
411
 
643
- # Get JSON output
644
- mux assets static-renditions create abc123xyz --resolution 1080p --json
412
+ ```bash
413
+ mux live complete abc123xyz
414
+ mux live enable abc123xyz
415
+ mux live disable abc123xyz
645
416
  ```
646
417
 
647
- **Output:**
418
+ #### `mux live reset-stream-key <stream-id>`
648
419
 
649
- ```
650
- Static rendition created:
651
- ID: rendition123
652
- Name: 1080p.mp4
653
- Resolution: 1080p
654
- Status: preparing
420
+ Reset the stream key for a live stream. This invalidates the current key.
655
421
 
656
- Note: Static rendition generation is asynchronous. Use 'mux assets static-renditions list <asset-id>' to check the status, or use the --wait flag to poll until ready.
422
+ ```bash
423
+ mux live reset-stream-key abc123xyz # with confirmation
424
+ mux live reset-stream-key abc123xyz --force # skip confirmation
657
425
  ```
658
426
 
659
- ##### `mux assets static-renditions delete <asset-id> <rendition-id>`
660
-
661
- Delete a static rendition from an asset.
662
-
663
- **Arguments:**
664
- - `<asset-id>` - The ID of the asset
665
- - `<rendition-id>` - The ID of the rendition to delete
666
-
667
- **Options:**
668
- - `-f, --force` - Skip confirmation prompt
669
- - `--json` - Output JSON instead of pretty format
427
+ #### Simulcast Targets
670
428
 
671
- **Examples:**
429
+ Manage simulcast targets to restream a live stream to third-party platforms (e.g., YouTube, Twitch).
672
430
 
673
431
  ```bash
674
- # Delete a static rendition with confirmation
675
- mux assets static-renditions delete abc123xyz rendition123
432
+ # Create a simulcast target
433
+ mux live simulcast-targets create <stream-id> --url rtmp://live.twitch.tv/app --stream-key live_xxxxx
676
434
 
677
- # Delete without confirmation
678
- mux assets static-renditions delete abc123xyz rendition123 --force
435
+ # Get details about a simulcast target
436
+ mux live simulcast-targets get <stream-id> <target-id>
679
437
 
680
- # Delete with JSON output
681
- mux assets static-renditions delete abc123xyz rendition123 --force --json
438
+ # Delete a simulcast target
439
+ mux live simulcast-targets delete <stream-id> <target-id> [--force]
682
440
  ```
683
441
 
684
- **Output:**
442
+ #### Embedded & Generated Subtitles
685
443
 
686
- ```
687
- Are you sure you want to delete static rendition rendition123? (y/n): y
688
- Static rendition rendition123 deleted from asset abc123xyz
689
- ```
444
+ ##### `mux live update-embedded-subtitles <stream-id>`
690
445
 
691
- ### Live Stream Management
446
+ Update embedded subtitle (CEA-608) configuration.
692
447
 
693
- #### `mux live create`
448
+ **Options:** `--language-channel <cc1|cc2|cc3|cc4>`, `--language-code <code>`, `--name <name>`, `--passthrough <string>`, `--clear`
694
449
 
695
- Create a new Mux live stream for broadcasting.
450
+ ```bash
451
+ mux live update-embedded-subtitles abc123xyz --language-channel cc1 --language-code en --name "English CC"
452
+ ```
696
453
 
697
- **Options:**
698
- - `--playback-policy <policy>` - Playback policy: `public` or `signed` (can be specified multiple times)
699
- - `--new-asset-settings <settings>` - Automatically create an asset from this live stream. Use `none` to disable, or provide a JSON string with asset settings (e.g., `'{"playback_policies": ["public"]}'`)
700
- - `--reconnect-window <seconds>` - Time in seconds a stream can be disconnected before being considered finished (default: 60)
701
- - `--latency-mode <mode>` - Latency mode: `low`, `reduced`, or `standard` (default: `low`)
702
- - `--test` - Create test live stream (deleted after 24h)
703
- - `--json` - Output JSON instead of pretty format
454
+ ##### `mux live update-generated-subtitles <stream-id>`
704
455
 
705
- **Examples:**
456
+ Update generated subtitle (ASR) configuration.
706
457
 
707
- ```bash
708
- # Create a basic live stream with public playback
709
- mux live create --playback-policy public
458
+ **Options:** `--language-code <code>`, `--name <name>`, `--passthrough <string>`, `--transcription-vocabulary-ids <id>` (repeatable), `--clear`
710
459
 
711
- # Create a low-latency live stream
712
- mux live create --playback-policy public --latency-mode low
460
+ ```bash
461
+ mux live update-generated-subtitles abc123xyz --language-code en --name "English (auto)"
462
+ ```
713
463
 
714
- # Create a stream that automatically saves to an asset
715
- mux live create --playback-policy public --new-asset-settings '{"playback_policies": ["public"]}'
464
+ #### New Asset Static Renditions
716
465
 
717
- # Create a test stream (deleted after 24 hours)
718
- mux live create --playback-policy public --test
466
+ Configure static rendition settings for assets automatically created from a live stream.
719
467
 
720
- # Create with extended reconnect window (5 minutes)
721
- mux live create --playback-policy public --reconnect-window 300
468
+ ```bash
469
+ # Set rendition resolutions
470
+ mux live update-new-asset-static-renditions <stream-id> --resolution 1080p --resolution 720p
722
471
 
723
- # Get JSON output for scripting
724
- mux live create --playback-policy public --json
472
+ # Delete rendition settings
473
+ mux live delete-new-asset-static-renditions <stream-id> [--force]
725
474
  ```
726
475
 
727
- **Output:**
476
+ #### Playback ID Management (Live)
728
477
 
729
- ```
730
- Live stream created: abc123xyz
731
- Status: idle
732
- Stream Key: your-secret-stream-key
733
- Playback URL: https://stream.mux.com/playback123.m3u8
478
+ Manage playback IDs on live streams, same interface as asset playback IDs.
734
479
 
735
- WARNING: This is a test stream (will be deleted after 24 hours)
480
+ ```bash
481
+ mux live playback-ids list <stream-id>
482
+ mux live playback-ids create <stream-id> [--policy signed]
483
+ mux live playback-ids delete <stream-id> <playback-id> [--force]
736
484
  ```
737
485
 
738
- **Using the Stream:**
486
+ </details>
739
487
 
740
- Once created, you can stream to your live stream using the RTMP URL and stream key:
741
- - **RTMP URL:** `rtmp://global-live.mux.com/app`
742
- - **Stream Key:** The `stream_key` returned in the response
488
+ <details>
489
+ <summary><h3>Uploads</h3></summary>
743
490
 
744
- Configure your streaming software (OBS, Wirecast, etc.) with these values to start broadcasting.
491
+ Manage direct uploads for client-side video uploading. Direct uploads provide a URL that clients can use to upload video files directly to Mux.
745
492
 
746
- #### `mux live list`
493
+ #### `mux uploads create`
747
494
 
748
- List all live streams with pagination.
495
+ Create a new direct upload URL.
749
496
 
750
497
  **Options:**
751
- - `--limit <number>` - Number of results to return (default: 25)
752
- - `--page <number>` - Page number for pagination (default: 1)
753
- - `--json` - Output JSON instead of pretty format
754
- - `--compact` - Output one line per stream in grep-friendly format
755
-
756
- **Examples:**
498
+ - `--cors-origin <origin>` - Allowed CORS origin for the upload (required)
499
+ - `-p, --playback-policy <policy>` - `public` or `signed`
500
+ - `--timeout <seconds>` - Seconds before the upload times out (default: 3600)
501
+ - `--test` - Create a test upload (asset deleted after 24 hours)
757
502
 
758
503
  ```bash
759
- # List live streams with default settings
760
- mux live list
761
-
762
- # List first 10 streams
763
- mux live list --limit 10
764
-
765
- # List second page of results
766
- mux live list --page 2
767
-
768
- # Get JSON output for scripting
769
- mux live list --json
770
-
771
- # Get compact output for grep and parsing
772
- mux live list --compact
504
+ mux uploads create --cors-origin "https://example.com" --playback-policy public
773
505
  ```
774
506
 
775
- **Output (default pretty format):**
507
+ #### `mux uploads list`
776
508
 
777
- ```
778
- Found 2 live stream(s):
779
-
780
- waWxn5KIZCYmILAOWgXW9dFBPnOXq00JM idle 08/18 16:43
781
- Details:
782
- ├─ Stream Key: c3eb...1724
783
- ├─ Latency Mode: standard
784
- ├─ Reconnect Window: 60s
785
- └─ Max Duration: 12h
786
- Recent Assets:
787
- └─ 00QNOSkxzBdlASP3iIvTfvqxDN3u74hUX
788
- Playback IDs:
789
- └─ 🔒 EIyqm8p4VwGj5sO9rNBtykFbbKFFSNWA
790
- ```
509
+ List direct uploads with pagination. Supports `--limit`, `--page`, `--compact`.
791
510
 
792
- **Output (with --compact flag):**
511
+ #### `mux uploads get <upload-id>`
793
512
 
794
- ```
795
- waWxn5KIZCYmILAOWgXW9dFBPnOXq00JM idle 08/18 16:43 standard 60s signed 1 assets
796
- ```
513
+ Get details about a specific direct upload.
797
514
 
798
- #### `mux live get <stream-id>`
799
-
800
- Get detailed information about a specific live stream.
801
-
802
- **Arguments:**
803
- - `<stream-id>` - The ID of the live stream to retrieve
804
-
805
- **Options:**
806
- - `--json` - Output JSON instead of pretty format
515
+ #### `mux uploads cancel <upload-id>`
807
516
 
808
- **Examples:**
517
+ Cancel a waiting direct upload. Supports `--force`.
809
518
 
810
519
  ```bash
811
- # Get live stream details
812
- mux live get abc123xyz
813
-
814
- # Get live stream details as JSON
815
- mux live get abc123xyz --json
520
+ mux uploads cancel abc123xyz --force
816
521
  ```
817
522
 
818
- **Output:**
523
+ </details>
819
524
 
820
- ```
821
- Live Stream ID: abc123xyz
822
- Status: active
823
- Created: 1234567890
824
- Stream Key: your-secret-stream-key
825
- Latency Mode: low
826
- Reconnect Window: 60s
827
-
828
- Playback IDs:
829
- - playback123 (public)
830
- URL: https://stream.mux.com/playback123.m3u8
831
-
832
- New Asset Settings:
833
- Playback Policy: public
834
- Recording enabled: Yes
835
-
836
- WARNING: This is a test stream (will be deleted after 24 hours)
837
- ```
838
-
839
- #### `mux live delete <stream-id>`
525
+ <details>
526
+ <summary><h3>Playback ID Lookup</h3></summary>
840
527
 
841
- Delete a live stream permanently.
528
+ #### `mux playback-ids <playback-id>`
842
529
 
843
- **Arguments:**
844
- - `<stream-id>` - The ID of the live stream to delete
530
+ Look up which asset or live stream a playback ID belongs to.
845
531
 
846
532
  **Options:**
847
- - `-f, --force` - Skip confirmation prompt
848
- - `--json` - Output JSON instead of pretty format
849
-
850
- **Examples:**
533
+ - `--expand` - Fetch the full asset or live stream object instead of just the reference
851
534
 
852
535
  ```bash
853
- # Delete stream with confirmation prompt
854
- mux live delete abc123xyz
855
-
856
- # Delete stream without confirmation
857
- mux live delete abc123xyz --force
858
-
859
- # Delete stream with JSON output (requires --force for safety)
860
- mux live delete abc123xyz --json --force
536
+ mux playback-ids abc123playbackid
537
+ mux playback-ids abc123playbackid --expand
861
538
  ```
862
539
 
863
- **Important:** When using `--json` output mode, you must also provide the `--force` flag. This safety feature prevents accidental deletions in automated scripts.
864
-
865
- **Output:**
866
-
867
- ```
868
- Are you sure you want to delete live stream abc123xyz? (y/n): y
869
- Live stream abc123xyz deleted successfully
870
- ```
540
+ **Note:** The nested `playback-ids` commands under `assets` and `live` are for managing playback IDs on known resources. This top-level command is for discovering what resource a playback ID belongs to.
871
541
 
872
- #### Playback ID Management
542
+ </details>
873
543
 
874
- Manage playback IDs for live streams. Each live stream can have multiple playback IDs with different policies (public or signed).
544
+ <details>
545
+ <summary><h3>Playback Restrictions</h3></summary>
875
546
 
876
- ##### `mux live playback-ids list <stream-id>`
547
+ Manage playback restrictions to control where and how your content can be played.
877
548
 
878
- List all playback IDs for a specific live stream.
549
+ #### `mux playback-restrictions create`
879
550
 
880
- **Arguments:**
881
- - `<stream-id>` - The ID of the live stream
551
+ Create a new playback restriction.
882
552
 
883
553
  **Options:**
884
- - `--json` - Output JSON instead of pretty format
885
-
886
- **Examples:**
554
+ - `--allowed-domains <domain>` - Allowed referrer domains (required, repeatable)
555
+ - `--allow-no-referrer` - Allow playback when no referrer is sent
556
+ - `--allow-no-user-agent` - Allow playback when no user agent is sent
557
+ - `--allow-high-risk-user-agent` - Allow playback from high-risk user agents
887
558
 
888
559
  ```bash
889
- # List playback IDs for a live stream
890
- mux live playback-ids list abc123xyz
891
-
892
- # Get JSON output
893
- mux live playback-ids list abc123xyz --json
560
+ mux playback-restrictions create --allowed-domains "example.com" --allowed-domains "*.example.com"
894
561
  ```
895
562
 
896
- **Output:**
563
+ #### `mux playback-restrictions list`
897
564
 
898
- ```
899
- Found 2 playback ID(s) for live stream abc123xyz:
565
+ List playback restrictions. Supports `--limit`, `--page`, `--compact`.
900
566
 
901
- Playback ID: playback123
902
- Policy: public
903
- URL: https://stream.mux.com/playback123.m3u8
567
+ #### `mux playback-restrictions get <restriction-id>`
904
568
 
905
- Playback ID: playback456
906
- Policy: signed
907
- URL: https://stream.mux.com/playback456.m3u8
908
- ```
909
-
910
- ##### `mux live playback-ids create <stream-id>`
911
-
912
- Create a new playback ID for a live stream.
913
-
914
- **Arguments:**
915
- - `<stream-id>` - The ID of the live stream
916
-
917
- **Options:**
918
- - `--policy <policy>` - Playback policy: `public` or `signed` (default: `public`)
919
- - `--json` - Output JSON instead of pretty format
569
+ Get details about a playback restriction.
920
570
 
921
- **Examples:**
571
+ #### `mux playback-restrictions delete <restriction-id>`
922
572
 
923
- ```bash
924
- # Create a public playback ID
925
- mux live playback-ids create abc123xyz
573
+ Delete a playback restriction. Supports `--force`.
926
574
 
927
- # Create a signed playback ID
928
- mux live playback-ids create abc123xyz --policy signed
575
+ #### `mux playback-restrictions update-referrer <restriction-id>`
929
576
 
930
- # Get JSON output
931
- mux live playback-ids create abc123xyz --policy public --json
932
- ```
577
+ Update the referrer restriction.
933
578
 
934
- **Output:**
579
+ **Options:** `--allowed-domains <domain>` (required, repeatable), `--allow-no-referrer`
935
580
 
936
- ```
937
- Playback ID created: playback123
938
- Policy: public
939
- URL: https://stream.mux.com/playback123.m3u8
940
- ```
581
+ #### `mux playback-restrictions update-user-agent <restriction-id>`
941
582
 
942
- ##### `mux live playback-ids delete <stream-id> <playback-id>`
583
+ Update the user agent restriction.
943
584
 
944
- Delete a playback ID from a live stream.
585
+ **Options:** `--allow-no-user-agent <boolean>` (required), `--allow-high-risk-user-agent <boolean>` (required)
945
586
 
946
- **Arguments:**
947
- - `<stream-id>` - The ID of the live stream
948
- - `<playback-id>` - The ID of the playback ID to delete
587
+ </details>
949
588
 
950
- **Options:**
951
- - `-f, --force` - Skip confirmation prompt
952
- - `--json` - Output JSON instead of pretty format
589
+ <details>
590
+ <summary><h3>Signing Keys & Secure Playback</h3></summary>
953
591
 
954
- **Examples:**
592
+ #### Signing Key Management
955
593
 
956
594
  ```bash
957
- # Delete a playback ID with confirmation
958
- mux live playback-ids delete abc123xyz playback123
959
-
960
- # Delete without confirmation
961
- mux live playback-ids delete abc123xyz playback123 --force
962
-
963
- # Delete with JSON output
964
- mux live playback-ids delete abc123xyz playback123 --force --json
595
+ mux signing-keys create # creates key and saves to current environment
596
+ mux signing-keys list # lists keys with environment indicators
597
+ mux signing-keys get <key-id>
598
+ mux signing-keys delete <key-id> [--force]
965
599
  ```
966
600
 
967
- **Output:**
601
+ The private key is only returned once during creation. The CLI automatically stores it in your current environment configuration.
968
602
 
969
- ```
970
- Are you sure you want to delete playback ID playback123 from live stream abc123xyz? (y/n): y
971
- Playback ID playback123 deleted successfully
972
- ```
973
-
974
- ### Playback ID Lookup
975
-
976
- #### `mux playback-ids <playback-id>`
603
+ Deleting a signing key invalidates all tokens and signed URLs created with it and removes it from any local environment configurations.
977
604
 
978
- Look up which asset or live stream a playback ID belongs to. This is useful when you have a playback ID and need to find the associated resource.
605
+ #### `mux sign <playback-id>`
979
606
 
980
- **Arguments:**
981
- - `<playback-id>` - The playback ID to look up
607
+ Sign a playback ID to generate a secure URL for video playback, thumbnails, GIFs, or storyboards. Used with assets or live streams that have a `signed` playback policy.
982
608
 
983
609
  **Options:**
984
- - `--expand` - Fetch and return the full asset or live stream object instead of just the reference
985
- - `--json` - Output JSON instead of pretty format
610
+ - `-e, --expiration <duration>` - Token expiration (default: `7d`). Examples: `7d`, `24h`, `30m`
611
+ - `-t, --type <type>` - `video` (default), `thumbnail`, `gif`, `storyboard`
612
+ - `-p, --param <key=value>` - JWT claim as key=value (repeatable)
613
+ - `--params-json <json>` - JWT claims as JSON object
614
+ - `--token-only` - Output only the JWT token (no URL)
615
+
616
+ When both `--param` and `--params-json` are provided, `--params-json` is applied first and `--param` values override on top.
986
617
 
987
618
  **Examples:**
988
619
 
989
620
  ```bash
990
- # Look up a playback ID (returns basic info)
991
- mux playback-ids abc123playbackid
992
-
993
- # Look up and fetch the full asset or live stream object
994
- mux playback-ids abc123playbackid --expand
995
-
996
- # Get JSON output
997
- mux playback-ids abc123playbackid --json
621
+ mux sign abc123playbackid
622
+ mux sign abc123playbackid --expiration 24h
623
+ mux sign abc123playbackid --type thumbnail --param time=14 --param width=100
624
+ mux sign abc123playbackid --type gif
625
+ mux sign abc123playbackid --params-json '{"custom": {"session_id": "xxxx-123"}}'
626
+ mux sign abc123playbackid --token-only
998
627
  ```
999
628
 
1000
- **Output (basic lookup):**
629
+ **Output URLs by type:**
1001
630
 
1002
- ```
1003
- Playback ID: abc123playbackid
1004
- Policy: public
1005
- Type: asset
1006
- ID: abc123xyz
1007
- ```
631
+ | Type | Domain | Example path |
632
+ |------|--------|-------------|
633
+ | `video` | `stream.mux.com` | `/{id}.m3u8?token=...` |
634
+ | `thumbnail` | `image.mux.com` | `/{id}/thumbnail.png?token=...` |
635
+ | `gif` | `image.mux.com` | `/{id}/animated.gif?token=...` |
636
+ | `storyboard` | `image.mux.com` | `/{id}/storyboard.vtt?token=...` |
1008
637
 
1009
- **Output (with --expand):**
638
+ **Thumbnail parameters** (embedded in JWT via `--param`):
1010
639
 
1011
- When using `--expand`, the output will be the full asset or live stream object, formatted the same as `mux assets get` or `mux live get` commands.
640
+ | Parameter | Description |
641
+ |-----------|-------------|
642
+ | `time` | Video timestamp in seconds |
643
+ | `width` | Width in pixels |
644
+ | `height` | Height in pixels |
645
+ | `rotate` | Clockwise rotation: 90, 180, or 270 |
646
+ | `fit_mode` | `preserve`, `stretch`, `crop`, `smartcrop`, `pad` |
647
+ | `flip_v` | Flip vertically |
648
+ | `flip_h` | Flip horizontally |
1012
649
 
1013
- **Note:** The nested `playback-ids` commands under `assets` and `live` (e.g., `mux assets playback-ids list`) are for managing playback IDs on known resources. This top-level command is for discovering what resource a playback ID belongs to.
650
+ **Prerequisite:** You must have a signing key in your current environment. Run `mux signing-keys create` to set one up.
1014
651
 
1015
- ### Signing Keys & Secure Playback
652
+ </details>
1016
653
 
1017
- #### `mux signing-keys create`
654
+ <details>
655
+ <summary><h3>Transcription Vocabularies</h3></summary>
1018
656
 
1019
- Create a new signing key for secure video playback and automatically save it to the current environment.
657
+ Manage custom transcription vocabularies to improve automatic speech recognition accuracy for domain-specific terms.
1020
658
 
1021
- **Options:**
1022
- - `--json` - Output JSON instead of pretty format
659
+ #### `mux transcription-vocabularies create`
1023
660
 
1024
- **Examples:**
661
+ **Options:**
662
+ - `--phrase <phrase>` - Phrase to include (required, repeatable)
663
+ - `--name <name>` - Name for the vocabulary
664
+ - `--passthrough <string>` - Passthrough metadata (max 255 characters)
1025
665
 
1026
666
  ```bash
1027
- # Create a new signing key
1028
- mux signing-keys create
1029
-
1030
- # Create a signing key with JSON output
1031
- mux signing-keys create --json
1032
- ```
1033
-
1034
- **Output:**
1035
-
1036
- ```
1037
- Signing key created and saved to environment: default
1038
- Key ID: qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
667
+ mux transcription-vocabularies create --phrase "Mux" --phrase "HLS" --phrase "RTMP" --name "Streaming Terms"
1039
668
  ```
1040
669
 
1041
- **Important:** The private key is only returned once during creation. The CLI automatically stores it in your current environment configuration, so you don't need to manually save it.
670
+ #### `mux transcription-vocabularies list`
1042
671
 
1043
- #### `mux signing-keys list`
672
+ List vocabularies. Supports `--limit`, `--page`, `--compact`.
1044
673
 
1045
- List all signing keys with indicators showing which keys are configured in local environments.
674
+ #### `mux transcription-vocabularies get <vocabulary-id>`
1046
675
 
1047
- **Options:**
1048
- - `--json` - Output JSON instead of pretty format
1049
-
1050
- **Examples:**
676
+ Get details about a vocabulary.
1051
677
 
1052
- ```bash
1053
- # List all signing keys
1054
- mux signing-keys list
678
+ #### `mux transcription-vocabularies update <vocabulary-id>`
1055
679
 
1056
- # List signing keys with JSON output
1057
- mux signing-keys list --json
1058
- ```
680
+ Update a vocabulary. This replaces all existing phrases.
1059
681
 
1060
- **Output:**
682
+ **Options:** `--phrase <phrase>` (required, repeatable), `--name <name>`, `--passthrough <string>`
1061
683
 
1062
- ```
1063
- Found 2 signing key(s):
684
+ #### `mux transcription-vocabularies delete <vocabulary-id>`
1064
685
 
1065
- Key ID: qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
1066
- Created: 1234567890
1067
- Active in environments: production, staging
686
+ Delete a vocabulary. Supports `--force`.
1068
687
 
1069
- Key ID: abc123def456ghi789jkl012mno345pq
1070
- Created: 1234567891
1071
- Active in environments: development
1072
- ```
688
+ </details>
1073
689
 
1074
- #### `mux signing-keys get <key-id>`
690
+ <details>
691
+ <summary><h3>Delivery Usage</h3></summary>
1075
692
 
1076
- Get detailed information about a specific signing key.
693
+ #### `mux delivery-usage list`
1077
694
 
1078
- **Arguments:**
1079
- - `<key-id>` - The ID of the signing key to retrieve
695
+ List delivery usage reports for video assets and live streams.
1080
696
 
1081
697
  **Options:**
1082
- - `--json` - Output JSON instead of pretty format
1083
-
1084
- **Examples:**
698
+ - `--asset-id <id>` - Filter by asset ID
699
+ - `--live-stream-id <id>` - Filter by live stream ID
700
+ - `--timeframe <timeframe>` - Timeframe as Unix epoch timestamps (specify twice for start and end)
1085
701
 
1086
702
  ```bash
1087
- # Get signing key details
1088
- mux signing-keys get qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
1089
-
1090
- # Get signing key details as JSON
1091
- mux signing-keys get qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ --json
1092
- ```
1093
-
1094
- **Output:**
1095
-
1096
- ```
1097
- Signing Key ID: qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
1098
- Created: 1234567890
1099
- Active in environments: production
703
+ mux delivery-usage list
704
+ mux delivery-usage list --asset-id abc123xyz
1100
705
  ```
1101
706
 
1102
- #### `mux signing-keys delete <key-id>`
707
+ Supports `--limit`, `--page`, `--compact`.
1103
708
 
1104
- Delete a signing key permanently. This will invalidate all signed URLs created with this key.
709
+ </details>
1105
710
 
1106
- **Arguments:**
1107
- - `<key-id>` - The ID of the signing key to delete
711
+ <details>
712
+ <summary><h3>DRM Configurations</h3></summary>
1108
713
 
1109
- **Options:**
1110
- - `-f, --force` - Skip confirmation prompt
1111
- - `--json` - Output JSON instead of pretty format
1112
-
1113
- **Examples:**
714
+ View DRM configurations for your Mux environment. DRM configurations are provisioned by Mux and are read-only.
1114
715
 
1115
716
  ```bash
1116
- # Delete signing key with confirmation prompt
1117
- mux signing-keys delete qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
1118
-
1119
- # Delete signing key without confirmation
1120
- mux signing-keys delete qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ --force
1121
-
1122
- # Delete signing key with JSON output
1123
- mux signing-keys delete qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ --force --json
717
+ mux drm-configurations list
718
+ mux drm-configurations get <drm-configuration-id>
1124
719
  ```
1125
720
 
1126
- **Important:** Deleting a signing key will invalidate all tokens and signed URLs created with that key. If the key is configured in any local environment, it will be automatically removed from those environment configurations.
721
+ </details>
1127
722
 
1128
- **Output:**
723
+ <details>
724
+ <summary><h3>Mux Data</h3></summary>
1129
725
 
1130
- ```
1131
- WARNING: This signing key is configured in the following environments: production
726
+ Commands for video analytics, monitoring, and incident tracking via the Mux Data API.
1132
727
 
1133
- Deleting this key will invalidate all signed URLs created with it.
1134
- Are you sure you want to delete signing key qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ? (y/n): y
728
+ #### Video Views
1135
729
 
1136
- Signing key qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ deleted successfully
1137
- Removed from environment: production
730
+ ```bash
731
+ mux video-views list [--filters "country:US"] [--timeframe "24:hours"] [--viewer-id <id>] [--error-id <id>]
732
+ mux video-views get <view-id>
1138
733
  ```
1139
734
 
1140
- #### `mux sign <playback-id>`
735
+ **List options:** `--filters`, `--metric-filters`, `--timeframe`, `--viewer-id`, `--error-id`, `--order-direction`, `--limit`, `--page`, `--compact`
1141
736
 
1142
- Sign a playback ID to generate a secure URL for video playback, thumbnails, GIFs, or storyboards. This is used with assets or live streams that have a `signed` playback policy.
737
+ #### Metrics
1143
738
 
1144
- **Arguments:**
1145
- - `<playback-id>` - The playback ID to sign
739
+ ```bash
740
+ # List available metrics
741
+ mux metrics list [--dimension <dimension>] [--value <value>]
1146
742
 
1147
- **Options:**
1148
- - `-e, --expiration <duration>` - Token expiration duration (default: '7d')
1149
- - Examples: '7d', '24h', '1h', '30m'
1150
- - `-t, --type <type>` - Token type: `video`, `thumbnail`, `gif`, `storyboard` (default: 'video')
1151
- - `-p, --param <key=value>` - JWT claim as key=value (repeatable). Used to embed parameters like `time`, `width`, or `height` directly in the signed token.
1152
- - `--params-json <json>` - JWT claims as a JSON object. Useful for complex claims including nested values like `custom`.
1153
- - `--json` - Output JSON instead of pretty format
1154
- - `--token-only` - Output only the JWT token (no URL)
743
+ # Breakdown by dimension
744
+ mux metrics breakdown <metric-id> --group-by country --measurement median
1155
745
 
1156
- When `--param` and `--params-json` are both provided, `--params-json` is applied first as a base layer and `--param` values override on top.
746
+ # Overall metric values
747
+ mux metrics overall <metric-id> [--measurement avg]
1157
748
 
1158
- **Examples:**
749
+ # Timeseries data
750
+ mux metrics timeseries <metric-id> [--group-by hour]
1159
751
 
1160
- ```bash
1161
- # Sign a playback ID with default settings (7 day expiration, video type)
1162
- mux sign abc123playbackid
752
+ # Performance insights
753
+ mux metrics insights <metric-id> [--measurement 95th]
754
+ ```
1163
755
 
1164
- # Sign with custom expiration
1165
- mux sign abc123playbackid --expiration 24h
756
+ **Common options:** `--measurement <95th|median|avg|count|sum>`, `--filters`, `--metric-filters`, `--timeframe`
1166
757
 
1167
- # Sign for thumbnail access at a specific time
1168
- mux sign abc123playbackid --type thumbnail --param time=14
758
+ **Breakdown/timeseries also support:** `--group-by`, `--order-by`, `--order-direction`, `--limit`, `--page`, `--compact`
1169
759
 
1170
- # Sign for thumbnail with dimensions
1171
- mux sign abc123playbackid --type thumbnail --param time=14 --param width=100
760
+ #### Monitoring
1172
761
 
1173
- # Sign for animated GIF
1174
- mux sign abc123playbackid --type gif
762
+ Real-time monitoring data from Mux Data.
1175
763
 
1176
- # Sign with custom claims for tracking (nested under "custom" in JWT)
1177
- mux sign abc123playbackid --params-json '{"custom": {"session_id": "xxxx-123"}}'
764
+ ```bash
765
+ mux monitoring dimensions # list available dimensions
766
+ mux monitoring metrics # list available metrics
767
+ mux monitoring breakdown <metric-id> [--dimension <d>] [--timestamp <ts>]
768
+ mux monitoring breakdown-timeseries <metric-id> [--dimension <d>]
769
+ mux monitoring histogram-timeseries [--filters ...]
770
+ mux monitoring timeseries <metric-id> [--timestamp <ts>]
771
+ ```
1178
772
 
1179
- # Get JSON output with full details
1180
- mux sign abc123playbackid --json
773
+ #### Incidents
1181
774
 
1182
- # Get only the JWT token for scripting
1183
- mux sign abc123playbackid --token-only
775
+ ```bash
776
+ mux incidents list [--status open] [--severity alert]
777
+ mux incidents get <incident-id>
778
+ mux incidents related <incident-id>
1184
779
  ```
1185
780
 
1186
- **Output:**
1187
-
1188
- The output URL uses the appropriate domain based on the token type:
781
+ **List options:** `--status <open|closed|expired>`, `--severity <warning|alert>`, `--order-by`, `--order-direction`, `--limit`, `--page`, `--compact`
1189
782
 
1190
- ```bash
1191
- # Video (default) - uses stream.mux.com
1192
- mux sign abc123playbackid
1193
- https://stream.mux.com/abc123playbackid.m3u8?token=eyJ...
783
+ #### Annotations
1194
784
 
1195
- # Thumbnail - uses image.mux.com
1196
- mux sign abc123playbackid --type thumbnail --param time=14
1197
- https://image.mux.com/abc123playbackid/thumbnail.png?token=eyJ...
785
+ Mark significant events (deployments, config changes, etc.) on your analytics timeline.
1198
786
 
1199
- # GIF - uses image.mux.com
1200
- mux sign abc123playbackid --type gif
1201
- https://image.mux.com/abc123playbackid/animated.gif?token=eyJ...
787
+ ```bash
788
+ # Create annotation
789
+ mux annotations create --date 1700000000 --note "Deployed v2.1.0" [--sub-property-id <id>]
1202
790
 
1203
- # Storyboard - uses image.mux.com
1204
- mux sign abc123playbackid --type storyboard
1205
- https://image.mux.com/abc123playbackid/storyboard.vtt?token=eyJ...
791
+ # List, get, update, delete
792
+ mux annotations list [--timeframe ...]
793
+ mux annotations get <annotation-id>
794
+ mux annotations update <annotation-id> --date <timestamp> --note <text>
795
+ mux annotations delete <annotation-id> [--force]
1206
796
  ```
1207
797
 
1208
- **Thumbnail Parameters:**
798
+ #### Dimensions
1209
799
 
1210
- When signing thumbnails, parameters like `time` and `width` must be embedded in the JWT claims (not as query parameters). The `--param` flag handles this automatically:
800
+ ```bash
801
+ mux dimensions list # list available dimensions
802
+ mux dimensions values <dimension-id> [--timeframe "24:hours"]
803
+ ```
1211
804
 
1212
- | Parameter | Description |
1213
- |-----------|-------------|
1214
- | `time` | Video timestamp in seconds for the thumbnail |
1215
- | `width` | Thumbnail width in pixels |
1216
- | `height` | Thumbnail height in pixels |
1217
- | `rotate` | Rotate clockwise: 90, 180, or 270 |
1218
- | `fit_mode` | How to fit: `preserve`, `stretch`, `crop`, `smartcrop`, `pad` |
1219
- | `flip_v` | Flip vertically |
1220
- | `flip_h` | Flip horizontally |
805
+ #### Errors
1221
806
 
1222
- **Prerequisites:**
807
+ ```bash
808
+ mux errors list [--filters ...] [--timeframe ...]
809
+ ```
1223
810
 
1224
- Before using `mux sign`, you must have a signing key configured in your current environment:
811
+ #### Exports
1225
812
 
1226
813
  ```bash
1227
- # Create and configure a signing key
1228
- mux signing-keys create
814
+ mux exports list # list video view export files
1229
815
  ```
1230
816
 
1231
- If no signing keys are configured, the command will provide helpful instructions on how to set one up.
817
+ </details>
1232
818
 
1233
- ### Authentication & Environment Management
819
+ <details>
820
+ <summary><h3>Authentication & Environment Management</h3></summary>
1234
821
 
1235
822
  #### `mux login`
1236
823
 
1237
824
  Authenticate with Mux and save credentials.
1238
825
 
1239
826
  **Options:**
1240
- - `-f, --env-file <path>` - Path to .env file containing credentials
1241
- - `-n, --name <name>` - Name for this environment (default: "default")
1242
-
1243
- **Examples:**
827
+ - `-f, --env-file <path>` - Path to .env file containing `MUX_TOKEN_ID` and `MUX_TOKEN_SECRET`
828
+ - `-n, --name <name>` - Name for this environment (default: `default`)
1244
829
 
1245
830
  ```bash
1246
- # Interactive login
1247
- mux login
1248
-
1249
- # Login with .env file
1250
- mux login --env-file .env
1251
-
1252
- # Login with a named environment
1253
- mux login --name production --env-file .env.production
831
+ mux login # interactive
832
+ mux login --env-file .env # from .env file
833
+ mux login --name production --env-file .env.prod # named environment
1254
834
  ```
1255
835
 
1256
836
  #### `mux logout <name>`
1257
837
 
1258
- Remove credentials for a specific environment.
1259
-
1260
- **Arguments:**
1261
- - `<name>` - Name of the environment to remove
1262
-
1263
- **Examples:**
838
+ Remove credentials for a specific environment. When you remove the default environment, the CLI automatically selects another as the new default.
1264
839
 
1265
840
  ```bash
1266
- # Remove the default environment
1267
841
  mux logout default
1268
-
1269
- # Remove a named environment
1270
842
  mux logout staging
1271
843
  ```
1272
844
 
1273
- When you remove the default environment, the CLI automatically selects another environment as the new default.
1274
-
1275
845
  #### `mux env list`
1276
846
 
1277
847
  Display all configured environments.
1278
848
 
1279
- **Examples:**
1280
-
1281
849
  ```bash
1282
850
  mux env list
1283
851
  ```
1284
852
 
1285
- **Output:**
1286
- ```
1287
- Configured environments:
1288
-
1289
- * production (default)
1290
- staging
1291
- development
1292
-
1293
- 3 environments total
1294
- ```
1295
-
1296
853
  #### `mux env switch <name>`
1297
854
 
1298
855
  Change the default environment.
1299
856
 
1300
- **Arguments:**
1301
- - `<name>` - Name of the environment to set as default
1302
-
1303
- **Examples:**
1304
-
1305
857
  ```bash
1306
- # Switch to staging environment
1307
858
  mux env switch staging
1308
859
  ```
1309
860
 
861
+ </details>
862
+
1310
863
  ## Configuration
1311
864
 
1312
865
  Credentials are stored securely in `~/.config/mux/config.json` with restrictive file permissions (readable/writable only by the owner).
@@ -1353,8 +906,6 @@ pnpm run build
1353
906
 
1354
907
  ### Testing
1355
908
 
1356
- The project includes comprehensive test coverage for core functionality:
1357
-
1358
909
  ```bash
1359
910
  # Run all tests
1360
911
  bun test
@@ -1367,64 +918,52 @@ bun test --watch
1367
918
 
1368
919
  ```
1369
920
  src/
1370
- ├── commands/ # CLI command definitions
1371
- │ ├── assets/ # Asset management commands
1372
- │ │ ├── manage/ # Interactive TUI for asset management
1373
- │ │ ├── index.ts # TUI command entry point
1374
- │ │ │ └── AssetManageApp.tsx # Main TUI application
1375
- │ │ ├── playback-ids/ # Playback ID commands for assets
1376
- │ │ ├── index.ts # Main playback-ids command
1377
- │ │ ├── create.ts # Create playback IDs
1378
- │ │ │ ├── list.ts # List playback IDs
1379
- │ │ └── delete.ts # Delete playback IDs
1380
- │ │ ├── index.ts # Main assets command
1381
- │ │ ├── create.ts # Create assets
1382
- │ │ ├── list.ts # List assets
1383
- │ │ ├── get.ts # Get asset details
1384
- │ │ ├── update.ts # Update asset metadata
1385
- │ │ └── delete.ts # Delete assets
1386
- │ ├── live/ # Live stream management commands
1387
- │ │ ├── playback-ids/ # Playback ID commands for live streams
1388
- │ │ │ ├── index.ts # Main playback-ids command
1389
- │ │ ├── create.ts # Create playback IDs
1390
- │ │ ├── list.ts # List playback IDs
1391
- │ └── delete.ts # Delete playback IDs
1392
- ├── index.ts # Main live command
1393
- ├── create.ts # Create live streams
1394
- ├── list.ts # List live streams
1395
- ├── get.ts # Get live stream details
1396
- │ └── delete.ts # Delete live streams
1397
- │ ├── signing-keys/ # Signing key management commands
1398
- ├── index.ts # Main signing-keys command
1399
- ├── create.ts # Create signing keys
1400
- ├── list.ts # List signing keys
1401
- ├── get.ts # Get signing key details
1402
- │ └── delete.ts # Delete signing keys
1403
- │ ├── env/ # Environment management commands
1404
- ├── index.ts # Main env command
1405
- │ ├── list.ts # List environments
1406
- │ │ └── switch.ts # Switch default environment
1407
- │ ├── login.ts # Login command
1408
- │ ├── logout.ts # Logout command
1409
- └── sign.ts # Sign playback IDs command
1410
- ├── lib/ # Shared libraries
1411
- │ ├── tui/ # Reusable TUI components
1412
- ├── index.ts # TUI exports
1413
- ├── renderer.tsx # OpenTUI renderer setup
1414
- │ ├── SelectList.tsx # Reusable selection list component
1415
- │ │ ├── ActionMenu.tsx # Reusable action menu component
1416
- │ │ ├── ConfirmDialog.tsx # Reusable confirmation dialog
1417
- │ │ └── clipboard.ts # Clipboard utilities
1418
- │ ├── config.ts # Configuration management
1419
- │ ├── formatters.ts # Shared output formatting (timestamps, durations, statuses)
1420
- │ ├── mux.ts # Mux API integration and auth helpers
1421
- │ ├── json-config.ts # JSON configuration parsing
1422
- │ ├── file-upload.ts # File upload utilities
1423
- │ ├── urls.ts # URL generation (stream, player, thumbnail, gif, storyboard)
1424
- │ ├── signing.ts # JWT signing utilities
1425
- │ ├── playback-ids.ts # Playback ID operations
1426
- │ └── xdg.ts # XDG base directory support
1427
- └── index.ts # CLI entry point
921
+ ├── commands/ # CLI command definitions
922
+ │ ├── assets/ # Asset management
923
+ │ │ ├── manage/ # Interactive TUI
924
+ │ │ ├── playback-ids/ # Playback ID sub-resource
925
+ │ │ ├── static-renditions/ # Static rendition sub-resource
926
+ │ │ ├── tracks/ # Track management (subtitles, audio)
927
+ │ │ ├── create.ts, list.ts, get.ts, update.ts, delete.ts
928
+ │ │ ├── input-info.ts # Retrieve input info
929
+ │ │ └── update-master-access.ts # Update master access settings
930
+ ├── live/ # Live stream management
931
+ │ │ ├── playback-ids/ # Playback ID sub-resource
932
+ │ │ ├── simulcast-targets/ # Simulcast target sub-resource
933
+ │ │ ├── create.ts, list.ts, get.ts, update.ts, delete.ts
934
+ │ │ ├── complete.ts, enable.ts, disable.ts
935
+ │ │ ├── reset-stream-key.ts
936
+ │ │ ├── update-embedded-subtitles.ts
937
+ ├── update-generated-subtitles.ts
938
+ │ │ ├── update-new-asset-static-renditions.ts
939
+ │ │ └── delete-new-asset-static-renditions.ts
940
+ │ ├── uploads/ # Direct upload management
941
+ │ ├── playback-restrictions/ # Playback restriction management
942
+ ├── transcription-vocabularies/ # Transcription vocabulary management
943
+ │ ├── delivery-usage/ # Delivery usage reports
944
+ │ ├── drm-configurations/ # DRM configuration management
945
+ │ ├── signing-keys/ # Signing key management
946
+ │ ├── video-views/ # Mux Data: video view analytics
947
+ ├── metrics/ # Mux Data: metric analytics
948
+ │ ├── monitoring/ # Mux Data: real-time monitoring
949
+ │ ├── incidents/ # Mux Data: incident tracking
950
+ │ ├── annotations/ # Mux Data: annotation management
951
+ │ ├── dimensions/ # Mux Data: dimension queries
952
+ │ ├── errors/ # Mux Data: error analytics
953
+ ├── exports/ # Mux Data: export files
954
+ │ ├── env/ # Environment management
955
+ │ ├── login.ts, logout.ts, sign.ts # Auth & signing commands
956
+ └── playback-ids.ts # Playback ID lookup
957
+ ├── lib/ # Shared libraries
958
+ │ ├── tui/ # Reusable TUI components
959
+ │ ├── config.ts # Configuration management
960
+ ├── formatters.ts # Output formatting
961
+ ├── data-filters.ts # Mux Data filter utilities
962
+ │ ├── mux.ts # Mux API client
963
+ │ ├── urls.ts # URL generation
964
+ │ ├── signing.ts # JWT signing
965
+ └── ... # Other utilities
966
+ └── index.ts # CLI entry point
1428
967
  ```
1429
968
 
1430
969
  ## License