@mux/cli 0.8.0 → 1.0.0-beta.1
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/LICENSE +13 -0
- package/README.md +1216 -259
- package/bin/mux +31 -0
- package/package.json +64 -103
- package/bin/run +0 -6
- package/bin/run.cmd +0 -3
- package/lib/command-bases/asset-base.d.ts +0 -11
- package/lib/command-bases/asset-base.js +0 -41
- package/lib/command-bases/base.d.ts +0 -14
- package/lib/command-bases/base.js +0 -62
- package/lib/command-bases/live-base.d.ts +0 -11
- package/lib/command-bases/live-base.js +0 -31
- package/lib/commands/assets/create.d.ts +0 -10
- package/lib/commands/assets/create.js +0 -64
- package/lib/commands/assets/upload.d.ts +0 -20
- package/lib/commands/assets/upload.js +0 -148
- package/lib/commands/init.d.ts +0 -20
- package/lib/commands/init.js +0 -115
- package/lib/commands/live/complete.d.ts +0 -12
- package/lib/commands/live/complete.js +0 -54
- package/lib/commands/live/disable.d.ts +0 -13
- package/lib/commands/live/disable.js +0 -40
- package/lib/commands/live/enable.d.ts +0 -13
- package/lib/commands/live/enable.js +0 -40
- package/lib/commands/sign.d.ts +0 -11
- package/lib/commands/sign.js +0 -68
- package/lib/commands/spaces/sign.d.ts +0 -11
- package/lib/commands/spaces/sign.js +0 -79
- package/lib/config.d.ts +0 -10
- package/lib/config.js +0 -12
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -7
- package/oclif.manifest.json +0 -1
- package/src/command-bases/asset-base.ts +0 -52
- package/src/command-bases/base.ts +0 -72
- package/src/command-bases/live-base.ts +0 -35
- package/src/commands/assets/create.ts +0 -74
- package/src/commands/assets/upload.ts +0 -192
- package/src/commands/init.ts +0 -150
- package/src/commands/live/complete.ts +0 -63
- package/src/commands/live/disable.ts +0 -47
- package/src/commands/live/enable.ts +0 -47
- package/src/commands/sign.ts +0 -76
- package/src/commands/spaces/sign.ts +0 -90
- package/src/config.ts +0 -13
- package/src/index.ts +0 -3
- package/yarn.lock +0 -7350
package/README.md
CHANGED
|
@@ -1,420 +1,1377 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
# Mux CLI
|
|
2
|
+
|
|
3
|
+
A command-line interface for interacting with the Mux API, designed to provide a first-class development experience for working with Mux services locally.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Install via npm
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @mux/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or run directly with npx:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx @mux/cli@latest
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Shell installer
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
curl -fsSL https://raw.githubusercontent.com/muxinc/cli/master/install.sh | bash
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Download the binary
|
|
26
|
+
|
|
27
|
+
Download the latest binary for your platform from [GitHub Releases](https://github.com/muxinc/cli/releases):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# macOS (Apple Silicon)
|
|
31
|
+
curl -L https://github.com/muxinc/cli/releases/latest/download/mux-darwin-arm64 -o mux
|
|
32
|
+
chmod +x mux
|
|
33
|
+
sudo mv mux /usr/local/bin/
|
|
34
|
+
|
|
35
|
+
# macOS (Intel)
|
|
36
|
+
curl -L https://github.com/muxinc/cli/releases/latest/download/mux-darwin-x64 -o mux
|
|
37
|
+
chmod +x mux
|
|
38
|
+
sudo mv mux /usr/local/bin/
|
|
39
|
+
|
|
40
|
+
# Linux (x64)
|
|
41
|
+
curl -L https://github.com/muxinc/cli/releases/latest/download/mux-linux-x64 -o mux
|
|
42
|
+
chmod +x mux
|
|
43
|
+
sudo mv mux /usr/local/bin/
|
|
44
|
+
|
|
45
|
+
# Linux (arm64)
|
|
46
|
+
curl -L https://github.com/muxinc/cli/releases/latest/download/mux-linux-arm64 -o mux
|
|
47
|
+
chmod +x mux
|
|
48
|
+
sudo mv mux /usr/local/bin/
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The binary is self-contained and has no dependencies.
|
|
52
|
+
|
|
53
|
+
## Getting Started
|
|
54
|
+
|
|
55
|
+
### Authentication
|
|
56
|
+
|
|
57
|
+
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).
|
|
58
|
+
|
|
59
|
+
#### Interactive Login
|
|
60
|
+
|
|
61
|
+
The simplest way to authenticate:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
mux login
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
You'll be prompted to enter your Mux Token ID and Token Secret. The CLI will validate your credentials before saving them.
|
|
68
|
+
|
|
69
|
+
#### Login with .env File
|
|
70
|
+
|
|
71
|
+
If you have your credentials in a `.env` file:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
mux login --env-file .env
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Your `.env` file should contain:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
MUX_TOKEN_ID=your_token_id
|
|
81
|
+
MUX_TOKEN_SECRET=your_token_secret
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### Named Environments
|
|
85
|
+
|
|
86
|
+
You can manage multiple environments (e.g., production, staging, development):
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Add a production environment
|
|
90
|
+
mux login --name production
|
|
91
|
+
|
|
92
|
+
# Add a staging environment
|
|
93
|
+
mux login --name staging
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The first environment you add becomes the default. You can switch between environments later.
|
|
97
|
+
|
|
98
|
+
## Commands
|
|
99
|
+
|
|
100
|
+
### Asset Management
|
|
101
|
+
|
|
102
|
+
#### `mux assets create`
|
|
103
|
+
|
|
104
|
+
Create a new Mux video asset from a URL, local file, or JSON configuration.
|
|
105
|
+
|
|
106
|
+
**Options:**
|
|
107
|
+
- `--url <url>` - Video URL to ingest from the web
|
|
108
|
+
- `--upload <path>` - Local file(s) to upload (supports glob patterns like `*.mp4` or `videos/**/*.mp4`)
|
|
109
|
+
- `--file, -f <path>` - JSON configuration file for complex asset creation
|
|
110
|
+
- `--playback-policy <policy>` - Playback policy: `public` or `signed` (can be specified multiple times)
|
|
111
|
+
- `--test` - Create test asset (watermarked, 10s limit, deleted after 24h)
|
|
112
|
+
- `--passthrough <string>` - User metadata (max 255 characters)
|
|
113
|
+
- `--static-renditions <resolution>` - Static rendition resolutions: `highest`, `audio-only`, `2160p`, `1440p`, `1080p`, `720p`, `540p`, `480p`, `360p`, `270p` (can be specified multiple times)
|
|
114
|
+
- `--video-quality <quality>` - Video quality level: `basic`, `plus`, or `premium`
|
|
115
|
+
- `--normalize-audio` - Normalize audio loudness level
|
|
116
|
+
- `-y, --yes` - Skip confirmation prompts
|
|
117
|
+
- `--json` - Output JSON instead of pretty format
|
|
118
|
+
- `--wait` - Wait for asset processing to complete (polls until ready)
|
|
119
|
+
|
|
120
|
+
**Examples:**
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Create asset from remote URL
|
|
124
|
+
mux assets create --url https://example.com/video.mp4 --playback-policy public
|
|
125
|
+
|
|
126
|
+
# Upload a single local file
|
|
127
|
+
mux assets create --upload video.mp4 --playback-policy public --test
|
|
128
|
+
|
|
129
|
+
# Upload multiple files with glob pattern
|
|
130
|
+
mux assets create --upload ./videos/*.mp4 --playback-policy public
|
|
131
|
+
# Shows confirmation prompt with file list and total size
|
|
132
|
+
|
|
133
|
+
# Skip confirmation for multiple files
|
|
134
|
+
mux assets create --upload ./videos/*.mp4 --playback-policy public -y
|
|
135
|
+
|
|
136
|
+
# Create asset with complex configuration from JSON file
|
|
137
|
+
mux assets create --file asset-config.json
|
|
138
|
+
|
|
139
|
+
# Override config file options with flags
|
|
140
|
+
mux assets create --file asset-config.json --test --playback-policy signed
|
|
141
|
+
|
|
142
|
+
# Wait for asset to be ready
|
|
143
|
+
mux assets create --url https://example.com/video.mp4 --playback-policy public --wait
|
|
144
|
+
|
|
145
|
+
# Get JSON output for scripting
|
|
146
|
+
mux assets create --url https://example.com/video.mp4 --playback-policy public --json
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**JSON Configuration File:**
|
|
150
|
+
|
|
151
|
+
For complex asset creation (overlays, subtitles, multiple input tracks), use a JSON configuration file:
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"input": [
|
|
156
|
+
{
|
|
157
|
+
"url": "https://example.com/video.mp4",
|
|
158
|
+
"overlay_settings": {
|
|
159
|
+
"url": "https://example.com/logo.png",
|
|
160
|
+
"vertical_align": "bottom",
|
|
161
|
+
"horizontal_align": "right",
|
|
162
|
+
"vertical_margin": "5%",
|
|
163
|
+
"horizontal_margin": "5%",
|
|
164
|
+
"opacity": "80%"
|
|
165
|
+
},
|
|
166
|
+
"generated_subtitles": [
|
|
167
|
+
{
|
|
168
|
+
"language_code": "en",
|
|
169
|
+
"name": "English"
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"playback_policies": ["signed"],
|
|
175
|
+
"video_quality": "plus",
|
|
176
|
+
"static_renditions": [{ "resolution": "1080p" }],
|
|
177
|
+
"normalize_audio": true,
|
|
178
|
+
"passthrough": "my-video-123"
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Then create the asset:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
mux assets create --file asset-config.json
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Multiple File Uploads:**
|
|
189
|
+
|
|
190
|
+
When using glob patterns, each file creates a separate asset:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
mux assets create --upload ./videos/*.mp4 --playback-policy public
|
|
194
|
+
# Creates 3 separate assets if 3 files match
|
|
195
|
+
|
|
196
|
+
# Output:
|
|
197
|
+
# Found 3 files to upload:
|
|
198
|
+
# - intro.mp4 (45.2 MB)
|
|
199
|
+
# - main.mp4 (128.7 MB)
|
|
200
|
+
# - outro.mp4 (23.1 MB)
|
|
201
|
+
# Total size: 197.1 MB
|
|
202
|
+
# Continue with upload? (y/n):
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
#### `mux assets list`
|
|
206
|
+
|
|
207
|
+
List all video assets with pagination and filtering options.
|
|
208
|
+
|
|
209
|
+
**Options:**
|
|
210
|
+
- `--limit <number>` - Number of results to return (default: 25)
|
|
211
|
+
- `--page <number>` - Page number for pagination (default: 1)
|
|
212
|
+
- `--upload-id <id>` - Filter assets by upload ID
|
|
213
|
+
- `--live-stream-id <id>` - Filter assets by live stream ID
|
|
214
|
+
- `--json` - Output JSON instead of pretty format
|
|
215
|
+
- `--compact` - Output one line per asset in grep-friendly format
|
|
216
|
+
|
|
217
|
+
**Examples:**
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
# List assets with default settings (25 assets, page 1)
|
|
221
|
+
mux assets list
|
|
222
|
+
|
|
223
|
+
# List first 10 assets
|
|
224
|
+
mux assets list --limit 10
|
|
225
|
+
|
|
226
|
+
# List second page of results
|
|
227
|
+
mux assets list --page 2
|
|
228
|
+
|
|
229
|
+
# Filter by upload ID
|
|
230
|
+
mux assets list --upload-id abc123xyz
|
|
231
|
+
|
|
232
|
+
# Get JSON output for scripting
|
|
233
|
+
mux assets list --json
|
|
234
|
+
|
|
235
|
+
# Get compact output for grep and parsing
|
|
236
|
+
mux assets list --compact
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Output (default pretty format):**
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
Found 3 asset(s):
|
|
243
|
+
|
|
244
|
+
sRkgb02SMJOjf72PFIkegcrZR3knHPEPG ready 0:09 07/25 14:16
|
|
245
|
+
Details:
|
|
246
|
+
├─ Aspect Ratio: 240:427
|
|
247
|
+
├─ Resolution: 720p
|
|
248
|
+
└─ Quality: plus
|
|
249
|
+
Meta:
|
|
250
|
+
└─ Title: golf-swing
|
|
251
|
+
Playback IDs:
|
|
252
|
+
├─ 🔓 rFHdcXSf95EHT32qYnf6ZnBz01D7VyKR4
|
|
253
|
+
└─ 🔒 qo5Y6CpYtdZBgQlI6VskadqdNcQQVdPh
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Output (with --compact flag):**
|
|
257
|
+
|
|
258
|
+
```
|
|
259
|
+
sRkgb02SMJOjf72PFIkegcrZR3knHPEPG ready 0:09 07/25 14:16 720p "golf-swing" public,signed -
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
#### `mux assets get <asset-id>`
|
|
263
|
+
|
|
264
|
+
Get detailed information about a specific video asset.
|
|
265
|
+
|
|
266
|
+
**Arguments:**
|
|
267
|
+
- `<asset-id>` - The ID of the asset to retrieve
|
|
268
|
+
|
|
269
|
+
**Options:**
|
|
270
|
+
- `--json` - Output JSON instead of pretty format
|
|
271
|
+
|
|
272
|
+
**Examples:**
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
# Get asset details
|
|
276
|
+
mux assets get abc123xyz
|
|
277
|
+
|
|
278
|
+
# Get asset details as JSON
|
|
279
|
+
mux assets get abc123xyz --json
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Output:**
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
Asset ID: abc123xyz
|
|
286
|
+
Status: ready
|
|
287
|
+
Duration: 120.45s
|
|
288
|
+
Created: 1234567890
|
|
289
|
+
Aspect Ratio: 16:9
|
|
290
|
+
Resolution Tier: 1080p
|
|
291
|
+
Video Quality: plus
|
|
292
|
+
Max Resolution: HD
|
|
293
|
+
Max Frame Rate: 30.00 fps
|
|
294
|
+
|
|
295
|
+
Playback IDs:
|
|
296
|
+
- playback123 (public)
|
|
297
|
+
URL: https://stream.mux.com/playback123.m3u8
|
|
298
|
+
|
|
299
|
+
Tracks:
|
|
300
|
+
- audio: audio_track_id
|
|
301
|
+
Duration: 120.45s
|
|
302
|
+
- video: video_track_id
|
|
303
|
+
Duration: 120.45s
|
|
304
|
+
|
|
305
|
+
Passthrough: my-video-metadata
|
|
306
|
+
|
|
307
|
+
WARNING: This is a test asset (will be deleted after 24 hours)
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
#### `mux assets update <asset-id>`
|
|
311
|
+
|
|
312
|
+
Update metadata fields on a video asset.
|
|
313
|
+
|
|
314
|
+
**Arguments:**
|
|
315
|
+
- `<asset-id>` - The ID of the asset to update
|
|
316
|
+
|
|
317
|
+
**Options:**
|
|
318
|
+
- `--title <string>` - Set `meta.title` (max 512 characters)
|
|
319
|
+
- `--creator-id <string>` - Set `meta.creator_id` (max 128 characters)
|
|
320
|
+
- `--external-id <string>` - Set `meta.external_id` (max 128 characters)
|
|
321
|
+
- `--passthrough <string>` - Set `passthrough` (max 255 characters)
|
|
322
|
+
- `--json` - Output JSON instead of pretty format
|
|
323
|
+
|
|
324
|
+
At least one field flag must be provided.
|
|
325
|
+
|
|
326
|
+
**Examples:**
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
# Set a title on an asset
|
|
330
|
+
mux assets update abc123xyz --title "My Video"
|
|
331
|
+
|
|
332
|
+
# Set multiple fields at once
|
|
333
|
+
mux assets update abc123xyz --title "My Video" --creator-id "user-42" --external-id "vid-001"
|
|
334
|
+
|
|
335
|
+
# Update passthrough metadata
|
|
336
|
+
mux assets update abc123xyz --passthrough "my-custom-metadata"
|
|
337
|
+
|
|
338
|
+
# Clear a field by passing an empty string
|
|
339
|
+
mux assets update abc123xyz --title ""
|
|
340
|
+
|
|
341
|
+
# Get JSON output
|
|
342
|
+
mux assets update abc123xyz --title "My Video" --json
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
**Output:**
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
Asset updated successfully.
|
|
349
|
+
|
|
350
|
+
Asset ID: abc123xyz
|
|
351
|
+
Status: ready
|
|
352
|
+
Duration: 120.45s
|
|
28
353
|
...
|
|
29
354
|
```
|
|
30
|
-
<!-- usagestop -->
|
|
31
355
|
|
|
32
|
-
|
|
356
|
+
#### `mux assets delete <asset-id>`
|
|
357
|
+
|
|
358
|
+
Delete a video asset permanently.
|
|
359
|
+
|
|
360
|
+
**Arguments:**
|
|
361
|
+
- `<asset-id>` - The ID of the asset to delete
|
|
362
|
+
|
|
363
|
+
**Options:**
|
|
364
|
+
- `-f, --force` - Skip confirmation prompt
|
|
365
|
+
- `--json` - Output JSON instead of pretty format
|
|
366
|
+
|
|
367
|
+
**Examples:**
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
# Delete asset with confirmation prompt
|
|
371
|
+
mux assets delete abc123xyz
|
|
372
|
+
|
|
373
|
+
# Delete asset without confirmation
|
|
374
|
+
mux assets delete abc123xyz --force
|
|
375
|
+
|
|
376
|
+
# Delete asset with JSON output (requires --force for safety)
|
|
377
|
+
mux assets delete abc123xyz --json --force
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
**Important:** When using `--json` output mode, you must also provide the `--force` flag. This safety feature prevents accidental deletions in automated scripts.
|
|
381
|
+
|
|
382
|
+
**Output:**
|
|
383
|
+
|
|
384
|
+
```
|
|
385
|
+
Are you sure you want to delete asset abc123xyz? (y/n): y
|
|
386
|
+
Asset abc123xyz deleted successfully
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### `mux assets manage`
|
|
390
|
+
|
|
391
|
+
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.
|
|
392
|
+
|
|
393
|
+
**Examples:**
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# Launch the interactive asset management TUI
|
|
397
|
+
mux assets manage
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**Features:**
|
|
401
|
+
|
|
402
|
+
- Browse all video assets with pagination
|
|
403
|
+
- View detailed asset information
|
|
404
|
+
- Create and delete playback IDs
|
|
405
|
+
- Copy stream URLs (HLS) to clipboard
|
|
406
|
+
- Copy player URLs to clipboard
|
|
407
|
+
- Delete assets with confirmation
|
|
408
|
+
- Automatic URL signing for signed playback policies
|
|
409
|
+
|
|
410
|
+
**Navigation:**
|
|
411
|
+
|
|
412
|
+
- **Arrow keys** - Navigate through assets and menu options
|
|
413
|
+
- **Enter** - Select an asset or action
|
|
414
|
+
- **q** - Quit or go back to previous view
|
|
415
|
+
- **Escape** - Cancel current operation
|
|
416
|
+
|
|
417
|
+
**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.
|
|
418
|
+
|
|
419
|
+
#### Playback ID Management
|
|
420
|
+
|
|
421
|
+
Playback IDs control access to your video assets. Each asset can have multiple playback IDs with different policies (public or signed).
|
|
422
|
+
|
|
423
|
+
##### `mux assets playback-ids list <asset-id>`
|
|
424
|
+
|
|
425
|
+
List all playback IDs for a specific asset.
|
|
426
|
+
|
|
427
|
+
**Arguments:**
|
|
428
|
+
- `<asset-id>` - The ID of the asset
|
|
429
|
+
|
|
430
|
+
**Options:**
|
|
431
|
+
- `--json` - Output JSON instead of pretty format
|
|
432
|
+
|
|
433
|
+
**Examples:**
|
|
434
|
+
|
|
435
|
+
```bash
|
|
436
|
+
# List playback IDs for an asset
|
|
437
|
+
mux assets playback-ids list abc123xyz
|
|
438
|
+
|
|
439
|
+
# Get JSON output
|
|
440
|
+
mux assets playback-ids list abc123xyz --json
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
**Output:**
|
|
444
|
+
|
|
445
|
+
```
|
|
446
|
+
Found 2 playback ID(s) for asset abc123xyz:
|
|
447
|
+
|
|
448
|
+
Playback ID: playback123
|
|
449
|
+
Policy: public
|
|
450
|
+
URL: https://stream.mux.com/playback123.m3u8
|
|
451
|
+
|
|
452
|
+
Playback ID: playback456
|
|
453
|
+
Policy: signed
|
|
454
|
+
URL: https://stream.mux.com/playback456.m3u8
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
##### `mux assets playback-ids create <asset-id>`
|
|
458
|
+
|
|
459
|
+
Create a new playback ID for an asset.
|
|
460
|
+
|
|
461
|
+
**Arguments:**
|
|
462
|
+
- `<asset-id>` - The ID of the asset
|
|
463
|
+
|
|
464
|
+
**Options:**
|
|
465
|
+
- `--policy <policy>` - Playback policy: `public` or `signed` (default: `public`)
|
|
466
|
+
- `--json` - Output JSON instead of pretty format
|
|
467
|
+
|
|
468
|
+
**Examples:**
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
# Create a public playback ID
|
|
472
|
+
mux assets playback-ids create abc123xyz
|
|
473
|
+
|
|
474
|
+
# Create a signed playback ID
|
|
475
|
+
mux assets playback-ids create abc123xyz --policy signed
|
|
476
|
+
|
|
477
|
+
# Get JSON output
|
|
478
|
+
mux assets playback-ids create abc123xyz --policy public --json
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
**Output:**
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
Playback ID created: playback123
|
|
485
|
+
Policy: public
|
|
486
|
+
URL: https://stream.mux.com/playback123.m3u8
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
##### `mux assets playback-ids delete <asset-id> <playback-id>`
|
|
490
|
+
|
|
491
|
+
Delete a playback ID from an asset.
|
|
33
492
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
* [`mux autocomplete [SHELL]`](#mux-autocomplete-shell)
|
|
38
|
-
* [`mux commands`](#mux-commands)
|
|
39
|
-
* [`mux help [COMMAND]`](#mux-help-command)
|
|
40
|
-
* [`mux init [ENVFILE]`](#mux-init-envfile)
|
|
41
|
-
* [`mux live:complete STREAMNAME`](#mux-livecomplete-streamname)
|
|
42
|
-
* [`mux live:disable STREAMNAME`](#mux-livedisable-streamname)
|
|
43
|
-
* [`mux live:enable STREAMNAME`](#mux-liveenable-streamname)
|
|
44
|
-
* [`mux plugins`](#mux-plugins)
|
|
45
|
-
* [`mux plugins:inspect PLUGIN...`](#mux-pluginsinspect-plugin)
|
|
46
|
-
* [`mux plugins:install PLUGIN...`](#mux-pluginsinstall-plugin)
|
|
47
|
-
* [`mux plugins:link PLUGIN`](#mux-pluginslink-plugin)
|
|
48
|
-
* [`mux plugins:uninstall PLUGIN...`](#mux-pluginsuninstall-plugin)
|
|
49
|
-
* [`mux plugins:update`](#mux-pluginsupdate)
|
|
50
|
-
* [`mux sign PLAYBACK-ID`](#mux-sign-playback-id)
|
|
51
|
-
* [`mux spaces:sign SPACE-ID`](#mux-spacessign-space-id)
|
|
52
|
-
* [`mux update [CHANNEL]`](#mux-update-channel)
|
|
493
|
+
**Arguments:**
|
|
494
|
+
- `<asset-id>` - The ID of the asset
|
|
495
|
+
- `<playback-id>` - The ID of the playback ID to delete
|
|
53
496
|
|
|
54
|
-
|
|
497
|
+
**Options:**
|
|
498
|
+
- `-f, --force` - Skip confirmation prompt
|
|
499
|
+
- `--json` - Output JSON instead of pretty format
|
|
55
500
|
|
|
56
|
-
|
|
501
|
+
**Examples:**
|
|
57
502
|
|
|
503
|
+
```bash
|
|
504
|
+
# Delete a playback ID with confirmation
|
|
505
|
+
mux assets playback-ids delete abc123xyz playback123
|
|
506
|
+
|
|
507
|
+
# Delete without confirmation
|
|
508
|
+
mux assets playback-ids delete abc123xyz playback123 --force
|
|
509
|
+
|
|
510
|
+
# Delete with JSON output
|
|
511
|
+
mux assets playback-ids delete abc123xyz playback123 --force --json
|
|
58
512
|
```
|
|
59
|
-
USAGE
|
|
60
|
-
$ mux assets:create INPUT
|
|
61
513
|
|
|
62
|
-
|
|
63
|
-
INPUT input URL for the file you'd like to create this asset from
|
|
514
|
+
**Output:**
|
|
64
515
|
|
|
65
|
-
OPTIONS
|
|
66
|
-
-p, --private add a private playback policy to the created asset
|
|
67
516
|
```
|
|
517
|
+
Are you sure you want to delete playback ID playback123 from asset abc123xyz? (y/n): y
|
|
518
|
+
Playback ID playback123 deleted successfully
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
#### Static Renditions Management
|
|
522
|
+
|
|
523
|
+
Static renditions are downloadable MP4 versions of your video assets at specific resolutions. Unlike streaming playback, these are complete files that can be downloaded.
|
|
524
|
+
|
|
525
|
+
##### `mux assets static-renditions list <asset-id>`
|
|
526
|
+
|
|
527
|
+
List all static renditions for a specific asset.
|
|
528
|
+
|
|
529
|
+
**Arguments:**
|
|
530
|
+
- `<asset-id>` - The ID of the asset
|
|
68
531
|
|
|
69
|
-
|
|
532
|
+
**Options:**
|
|
533
|
+
- `--json` - Output JSON instead of pretty format
|
|
70
534
|
|
|
71
|
-
|
|
535
|
+
**Examples:**
|
|
72
536
|
|
|
73
|
-
|
|
537
|
+
```bash
|
|
538
|
+
# List static renditions for an asset
|
|
539
|
+
mux assets static-renditions list abc123xyz
|
|
74
540
|
|
|
541
|
+
# Get JSON output
|
|
542
|
+
mux assets static-renditions list abc123xyz --json
|
|
75
543
|
```
|
|
76
|
-
USAGE
|
|
77
|
-
$ mux assets:upload PATH
|
|
78
544
|
|
|
79
|
-
|
|
80
|
-
PATH local path for the file (or folder) you'd like to upload
|
|
545
|
+
**Output:**
|
|
81
546
|
|
|
82
|
-
OPTIONS
|
|
83
|
-
-c, --concurrent=concurrent [default: 3] max number of files to upload at once
|
|
84
|
-
-f, --filter=filter regex that filters the selected destination if the provided path is a folder
|
|
85
|
-
-p, --private
|
|
86
547
|
```
|
|
548
|
+
Static renditions for asset abc123xyz:
|
|
87
549
|
|
|
88
|
-
|
|
550
|
+
1080p.mp4 [ready] 1920x1080 5.2 Mbps 42.3 MB
|
|
551
|
+
ID: rendition123
|
|
552
|
+
720p.mp4 [preparing] 1280x720 - -
|
|
553
|
+
ID: rendition456
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
##### `mux assets static-renditions create <asset-id>`
|
|
557
|
+
|
|
558
|
+
Create a new static rendition for an asset.
|
|
559
|
+
|
|
560
|
+
**Arguments:**
|
|
561
|
+
- `<asset-id>` - The ID of the asset
|
|
562
|
+
|
|
563
|
+
**Options:**
|
|
564
|
+
- `-r, --resolution <resolution>` - Target resolution (required): `highest`, `audio-only`, `2160p`, `1440p`, `1080p`, `720p`, `540p`, `480p`, `360p`, `270p`
|
|
565
|
+
- `-p, --passthrough <string>` - Custom metadata for the rendition (max 255 characters)
|
|
566
|
+
- `-w, --wait` - Wait for the rendition to be ready instead of returning immediately
|
|
567
|
+
- `--json` - Output JSON instead of pretty format
|
|
89
568
|
|
|
90
|
-
|
|
569
|
+
**Examples:**
|
|
91
570
|
|
|
92
|
-
|
|
571
|
+
```bash
|
|
572
|
+
# Create a 1080p rendition
|
|
573
|
+
mux assets static-renditions create abc123xyz --resolution 1080p
|
|
93
574
|
|
|
575
|
+
# Create and wait for completion
|
|
576
|
+
mux assets static-renditions create abc123xyz --resolution 720p --wait
|
|
577
|
+
|
|
578
|
+
# Create with custom metadata
|
|
579
|
+
mux assets static-renditions create abc123xyz --resolution 1080p --passthrough "web-download"
|
|
580
|
+
|
|
581
|
+
# Get JSON output
|
|
582
|
+
mux assets static-renditions create abc123xyz --resolution 1080p --json
|
|
94
583
|
```
|
|
95
|
-
USAGE
|
|
96
|
-
$ mux autocomplete [SHELL]
|
|
97
584
|
|
|
98
|
-
|
|
99
|
-
SHELL shell type
|
|
585
|
+
**Output:**
|
|
100
586
|
|
|
101
|
-
|
|
102
|
-
|
|
587
|
+
```
|
|
588
|
+
Static rendition created:
|
|
589
|
+
ID: rendition123
|
|
590
|
+
Name: 1080p.mp4
|
|
591
|
+
Resolution: 1080p
|
|
592
|
+
Status: preparing
|
|
103
593
|
|
|
104
|
-
|
|
105
|
-
$ mux autocomplete
|
|
106
|
-
$ mux autocomplete bash
|
|
107
|
-
$ mux autocomplete zsh
|
|
108
|
-
$ mux autocomplete --refresh-cache
|
|
594
|
+
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.
|
|
109
595
|
```
|
|
110
596
|
|
|
111
|
-
|
|
597
|
+
##### `mux assets static-renditions delete <asset-id> <rendition-id>`
|
|
598
|
+
|
|
599
|
+
Delete a static rendition from an asset.
|
|
600
|
+
|
|
601
|
+
**Arguments:**
|
|
602
|
+
- `<asset-id>` - The ID of the asset
|
|
603
|
+
- `<rendition-id>` - The ID of the rendition to delete
|
|
112
604
|
|
|
113
|
-
|
|
605
|
+
**Options:**
|
|
606
|
+
- `-f, --force` - Skip confirmation prompt
|
|
607
|
+
- `--json` - Output JSON instead of pretty format
|
|
114
608
|
|
|
115
|
-
|
|
609
|
+
**Examples:**
|
|
116
610
|
|
|
611
|
+
```bash
|
|
612
|
+
# Delete a static rendition with confirmation
|
|
613
|
+
mux assets static-renditions delete abc123xyz rendition123
|
|
614
|
+
|
|
615
|
+
# Delete without confirmation
|
|
616
|
+
mux assets static-renditions delete abc123xyz rendition123 --force
|
|
617
|
+
|
|
618
|
+
# Delete with JSON output
|
|
619
|
+
mux assets static-renditions delete abc123xyz rendition123 --force --json
|
|
117
620
|
```
|
|
118
|
-
USAGE
|
|
119
|
-
$ mux commands
|
|
120
621
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
-x, --extended show extra columns
|
|
124
|
-
--columns=columns only show provided columns (comma-separated)
|
|
125
|
-
--csv output is csv format [alias: --output=csv]
|
|
126
|
-
--filter=filter filter property by partial string matching, ex: name=foo
|
|
127
|
-
--hidden show hidden commands
|
|
128
|
-
--json Format output as json.
|
|
129
|
-
--no-header hide table header from output
|
|
130
|
-
--no-truncate do not truncate output to fit screen
|
|
131
|
-
--output=csv|json|yaml output in a more machine friendly format
|
|
132
|
-
--sort=sort property to sort by (prepend '-' for descending)
|
|
622
|
+
**Output:**
|
|
623
|
+
|
|
133
624
|
```
|
|
625
|
+
Are you sure you want to delete static rendition rendition123? (y/n): y
|
|
626
|
+
Static rendition rendition123 deleted from asset abc123xyz
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
### Live Stream Management
|
|
630
|
+
|
|
631
|
+
#### `mux live create`
|
|
632
|
+
|
|
633
|
+
Create a new Mux live stream for broadcasting.
|
|
634
|
+
|
|
635
|
+
**Options:**
|
|
636
|
+
- `--playback-policy <policy>` - Playback policy: `public` or `signed` (can be specified multiple times)
|
|
637
|
+
- `--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"]}'`)
|
|
638
|
+
- `--reconnect-window <seconds>` - Time in seconds a stream can be disconnected before being considered finished (default: 60)
|
|
639
|
+
- `--latency-mode <mode>` - Latency mode: `low`, `reduced`, or `standard` (default: `low`)
|
|
640
|
+
- `--test` - Create test live stream (deleted after 24h)
|
|
641
|
+
- `--json` - Output JSON instead of pretty format
|
|
642
|
+
|
|
643
|
+
**Examples:**
|
|
644
|
+
|
|
645
|
+
```bash
|
|
646
|
+
# Create a basic live stream with public playback
|
|
647
|
+
mux live create --playback-policy public
|
|
134
648
|
|
|
135
|
-
|
|
649
|
+
# Create a low-latency live stream
|
|
650
|
+
mux live create --playback-policy public --latency-mode low
|
|
136
651
|
|
|
137
|
-
|
|
652
|
+
# Create a stream that automatically saves to an asset
|
|
653
|
+
mux live create --playback-policy public --new-asset-settings '{"playback_policies": ["public"]}'
|
|
138
654
|
|
|
139
|
-
|
|
655
|
+
# Create a test stream (deleted after 24 hours)
|
|
656
|
+
mux live create --playback-policy public --test
|
|
140
657
|
|
|
658
|
+
# Create with extended reconnect window (5 minutes)
|
|
659
|
+
mux live create --playback-policy public --reconnect-window 300
|
|
660
|
+
|
|
661
|
+
# Get JSON output for scripting
|
|
662
|
+
mux live create --playback-policy public --json
|
|
141
663
|
```
|
|
142
|
-
USAGE
|
|
143
|
-
$ mux help [COMMAND]
|
|
144
664
|
|
|
145
|
-
|
|
146
|
-
|
|
665
|
+
**Output:**
|
|
666
|
+
|
|
667
|
+
```
|
|
668
|
+
Live stream created: abc123xyz
|
|
669
|
+
Status: idle
|
|
670
|
+
Stream Key: your-secret-stream-key
|
|
671
|
+
Playback URL: https://stream.mux.com/playback123.m3u8
|
|
147
672
|
|
|
148
|
-
|
|
149
|
-
--all see all commands in CLI
|
|
673
|
+
WARNING: This is a test stream (will be deleted after 24 hours)
|
|
150
674
|
```
|
|
151
675
|
|
|
152
|
-
|
|
676
|
+
**Using the Stream:**
|
|
677
|
+
|
|
678
|
+
Once created, you can stream to your live stream using the RTMP URL and stream key:
|
|
679
|
+
- **RTMP URL:** `rtmp://global-live.mux.com/app`
|
|
680
|
+
- **Stream Key:** The `stream_key` returned in the response
|
|
681
|
+
|
|
682
|
+
Configure your streaming software (OBS, Wirecast, etc.) with these values to start broadcasting.
|
|
683
|
+
|
|
684
|
+
#### `mux live list`
|
|
685
|
+
|
|
686
|
+
List all live streams with pagination.
|
|
687
|
+
|
|
688
|
+
**Options:**
|
|
689
|
+
- `--limit <number>` - Number of results to return (default: 25)
|
|
690
|
+
- `--page <number>` - Page number for pagination (default: 1)
|
|
691
|
+
- `--json` - Output JSON instead of pretty format
|
|
692
|
+
- `--compact` - Output one line per stream in grep-friendly format
|
|
693
|
+
|
|
694
|
+
**Examples:**
|
|
695
|
+
|
|
696
|
+
```bash
|
|
697
|
+
# List live streams with default settings
|
|
698
|
+
mux live list
|
|
153
699
|
|
|
154
|
-
|
|
700
|
+
# List first 10 streams
|
|
701
|
+
mux live list --limit 10
|
|
155
702
|
|
|
156
|
-
|
|
703
|
+
# List second page of results
|
|
704
|
+
mux live list --page 2
|
|
157
705
|
|
|
706
|
+
# Get JSON output for scripting
|
|
707
|
+
mux live list --json
|
|
708
|
+
|
|
709
|
+
# Get compact output for grep and parsing
|
|
710
|
+
mux live list --compact
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
**Output (default pretty format):**
|
|
714
|
+
|
|
715
|
+
```
|
|
716
|
+
Found 2 live stream(s):
|
|
717
|
+
|
|
718
|
+
waWxn5KIZCYmILAOWgXW9dFBPnOXq00JM idle 08/18 16:43
|
|
719
|
+
Details:
|
|
720
|
+
├─ Stream Key: c3eb...1724
|
|
721
|
+
├─ Latency Mode: standard
|
|
722
|
+
├─ Reconnect Window: 60s
|
|
723
|
+
└─ Max Duration: 12h
|
|
724
|
+
Recent Assets:
|
|
725
|
+
└─ 00QNOSkxzBdlASP3iIvTfvqxDN3u74hUX
|
|
726
|
+
Playback IDs:
|
|
727
|
+
└─ 🔒 EIyqm8p4VwGj5sO9rNBtykFbbKFFSNWA
|
|
158
728
|
```
|
|
159
|
-
USAGE
|
|
160
|
-
$ mux init [ENVFILE]
|
|
161
729
|
|
|
162
|
-
|
|
163
|
-
ENVFILE path to a Mux access token .env file
|
|
730
|
+
**Output (with --compact flag):**
|
|
164
731
|
|
|
165
|
-
|
|
166
|
-
|
|
732
|
+
```
|
|
733
|
+
waWxn5KIZCYmILAOWgXW9dFBPnOXq00JM idle 08/18 16:43 standard 60s signed 1 assets
|
|
167
734
|
```
|
|
168
735
|
|
|
169
|
-
|
|
736
|
+
#### `mux live get <stream-id>`
|
|
170
737
|
|
|
171
|
-
|
|
738
|
+
Get detailed information about a specific live stream.
|
|
172
739
|
|
|
173
|
-
|
|
740
|
+
**Arguments:**
|
|
741
|
+
- `<stream-id>` - The ID of the live stream to retrieve
|
|
174
742
|
|
|
743
|
+
**Options:**
|
|
744
|
+
- `--json` - Output JSON instead of pretty format
|
|
745
|
+
|
|
746
|
+
**Examples:**
|
|
747
|
+
|
|
748
|
+
```bash
|
|
749
|
+
# Get live stream details
|
|
750
|
+
mux live get abc123xyz
|
|
751
|
+
|
|
752
|
+
# Get live stream details as JSON
|
|
753
|
+
mux live get abc123xyz --json
|
|
175
754
|
```
|
|
176
|
-
USAGE
|
|
177
|
-
$ mux live:complete STREAMNAME
|
|
178
755
|
|
|
179
|
-
|
|
180
|
-
STREAMNAME the name (coupled with --reference-type) to look up in Mux to yield this livestream
|
|
756
|
+
**Output:**
|
|
181
757
|
|
|
182
|
-
OPTIONS
|
|
183
|
-
-d, --disableAfterCompletion If set, disables the stream upon completion.
|
|
184
|
-
-t, --streamId=stream-id [default: stream-id] the type of the provided reference name
|
|
185
758
|
```
|
|
759
|
+
Live Stream ID: abc123xyz
|
|
760
|
+
Status: active
|
|
761
|
+
Created: 1234567890
|
|
762
|
+
Stream Key: your-secret-stream-key
|
|
763
|
+
Latency Mode: low
|
|
764
|
+
Reconnect Window: 60s
|
|
765
|
+
|
|
766
|
+
Playback IDs:
|
|
767
|
+
- playback123 (public)
|
|
768
|
+
URL: https://stream.mux.com/playback123.m3u8
|
|
769
|
+
|
|
770
|
+
New Asset Settings:
|
|
771
|
+
Playback Policy: public
|
|
772
|
+
Recording enabled: Yes
|
|
773
|
+
|
|
774
|
+
WARNING: This is a test stream (will be deleted after 24 hours)
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
#### `mux live delete <stream-id>`
|
|
186
778
|
|
|
187
|
-
|
|
779
|
+
Delete a live stream permanently.
|
|
188
780
|
|
|
189
|
-
|
|
781
|
+
**Arguments:**
|
|
782
|
+
- `<stream-id>` - The ID of the live stream to delete
|
|
190
783
|
|
|
191
|
-
|
|
784
|
+
**Options:**
|
|
785
|
+
- `-f, --force` - Skip confirmation prompt
|
|
786
|
+
- `--json` - Output JSON instead of pretty format
|
|
192
787
|
|
|
788
|
+
**Examples:**
|
|
789
|
+
|
|
790
|
+
```bash
|
|
791
|
+
# Delete stream with confirmation prompt
|
|
792
|
+
mux live delete abc123xyz
|
|
793
|
+
|
|
794
|
+
# Delete stream without confirmation
|
|
795
|
+
mux live delete abc123xyz --force
|
|
796
|
+
|
|
797
|
+
# Delete stream with JSON output (requires --force for safety)
|
|
798
|
+
mux live delete abc123xyz --json --force
|
|
193
799
|
```
|
|
194
|
-
USAGE
|
|
195
|
-
$ mux live:disable STREAMNAME
|
|
196
800
|
|
|
197
|
-
|
|
198
|
-
STREAMNAME the name (coupled with --reference-type) to look up in Mux to yield this livestream
|
|
801
|
+
**Important:** When using `--json` output mode, you must also provide the `--force` flag. This safety feature prevents accidental deletions in automated scripts.
|
|
199
802
|
|
|
200
|
-
|
|
201
|
-
|
|
803
|
+
**Output:**
|
|
804
|
+
|
|
805
|
+
```
|
|
806
|
+
Are you sure you want to delete live stream abc123xyz? (y/n): y
|
|
807
|
+
Live stream abc123xyz deleted successfully
|
|
202
808
|
```
|
|
203
809
|
|
|
204
|
-
|
|
810
|
+
#### Playback ID Management
|
|
811
|
+
|
|
812
|
+
Manage playback IDs for live streams. Each live stream can have multiple playback IDs with different policies (public or signed).
|
|
813
|
+
|
|
814
|
+
##### `mux live playback-ids list <stream-id>`
|
|
815
|
+
|
|
816
|
+
List all playback IDs for a specific live stream.
|
|
817
|
+
|
|
818
|
+
**Arguments:**
|
|
819
|
+
- `<stream-id>` - The ID of the live stream
|
|
820
|
+
|
|
821
|
+
**Options:**
|
|
822
|
+
- `--json` - Output JSON instead of pretty format
|
|
205
823
|
|
|
206
|
-
|
|
824
|
+
**Examples:**
|
|
207
825
|
|
|
208
|
-
|
|
826
|
+
```bash
|
|
827
|
+
# List playback IDs for a live stream
|
|
828
|
+
mux live playback-ids list abc123xyz
|
|
209
829
|
|
|
830
|
+
# Get JSON output
|
|
831
|
+
mux live playback-ids list abc123xyz --json
|
|
210
832
|
```
|
|
211
|
-
USAGE
|
|
212
|
-
$ mux live:enable STREAMNAME
|
|
213
833
|
|
|
214
|
-
|
|
215
|
-
STREAMNAME the name (coupled with --reference-type) to look up in Mux to yield this livestream
|
|
834
|
+
**Output:**
|
|
216
835
|
|
|
217
|
-
OPTIONS
|
|
218
|
-
-t, --streamId=stream-id [default: stream-id] the type of the provided reference name
|
|
219
836
|
```
|
|
837
|
+
Found 2 playback ID(s) for live stream abc123xyz:
|
|
220
838
|
|
|
221
|
-
|
|
839
|
+
Playback ID: playback123
|
|
840
|
+
Policy: public
|
|
841
|
+
URL: https://stream.mux.com/playback123.m3u8
|
|
222
842
|
|
|
223
|
-
|
|
843
|
+
Playback ID: playback456
|
|
844
|
+
Policy: signed
|
|
845
|
+
URL: https://stream.mux.com/playback456.m3u8
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
##### `mux live playback-ids create <stream-id>`
|
|
849
|
+
|
|
850
|
+
Create a new playback ID for a live stream.
|
|
851
|
+
|
|
852
|
+
**Arguments:**
|
|
853
|
+
- `<stream-id>` - The ID of the live stream
|
|
854
|
+
|
|
855
|
+
**Options:**
|
|
856
|
+
- `--policy <policy>` - Playback policy: `public` or `signed` (default: `public`)
|
|
857
|
+
- `--json` - Output JSON instead of pretty format
|
|
224
858
|
|
|
225
|
-
|
|
859
|
+
**Examples:**
|
|
226
860
|
|
|
861
|
+
```bash
|
|
862
|
+
# Create a public playback ID
|
|
863
|
+
mux live playback-ids create abc123xyz
|
|
864
|
+
|
|
865
|
+
# Create a signed playback ID
|
|
866
|
+
mux live playback-ids create abc123xyz --policy signed
|
|
867
|
+
|
|
868
|
+
# Get JSON output
|
|
869
|
+
mux live playback-ids create abc123xyz --policy public --json
|
|
227
870
|
```
|
|
228
|
-
USAGE
|
|
229
|
-
$ mux plugins
|
|
230
871
|
|
|
231
|
-
|
|
232
|
-
--core Show core plugins.
|
|
872
|
+
**Output:**
|
|
233
873
|
|
|
234
|
-
EXAMPLE
|
|
235
|
-
$ mux plugins
|
|
236
874
|
```
|
|
875
|
+
Playback ID created: playback123
|
|
876
|
+
Policy: public
|
|
877
|
+
URL: https://stream.mux.com/playback123.m3u8
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
##### `mux live playback-ids delete <stream-id> <playback-id>`
|
|
881
|
+
|
|
882
|
+
Delete a playback ID from a live stream.
|
|
237
883
|
|
|
238
|
-
|
|
884
|
+
**Arguments:**
|
|
885
|
+
- `<stream-id>` - The ID of the live stream
|
|
886
|
+
- `<playback-id>` - The ID of the playback ID to delete
|
|
239
887
|
|
|
240
|
-
|
|
888
|
+
**Options:**
|
|
889
|
+
- `-f, --force` - Skip confirmation prompt
|
|
890
|
+
- `--json` - Output JSON instead of pretty format
|
|
241
891
|
|
|
242
|
-
|
|
892
|
+
**Examples:**
|
|
893
|
+
|
|
894
|
+
```bash
|
|
895
|
+
# Delete a playback ID with confirmation
|
|
896
|
+
mux live playback-ids delete abc123xyz playback123
|
|
897
|
+
|
|
898
|
+
# Delete without confirmation
|
|
899
|
+
mux live playback-ids delete abc123xyz playback123 --force
|
|
900
|
+
|
|
901
|
+
# Delete with JSON output
|
|
902
|
+
mux live playback-ids delete abc123xyz playback123 --force --json
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
**Output:**
|
|
243
906
|
|
|
244
907
|
```
|
|
245
|
-
|
|
246
|
-
|
|
908
|
+
Are you sure you want to delete playback ID playback123 from live stream abc123xyz? (y/n): y
|
|
909
|
+
Playback ID playback123 deleted successfully
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
### Playback ID Lookup
|
|
913
|
+
|
|
914
|
+
#### `mux playback-ids <playback-id>`
|
|
915
|
+
|
|
916
|
+
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.
|
|
917
|
+
|
|
918
|
+
**Arguments:**
|
|
919
|
+
- `<playback-id>` - The playback ID to look up
|
|
247
920
|
|
|
248
|
-
|
|
249
|
-
|
|
921
|
+
**Options:**
|
|
922
|
+
- `--expand` - Fetch and return the full asset or live stream object instead of just the reference
|
|
923
|
+
- `--json` - Output JSON instead of pretty format
|
|
250
924
|
|
|
251
|
-
|
|
252
|
-
-h, --help Show CLI help.
|
|
253
|
-
-v, --verbose
|
|
925
|
+
**Examples:**
|
|
254
926
|
|
|
255
|
-
|
|
256
|
-
|
|
927
|
+
```bash
|
|
928
|
+
# Look up a playback ID (returns basic info)
|
|
929
|
+
mux playback-ids abc123playbackid
|
|
930
|
+
|
|
931
|
+
# Look up and fetch the full asset or live stream object
|
|
932
|
+
mux playback-ids abc123playbackid --expand
|
|
933
|
+
|
|
934
|
+
# Get JSON output
|
|
935
|
+
mux playback-ids abc123playbackid --json
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
**Output (basic lookup):**
|
|
939
|
+
|
|
940
|
+
```
|
|
941
|
+
Playback ID: abc123playbackid
|
|
942
|
+
Policy: public
|
|
943
|
+
Type: asset
|
|
944
|
+
ID: abc123xyz
|
|
257
945
|
```
|
|
258
946
|
|
|
259
|
-
|
|
947
|
+
**Output (with --expand):**
|
|
948
|
+
|
|
949
|
+
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.
|
|
950
|
+
|
|
951
|
+
**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.
|
|
952
|
+
|
|
953
|
+
### Signing Keys & Secure Playback
|
|
954
|
+
|
|
955
|
+
#### `mux signing-keys create`
|
|
956
|
+
|
|
957
|
+
Create a new signing key for secure video playback and automatically save it to the current environment.
|
|
260
958
|
|
|
261
|
-
|
|
959
|
+
**Options:**
|
|
960
|
+
- `--json` - Output JSON instead of pretty format
|
|
262
961
|
|
|
263
|
-
|
|
962
|
+
**Examples:**
|
|
264
963
|
|
|
964
|
+
```bash
|
|
965
|
+
# Create a new signing key
|
|
966
|
+
mux signing-keys create
|
|
967
|
+
|
|
968
|
+
# Create a signing key with JSON output
|
|
969
|
+
mux signing-keys create --json
|
|
970
|
+
```
|
|
971
|
+
|
|
972
|
+
**Output:**
|
|
973
|
+
|
|
974
|
+
```
|
|
975
|
+
Signing key created and saved to environment: default
|
|
976
|
+
Key ID: qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
|
|
265
977
|
```
|
|
266
|
-
USAGE
|
|
267
|
-
$ mux plugins:install PLUGIN...
|
|
268
978
|
|
|
269
|
-
|
|
270
|
-
PLUGIN Plugin to install.
|
|
979
|
+
**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.
|
|
271
980
|
|
|
272
|
-
|
|
273
|
-
-f, --force Run yarn install with force flag.
|
|
274
|
-
-h, --help Show CLI help.
|
|
275
|
-
-v, --verbose
|
|
981
|
+
#### `mux signing-keys list`
|
|
276
982
|
|
|
277
|
-
|
|
278
|
-
Can be installed from npm or a git url.
|
|
983
|
+
List all signing keys with indicators showing which keys are configured in local environments.
|
|
279
984
|
|
|
280
|
-
|
|
985
|
+
**Options:**
|
|
986
|
+
- `--json` - Output JSON instead of pretty format
|
|
281
987
|
|
|
282
|
-
|
|
283
|
-
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
|
|
284
|
-
the CLI without the need to patch and update the whole CLI.
|
|
988
|
+
**Examples:**
|
|
285
989
|
|
|
286
|
-
|
|
287
|
-
|
|
990
|
+
```bash
|
|
991
|
+
# List all signing keys
|
|
992
|
+
mux signing-keys list
|
|
288
993
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
$ mux plugins:install https://github.com/someuser/someplugin
|
|
292
|
-
$ mux plugins:install someuser/someplugin
|
|
994
|
+
# List signing keys with JSON output
|
|
995
|
+
mux signing-keys list --json
|
|
293
996
|
```
|
|
294
997
|
|
|
295
|
-
|
|
998
|
+
**Output:**
|
|
296
999
|
|
|
297
|
-
|
|
1000
|
+
```
|
|
1001
|
+
Found 2 signing key(s):
|
|
298
1002
|
|
|
299
|
-
|
|
1003
|
+
Key ID: qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
|
|
1004
|
+
Created: 1234567890
|
|
1005
|
+
Active in environments: production, staging
|
|
300
1006
|
|
|
1007
|
+
Key ID: abc123def456ghi789jkl012mno345pq
|
|
1008
|
+
Created: 1234567891
|
|
1009
|
+
Active in environments: development
|
|
301
1010
|
```
|
|
302
|
-
USAGE
|
|
303
|
-
$ mux plugins:link PLUGIN
|
|
304
1011
|
|
|
305
|
-
|
|
306
|
-
|
|
1012
|
+
#### `mux signing-keys get <key-id>`
|
|
1013
|
+
|
|
1014
|
+
Get detailed information about a specific signing key.
|
|
1015
|
+
|
|
1016
|
+
**Arguments:**
|
|
1017
|
+
- `<key-id>` - The ID of the signing key to retrieve
|
|
307
1018
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
-v, --verbose
|
|
1019
|
+
**Options:**
|
|
1020
|
+
- `--json` - Output JSON instead of pretty format
|
|
311
1021
|
|
|
312
|
-
|
|
313
|
-
Installation of a linked plugin will override a user-installed or core plugin.
|
|
1022
|
+
**Examples:**
|
|
314
1023
|
|
|
315
|
-
|
|
316
|
-
|
|
1024
|
+
```bash
|
|
1025
|
+
# Get signing key details
|
|
1026
|
+
mux signing-keys get qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
|
|
317
1027
|
|
|
318
|
-
|
|
319
|
-
|
|
1028
|
+
# Get signing key details as JSON
|
|
1029
|
+
mux signing-keys get qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ --json
|
|
320
1030
|
```
|
|
321
1031
|
|
|
322
|
-
|
|
1032
|
+
**Output:**
|
|
323
1033
|
|
|
324
|
-
|
|
1034
|
+
```
|
|
1035
|
+
Signing Key ID: qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
|
|
1036
|
+
Created: 1234567890
|
|
1037
|
+
Active in environments: production
|
|
1038
|
+
```
|
|
325
1039
|
|
|
326
|
-
|
|
1040
|
+
#### `mux signing-keys delete <key-id>`
|
|
327
1041
|
|
|
1042
|
+
Delete a signing key permanently. This will invalidate all signed URLs created with this key.
|
|
1043
|
+
|
|
1044
|
+
**Arguments:**
|
|
1045
|
+
- `<key-id>` - The ID of the signing key to delete
|
|
1046
|
+
|
|
1047
|
+
**Options:**
|
|
1048
|
+
- `-f, --force` - Skip confirmation prompt
|
|
1049
|
+
- `--json` - Output JSON instead of pretty format
|
|
1050
|
+
|
|
1051
|
+
**Examples:**
|
|
1052
|
+
|
|
1053
|
+
```bash
|
|
1054
|
+
# Delete signing key with confirmation prompt
|
|
1055
|
+
mux signing-keys delete qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ
|
|
1056
|
+
|
|
1057
|
+
# Delete signing key without confirmation
|
|
1058
|
+
mux signing-keys delete qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ --force
|
|
1059
|
+
|
|
1060
|
+
# Delete signing key with JSON output
|
|
1061
|
+
mux signing-keys delete qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ --force --json
|
|
328
1062
|
```
|
|
329
|
-
USAGE
|
|
330
|
-
$ mux plugins:uninstall PLUGIN...
|
|
331
1063
|
|
|
332
|
-
|
|
333
|
-
PLUGIN plugin to uninstall
|
|
1064
|
+
**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.
|
|
334
1065
|
|
|
335
|
-
|
|
336
|
-
-h, --help Show CLI help.
|
|
337
|
-
-v, --verbose
|
|
1066
|
+
**Output:**
|
|
338
1067
|
|
|
339
|
-
ALIASES
|
|
340
|
-
$ mux plugins:unlink
|
|
341
|
-
$ mux plugins:remove
|
|
342
1068
|
```
|
|
1069
|
+
WARNING: This signing key is configured in the following environments: production
|
|
1070
|
+
|
|
1071
|
+
Deleting this key will invalidate all signed URLs created with it.
|
|
1072
|
+
Are you sure you want to delete signing key qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ? (y/n): y
|
|
1073
|
+
|
|
1074
|
+
Signing key qrdSB18tYITC7GNQCFJWKr25M9JPkMxJ deleted successfully
|
|
1075
|
+
Removed from environment: production
|
|
1076
|
+
```
|
|
1077
|
+
|
|
1078
|
+
#### `mux sign <playback-id>`
|
|
343
1079
|
|
|
344
|
-
|
|
1080
|
+
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.
|
|
345
1081
|
|
|
346
|
-
|
|
1082
|
+
**Arguments:**
|
|
1083
|
+
- `<playback-id>` - The playback ID to sign
|
|
347
1084
|
|
|
348
|
-
|
|
1085
|
+
**Options:**
|
|
1086
|
+
- `-e, --expiration <duration>` - Token expiration duration (default: '7d')
|
|
1087
|
+
- Examples: '7d', '24h', '1h', '30m'
|
|
1088
|
+
- `-t, --type <type>` - Token type: `video`, `thumbnail`, `gif`, `storyboard` (default: 'video')
|
|
1089
|
+
- `-p, --param <key=value>` - JWT claim as key=value (repeatable). Used to embed parameters like `time`, `width`, or `height` directly in the signed token.
|
|
1090
|
+
- `--params-json <json>` - JWT claims as a JSON object. Useful for complex claims including nested values like `custom`.
|
|
1091
|
+
- `--json` - Output JSON instead of pretty format
|
|
1092
|
+
- `--token-only` - Output only the JWT token (no URL)
|
|
349
1093
|
|
|
1094
|
+
When `--param` and `--params-json` are both provided, `--params-json` is applied first as a base layer and `--param` values override on top.
|
|
1095
|
+
|
|
1096
|
+
**Examples:**
|
|
1097
|
+
|
|
1098
|
+
```bash
|
|
1099
|
+
# Sign a playback ID with default settings (7 day expiration, video type)
|
|
1100
|
+
mux sign abc123playbackid
|
|
1101
|
+
|
|
1102
|
+
# Sign with custom expiration
|
|
1103
|
+
mux sign abc123playbackid --expiration 24h
|
|
1104
|
+
|
|
1105
|
+
# Sign for thumbnail access at a specific time
|
|
1106
|
+
mux sign abc123playbackid --type thumbnail --param time=14
|
|
1107
|
+
|
|
1108
|
+
# Sign for thumbnail with dimensions
|
|
1109
|
+
mux sign abc123playbackid --type thumbnail --param time=14 --param width=100
|
|
1110
|
+
|
|
1111
|
+
# Sign for animated GIF
|
|
1112
|
+
mux sign abc123playbackid --type gif
|
|
1113
|
+
|
|
1114
|
+
# Sign with custom claims for tracking (nested under "custom" in JWT)
|
|
1115
|
+
mux sign abc123playbackid --params-json '{"custom": {"session_id": "xxxx-123"}}'
|
|
1116
|
+
|
|
1117
|
+
# Get JSON output with full details
|
|
1118
|
+
mux sign abc123playbackid --json
|
|
1119
|
+
|
|
1120
|
+
# Get only the JWT token for scripting
|
|
1121
|
+
mux sign abc123playbackid --token-only
|
|
350
1122
|
```
|
|
351
|
-
USAGE
|
|
352
|
-
$ mux plugins:update
|
|
353
1123
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
1124
|
+
**Output:**
|
|
1125
|
+
|
|
1126
|
+
The output URL uses the appropriate domain based on the token type:
|
|
1127
|
+
|
|
1128
|
+
```bash
|
|
1129
|
+
# Video (default) - uses stream.mux.com
|
|
1130
|
+
mux sign abc123playbackid
|
|
1131
|
+
https://stream.mux.com/abc123playbackid.m3u8?token=eyJ...
|
|
1132
|
+
|
|
1133
|
+
# Thumbnail - uses image.mux.com
|
|
1134
|
+
mux sign abc123playbackid --type thumbnail --param time=14
|
|
1135
|
+
https://image.mux.com/abc123playbackid/thumbnail.png?token=eyJ...
|
|
1136
|
+
|
|
1137
|
+
# GIF - uses image.mux.com
|
|
1138
|
+
mux sign abc123playbackid --type gif
|
|
1139
|
+
https://image.mux.com/abc123playbackid/animated.gif?token=eyJ...
|
|
1140
|
+
|
|
1141
|
+
# Storyboard - uses image.mux.com
|
|
1142
|
+
mux sign abc123playbackid --type storyboard
|
|
1143
|
+
https://image.mux.com/abc123playbackid/storyboard.vtt?token=eyJ...
|
|
1144
|
+
```
|
|
1145
|
+
|
|
1146
|
+
**Thumbnail Parameters:**
|
|
1147
|
+
|
|
1148
|
+
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:
|
|
1149
|
+
|
|
1150
|
+
| Parameter | Description |
|
|
1151
|
+
|-----------|-------------|
|
|
1152
|
+
| `time` | Video timestamp in seconds for the thumbnail |
|
|
1153
|
+
| `width` | Thumbnail width in pixels |
|
|
1154
|
+
| `height` | Thumbnail height in pixels |
|
|
1155
|
+
| `rotate` | Rotate clockwise: 90, 180, or 270 |
|
|
1156
|
+
| `fit_mode` | How to fit: `preserve`, `stretch`, `crop`, `smartcrop`, `pad` |
|
|
1157
|
+
| `flip_v` | Flip vertically |
|
|
1158
|
+
| `flip_h` | Flip horizontally |
|
|
1159
|
+
|
|
1160
|
+
**Prerequisites:**
|
|
1161
|
+
|
|
1162
|
+
Before using `mux sign`, you must have a signing key configured in your current environment:
|
|
1163
|
+
|
|
1164
|
+
```bash
|
|
1165
|
+
# Create and configure a signing key
|
|
1166
|
+
mux signing-keys create
|
|
1167
|
+
```
|
|
1168
|
+
|
|
1169
|
+
If no signing keys are configured, the command will provide helpful instructions on how to set one up.
|
|
1170
|
+
|
|
1171
|
+
### Authentication & Environment Management
|
|
1172
|
+
|
|
1173
|
+
#### `mux login`
|
|
1174
|
+
|
|
1175
|
+
Authenticate with Mux and save credentials.
|
|
1176
|
+
|
|
1177
|
+
**Options:**
|
|
1178
|
+
- `-f, --env-file <path>` - Path to .env file containing credentials
|
|
1179
|
+
- `-n, --name <name>` - Name for this environment (default: "default")
|
|
1180
|
+
|
|
1181
|
+
**Examples:**
|
|
1182
|
+
|
|
1183
|
+
```bash
|
|
1184
|
+
# Interactive login
|
|
1185
|
+
mux login
|
|
1186
|
+
|
|
1187
|
+
# Login with .env file
|
|
1188
|
+
mux login --env-file .env
|
|
1189
|
+
|
|
1190
|
+
# Login with a named environment
|
|
1191
|
+
mux login --name production --env-file .env.production
|
|
357
1192
|
```
|
|
358
1193
|
|
|
359
|
-
|
|
1194
|
+
#### `mux logout <name>`
|
|
1195
|
+
|
|
1196
|
+
Remove credentials for a specific environment.
|
|
1197
|
+
|
|
1198
|
+
**Arguments:**
|
|
1199
|
+
- `<name>` - Name of the environment to remove
|
|
360
1200
|
|
|
361
|
-
|
|
1201
|
+
**Examples:**
|
|
362
1202
|
|
|
363
|
-
|
|
1203
|
+
```bash
|
|
1204
|
+
# Remove the default environment
|
|
1205
|
+
mux logout default
|
|
364
1206
|
|
|
1207
|
+
# Remove a named environment
|
|
1208
|
+
mux logout staging
|
|
365
1209
|
```
|
|
366
|
-
USAGE
|
|
367
|
-
$ mux sign PLAYBACK-ID
|
|
368
1210
|
|
|
369
|
-
|
|
370
|
-
|
|
1211
|
+
When you remove the default environment, the CLI automatically selects another environment as the new default.
|
|
1212
|
+
|
|
1213
|
+
#### `mux env list`
|
|
1214
|
+
|
|
1215
|
+
Display all configured environments.
|
|
371
1216
|
|
|
372
|
-
|
|
373
|
-
-e, --expiresIn=expiresIn [default: 7d] How long the signature is valid for. If no unit is specified,
|
|
374
|
-
milliseconds is assumed.
|
|
1217
|
+
**Examples:**
|
|
375
1218
|
|
|
376
|
-
|
|
1219
|
+
```bash
|
|
1220
|
+
mux env list
|
|
1221
|
+
```
|
|
377
1222
|
|
|
378
|
-
|
|
1223
|
+
**Output:**
|
|
379
1224
|
```
|
|
1225
|
+
Configured environments:
|
|
1226
|
+
|
|
1227
|
+
* production (default)
|
|
1228
|
+
staging
|
|
1229
|
+
development
|
|
1230
|
+
|
|
1231
|
+
3 environments total
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
#### `mux env switch <name>`
|
|
380
1235
|
|
|
381
|
-
|
|
1236
|
+
Change the default environment.
|
|
382
1237
|
|
|
383
|
-
|
|
1238
|
+
**Arguments:**
|
|
1239
|
+
- `<name>` - Name of the environment to set as default
|
|
384
1240
|
|
|
385
|
-
|
|
1241
|
+
**Examples:**
|
|
386
1242
|
|
|
1243
|
+
```bash
|
|
1244
|
+
# Switch to staging environment
|
|
1245
|
+
mux env switch staging
|
|
387
1246
|
```
|
|
388
|
-
USAGE
|
|
389
|
-
$ mux spaces:sign SPACE-ID
|
|
390
1247
|
|
|
391
|
-
|
|
392
|
-
|
|
1248
|
+
## Configuration
|
|
1249
|
+
|
|
1250
|
+
Credentials are stored securely in `~/.config/mux/config.json` with restrictive file permissions (readable/writable only by the owner).
|
|
1251
|
+
|
|
1252
|
+
The configuration file structure:
|
|
1253
|
+
|
|
1254
|
+
```json
|
|
1255
|
+
{
|
|
1256
|
+
"environments": {
|
|
1257
|
+
"production": {
|
|
1258
|
+
"tokenId": "your_token_id",
|
|
1259
|
+
"tokenSecret": "your_token_secret"
|
|
1260
|
+
},
|
|
1261
|
+
"staging": {
|
|
1262
|
+
"tokenId": "your_staging_token_id",
|
|
1263
|
+
"tokenSecret": "your_staging_token_secret"
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
"defaultEnvironment": "production"
|
|
1267
|
+
}
|
|
1268
|
+
```
|
|
1269
|
+
|
|
1270
|
+
## Development
|
|
1271
|
+
|
|
1272
|
+
This project uses [Bun](https://bun.sh) as the JavaScript runtime and is written in TypeScript.
|
|
1273
|
+
|
|
1274
|
+
### Prerequisites
|
|
1275
|
+
|
|
1276
|
+
- Bun runtime installed
|
|
1277
|
+
- pnpm for package management
|
|
393
1278
|
|
|
394
|
-
|
|
395
|
-
-R, --role=role [default: publisher] One of 'publisher' or 'subscriber'.
|
|
1279
|
+
### Setup
|
|
396
1280
|
|
|
397
|
-
|
|
398
|
-
|
|
1281
|
+
```bash
|
|
1282
|
+
# Install dependencies
|
|
1283
|
+
pnpm install
|
|
399
1284
|
|
|
400
|
-
|
|
1285
|
+
# Run tests
|
|
1286
|
+
bun test
|
|
401
1287
|
|
|
402
|
-
|
|
1288
|
+
# Build the project
|
|
1289
|
+
pnpm run build
|
|
403
1290
|
```
|
|
404
1291
|
|
|
405
|
-
|
|
1292
|
+
### Testing
|
|
406
1293
|
|
|
407
|
-
|
|
1294
|
+
The project includes comprehensive test coverage for core functionality:
|
|
408
1295
|
|
|
409
|
-
|
|
1296
|
+
```bash
|
|
1297
|
+
# Run all tests
|
|
1298
|
+
bun test
|
|
410
1299
|
|
|
1300
|
+
# Run tests in watch mode
|
|
1301
|
+
bun test --watch
|
|
411
1302
|
```
|
|
412
|
-
USAGE
|
|
413
|
-
$ mux update [CHANNEL]
|
|
414
1303
|
|
|
415
|
-
|
|
416
|
-
|
|
1304
|
+
### Project Structure
|
|
1305
|
+
|
|
1306
|
+
```
|
|
1307
|
+
src/
|
|
1308
|
+
├── commands/ # CLI command definitions
|
|
1309
|
+
│ ├── assets/ # Asset management commands
|
|
1310
|
+
│ │ ├── manage/ # Interactive TUI for asset management
|
|
1311
|
+
│ │ │ ├── index.ts # TUI command entry point
|
|
1312
|
+
│ │ │ └── AssetManageApp.tsx # Main TUI application
|
|
1313
|
+
│ │ ├── playback-ids/ # Playback ID commands for assets
|
|
1314
|
+
│ │ │ ├── index.ts # Main playback-ids command
|
|
1315
|
+
│ │ │ ├── create.ts # Create playback IDs
|
|
1316
|
+
│ │ │ ├── list.ts # List playback IDs
|
|
1317
|
+
│ │ │ └── delete.ts # Delete playback IDs
|
|
1318
|
+
│ │ ├── index.ts # Main assets command
|
|
1319
|
+
│ │ ├── create.ts # Create assets
|
|
1320
|
+
│ │ ├── list.ts # List assets
|
|
1321
|
+
│ │ ├── get.ts # Get asset details
|
|
1322
|
+
│ │ ├── update.ts # Update asset metadata
|
|
1323
|
+
│ │ └── delete.ts # Delete assets
|
|
1324
|
+
│ ├── live/ # Live stream management commands
|
|
1325
|
+
│ │ ├── playback-ids/ # Playback ID commands for live streams
|
|
1326
|
+
│ │ │ ├── index.ts # Main playback-ids command
|
|
1327
|
+
│ │ │ ├── create.ts # Create playback IDs
|
|
1328
|
+
│ │ │ ├── list.ts # List playback IDs
|
|
1329
|
+
│ │ │ └── delete.ts # Delete playback IDs
|
|
1330
|
+
│ │ ├── index.ts # Main live command
|
|
1331
|
+
│ │ ├── create.ts # Create live streams
|
|
1332
|
+
│ │ ├── list.ts # List live streams
|
|
1333
|
+
│ │ ├── get.ts # Get live stream details
|
|
1334
|
+
│ │ └── delete.ts # Delete live streams
|
|
1335
|
+
│ ├── signing-keys/ # Signing key management commands
|
|
1336
|
+
│ │ ├── index.ts # Main signing-keys command
|
|
1337
|
+
│ │ ├── create.ts # Create signing keys
|
|
1338
|
+
│ │ ├── list.ts # List signing keys
|
|
1339
|
+
│ │ ├── get.ts # Get signing key details
|
|
1340
|
+
│ │ └── delete.ts # Delete signing keys
|
|
1341
|
+
│ ├── env/ # Environment management commands
|
|
1342
|
+
│ │ ├── index.ts # Main env command
|
|
1343
|
+
│ │ ├── list.ts # List environments
|
|
1344
|
+
│ │ └── switch.ts # Switch default environment
|
|
1345
|
+
│ ├── login.ts # Login command
|
|
1346
|
+
│ ├── logout.ts # Logout command
|
|
1347
|
+
│ └── sign.ts # Sign playback IDs command
|
|
1348
|
+
├── lib/ # Shared libraries
|
|
1349
|
+
│ ├── tui/ # Reusable TUI components
|
|
1350
|
+
│ │ ├── index.ts # TUI exports
|
|
1351
|
+
│ │ ├── renderer.tsx # OpenTUI renderer setup
|
|
1352
|
+
│ │ ├── SelectList.tsx # Reusable selection list component
|
|
1353
|
+
│ │ ├── ActionMenu.tsx # Reusable action menu component
|
|
1354
|
+
│ │ ├── ConfirmDialog.tsx # Reusable confirmation dialog
|
|
1355
|
+
│ │ └── clipboard.ts # Clipboard utilities
|
|
1356
|
+
│ ├── config.ts # Configuration management
|
|
1357
|
+
│ ├── formatters.ts # Shared output formatting (timestamps, durations, statuses)
|
|
1358
|
+
│ ├── mux.ts # Mux API integration and auth helpers
|
|
1359
|
+
│ ├── json-config.ts # JSON configuration parsing
|
|
1360
|
+
│ ├── file-upload.ts # File upload utilities
|
|
1361
|
+
│ ├── urls.ts # URL generation (stream, player, thumbnail, gif, storyboard)
|
|
1362
|
+
│ ├── signing.ts # JWT signing utilities
|
|
1363
|
+
│ ├── playback-ids.ts # Playback ID operations
|
|
1364
|
+
│ └── xdg.ts # XDG base directory support
|
|
1365
|
+
└── index.ts # CLI entry point
|
|
417
1366
|
```
|
|
418
1367
|
|
|
419
|
-
|
|
420
|
-
|
|
1368
|
+
## License
|
|
1369
|
+
|
|
1370
|
+
Apache-2.0. See [LICENSE](LICENSE) for details.
|
|
1371
|
+
|
|
1372
|
+
## Support
|
|
1373
|
+
|
|
1374
|
+
For issues and questions:
|
|
1375
|
+
- File an issue on GitHub
|
|
1376
|
+
- Visit [Mux Documentation](https://docs.mux.com/)
|
|
1377
|
+
- Contact Mux Support
|