Skip to content

Commit 6689809

Browse files
authored
Merge pull request #48 from muxinc/dk/strings
Add TOC and better help strings
2 parents 0af69d4 + 2b7e212 commit 6689809

File tree

30 files changed

+174
-61
lines changed

30 files changed

+174
-61
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,47 @@
22

33
A command-line interface for interacting with the Mux API, designed to provide a first-class development experience for working with Mux services locally.
44

5+
## Table of Contents
6+
7+
- [Installation](#installation)
8+
- [Install via npm](#install-via-npm)
9+
- [Shell installer](#shell-installer)
10+
- [Download the binary](#download-the-binary)
11+
- [Getting Started](#getting-started)
12+
- [Authentication](#authentication)
13+
- [Commands](#commands)
14+
- [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+
- [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)
29+
- [Playback ID Lookup](#playback-id-lookup)
30+
- [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)
36+
- [Authentication & Environment Management](#authentication--environment-management)
37+
- [Configuration](#configuration)
38+
- [Development](#development)
39+
- [Prerequisites](#prerequisites)
40+
- [Setup](#setup)
41+
- [Testing](#testing)
42+
- [Project Structure](#project-structure)
43+
- [License](#license)
44+
- [Support](#support)
45+
546
## Installation
647

748
### Install via npm

src/commands/assets/create.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ describe('mux assets create command', () => {
255255
describe('Command metadata', () => {
256256
test('has correct command description', () => {
257257
expect(createCommand.getDescription()).toBe(
258-
'Create a new Mux video asset',
258+
'Create a Mux video asset from a URL, local file upload, or JSON config',
259259
);
260260
});
261261

src/commands/assets/create.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,22 @@ async function createFromConfig(
238238
}
239239

240240
export const createCommand = new Command()
241-
.description('Create a new Mux video asset')
242-
.option('--url <url:string>', 'Video URL to ingest from the web')
241+
.description(
242+
'Create a Mux video asset from a URL, local file upload, or JSON config',
243+
)
244+
.option(
245+
'--url <url:string>',
246+
'Publicly accessible video URL to ingest (http/https)',
247+
)
243248
.option(
244249
'--upload <path:string>',
245250
'Local file(s) to upload (supports glob patterns). Can be specified multiple times.',
246251
{ collect: true },
247252
)
248-
.option('--file, -f <path:string>', 'JSON configuration file')
253+
.option(
254+
'--file, -f <path:string>',
255+
'JSON config file matching Mux Asset API schema (inputs, playback_policies, etc.)',
256+
)
249257
.option(
250258
'-p, --playback-policy <policy:string>',
251259
'Playback policy (public or signed). Can be specified multiple times.',
@@ -268,7 +276,7 @@ export const createCommand = new Command()
268276
)
269277
.option(
270278
'--passthrough <string:string>',
271-
'User metadata (max 255 characters)',
279+
'Arbitrary metadata stored on asset and returned in API responses (max 255 chars)',
272280
{
273281
value: (value: string): string => {
274282
if (value.length > 255) {
@@ -309,7 +317,7 @@ export const createCommand = new Command()
309317
)
310318
.option(
311319
'--video-quality <quality:string>',
312-
'Video quality level (basic, plus, or premium)',
320+
'Video quality level: basic, plus, or premium (all support up to 4K). See https://mux.com/docs/guides/use-video-quality-levels',
313321
{
314322
value: (value: string): string => {
315323
const validQualities = ['basic', 'plus', 'premium'];
@@ -325,7 +333,10 @@ export const createCommand = new Command()
325333
.option('--normalize-audio', 'Normalize audio loudness level')
326334
.option('-y, --yes', 'Skip confirmation prompts')
327335
.option('--json', 'Output JSON instead of pretty format')
328-
.option('--wait', 'Wait for asset processing to complete')
336+
.option(
337+
'--wait',
338+
'Wait for asset processing to complete (polls up to 5 minutes)',
339+
)
329340
.arguments('[files...:string]')
330341
// biome-ignore lint: Cliffy infers upload as string but collect makes it string[]
331342
.action(async (options: any, ...args: unknown[]) => {
@@ -450,7 +461,7 @@ export const createCommand = new Command()
450461
} else {
451462
if (!opts.json) {
452463
console.log(
453-
'WARNING: Asset is still processing. Check status later.',
464+
`WARNING: Asset is still processing. Run 'mux assets get ${asset.id}' to check status.`,
454465
);
455466
}
456467
}

src/commands/assets/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface DeleteOptions {
88
}
99

1010
export const deleteCommand = new Command()
11-
.description('Delete a Mux video asset')
11+
.description('Permanently delete a Mux video asset (cannot be undone)')
1212
.arguments('<asset-id:string>')
1313
.option('-f, --force', 'Skip confirmation prompt')
1414
.option('--json', 'Output JSON instead of pretty format')

src/commands/assets/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import { staticRenditionsCommand } from './static-renditions/index.ts';
99
import { updateCommand } from './update.ts';
1010

1111
export const assetsCommand = new Command()
12-
.description('Manage Mux video assets')
12+
.description(
13+
'Manage Mux video assets (uploaded or ingested videos ready for streaming)',
14+
)
1315
.action(function () {
1416
this.showHelp();
1517
})

src/commands/assets/list.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ export const listCommand = new Command()
2424
.option('--page <number:number>', 'Page number for pagination', {
2525
default: 1,
2626
})
27-
.option('--upload-id <id:string>', 'Filter by upload ID')
27+
.option(
28+
'--upload-id <id:string>',
29+
'Filter by upload ID (returned from mux assets create --upload)',
30+
)
2831
.option('--live-stream-id <id:string>', 'Filter by live stream ID')
2932
.option('--json', 'Output JSON instead of pretty format')
3033
.option('--compact', 'Output one line per asset (grep-friendly)')

src/commands/assets/playback-ids/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { deleteCommand } from './delete.ts';
44
import { listCommand } from './list.ts';
55

66
export const playbackIdsCommand = new Command()
7-
.description('Manage playback IDs for Mux video assets')
7+
.description(
8+
'Manage playback IDs (unique identifiers used in stream.mux.com URLs) for video assets',
9+
)
810
.action(function () {
911
this.showHelp();
1012
})

src/commands/assets/playback-ids/list.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export const listCommand = new Command()
2727
console.log(JSON.stringify(output, null, 2));
2828
} else {
2929
if (playbackIds.length === 0) {
30-
console.log(`No playback IDs found for asset ${assetId}`);
30+
console.log(`No playback IDs found for asset ${assetId}.`);
31+
console.log(
32+
`Run 'mux assets playback-ids create ${assetId}' to add one.`,
33+
);
3134
return;
3235
}
3336

src/commands/assets/static-renditions/create.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ export const createCommand = new Command()
4646
)
4747
.option(
4848
'-p, --passthrough <passthrough:string>',
49-
'Custom metadata for the rendition (max 255 characters)',
49+
'Arbitrary metadata stored on rendition and returned in API responses (max 255 chars)',
5050
)
5151
.option(
5252
'-w, --wait',
53-
'Wait for the rendition to be ready instead of returning immediately',
53+
'Wait for the rendition to be ready (polls up to 10 minutes, exits with error on timeout)',
5454
)
5555
.option('--json', 'Output JSON instead of pretty format')
5656
.action(async (options: CreateOptions, assetId: string) => {

src/commands/assets/static-renditions/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { deleteCommand } from './delete.ts';
44
import { listCommand } from './list.ts';
55

66
export const staticRenditionsCommand = new Command()
7-
.description('Manage static renditions (MP4s) for Mux video assets')
7+
.description(
8+
'Manage static renditions (downloadable MP4 files) for Mux video assets',
9+
)
810
.action(function () {
911
this.showHelp();
1012
})

0 commit comments

Comments
 (0)