@mediaruntime/cli 0.1.0 → 0.2.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/CHANGELOG.md +14 -0
- package/README.md +27 -9
- package/dist/cli.d.ts +39 -1
- package/dist/cli.js +439 -42
- package/dist/cli.js.map +1 -1
- package/docs/AUTH.md +85 -0
- package/docs/CLI_SDD.md +45 -15
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1 — 2026-08-16
|
|
4
|
+
|
|
5
|
+
- Show an elapsed-time activity spinner during interactive local upload, job waiting,
|
|
6
|
+
and verified bundle download.
|
|
7
|
+
- Keep progress on `stderr` and disable it for JSON and non-interactive execution.
|
|
8
|
+
- Clarify that both relative and absolute local file paths are uploaded automatically.
|
|
9
|
+
|
|
10
|
+
## 0.2.0 — 2026-08-16
|
|
11
|
+
|
|
12
|
+
- Add browser-assisted `login`, `auth status`, and revoking `logout` commands.
|
|
13
|
+
- Store dedicated CLI credentials only in the operating-system credential vault.
|
|
14
|
+
- Keep `MEDIARUNTIME_API_KEY` as the higher-priority permanent automation interface.
|
|
15
|
+
- Bind the one-time exchange with PKCE and redact credentials from all CLI output.
|
|
16
|
+
|
|
3
17
|
## 0.1.0 — 2026-08-16
|
|
4
18
|
|
|
5
19
|
- Add `run` with local uploads, frozen output aliases, safe waiting, and atomic canonical
|
package/README.md
CHANGED
|
@@ -11,24 +11,36 @@ npm install --global @mediaruntime/cli
|
|
|
11
11
|
mediaruntime --version
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Node.js 20 or newer is required.
|
|
15
|
-
|
|
14
|
+
Node.js 20 or newer is required. For interactive use, authorize through the browser once:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
mediaruntime login
|
|
18
|
+
mediaruntime auth status
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The CLI stores its dedicated revocable key in the operating-system credential vault; it
|
|
22
|
+
never writes the key to a plaintext configuration file. Use `mediaruntime logout` to
|
|
23
|
+
revoke and remove it.
|
|
24
|
+
|
|
25
|
+
For CI, servers, containers, and deliberate account overrides, continue setting:
|
|
16
26
|
|
|
17
27
|
```bash
|
|
18
28
|
export MEDIARUNTIME_API_KEY="sk_..."
|
|
19
29
|
```
|
|
20
30
|
|
|
21
|
-
|
|
31
|
+
An explicit `MEDIARUNTIME_API_KEY` permanently remains supported and takes precedence
|
|
32
|
+
over the stored login. Do not pass credentials as command-line arguments. `--base-url` and
|
|
22
33
|
`MEDIARUNTIME_API_URL` are development/staging overrides, not normal client setup.
|
|
23
34
|
|
|
24
35
|
## Run a job
|
|
25
36
|
|
|
26
37
|
```bash
|
|
38
|
+
# Relative and absolute local paths are uploaded automatically.
|
|
27
39
|
mediaruntime run ./launch.mp4 --output video.web --wait
|
|
28
40
|
|
|
29
|
-
mediaruntime run
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
mediaruntime run "/Users/you/Videos/launch.mp4" \
|
|
42
|
+
-o video.streaming \
|
|
43
|
+
-o audio.transcription \
|
|
32
44
|
--metadata '{"asset_id":"launch-01"}' \
|
|
33
45
|
--idempotency-key 'asset:launch-01:v1' \
|
|
34
46
|
--download ./launch-01.zip
|
|
@@ -39,6 +51,11 @@ temporary file, validates its advertised size and SHA-256 when available, and pu
|
|
|
39
51
|
it atomically. Existing files are preserved unless `--force` is explicit. Signed download
|
|
40
52
|
URLs are never printed.
|
|
41
53
|
|
|
54
|
+
In an interactive terminal, `run` displays an elapsed-time spinner while it uploads a
|
|
55
|
+
local source, waits for the terminal job state, and downloads and verifies the bundle.
|
|
56
|
+
The indicator uses `stderr` and is automatically disabled for `--json`, redirected
|
|
57
|
+
output, and other non-interactive execution.
|
|
58
|
+
|
|
42
59
|
Supported frozen output aliases:
|
|
43
60
|
|
|
44
61
|
- `video.web`
|
|
@@ -104,6 +121,7 @@ The full implementation contract is in [docs/CLI_SDD.md](docs/CLI_SDD.md).
|
|
|
104
121
|
|
|
105
122
|
## Scope
|
|
106
123
|
|
|
107
|
-
The
|
|
108
|
-
|
|
109
|
-
|
|
124
|
+
The CLI does not implement `listen` or a webhook relay. Production completion continues
|
|
125
|
+
to use the account destination under Account → Webhooks. The ZIP remains the canonical
|
|
126
|
+
completed-job result. See [browser authentication](docs/AUTH.md) for the complete login,
|
|
127
|
+
credential precedence, and security contract.
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { ListJobsParams, JobPage, JobDetails, CreateJobParams, JobReceiptData, WaitForJobOptions } from '@mediaruntime/node';
|
|
2
2
|
|
|
3
|
+
interface StoredCredential {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
accountId: string;
|
|
6
|
+
keyId: string;
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
}
|
|
10
|
+
interface CredentialStore {
|
|
11
|
+
get(baseUrl: string): Promise<StoredCredential | null>;
|
|
12
|
+
set(credential: StoredCredential): Promise<void>;
|
|
13
|
+
delete(baseUrl: string): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
|
|
3
16
|
interface JobsReadClient {
|
|
4
17
|
list(params?: ListJobsParams): Promise<JobPage>;
|
|
5
18
|
get(jobId: string): Promise<JobDetails>;
|
|
@@ -53,6 +66,24 @@ declare function signSyntheticWebhook(payload: Readonly<Record<string, unknown>>
|
|
|
53
66
|
secret: string;
|
|
54
67
|
}): SignedWebhook;
|
|
55
68
|
|
|
69
|
+
interface AuthCommandDependencies {
|
|
70
|
+
credentialStore?: CredentialStore;
|
|
71
|
+
openBrowser?: (url: string) => Promise<void>;
|
|
72
|
+
sleep?: (milliseconds: number) => Promise<void>;
|
|
73
|
+
now?: () => number;
|
|
74
|
+
randomVerifier?: () => string;
|
|
75
|
+
writeStdout?: (text: string) => void;
|
|
76
|
+
}
|
|
77
|
+
declare function resolveCredential(baseUrl: string, dependencies?: AuthCommandDependencies): Promise<{
|
|
78
|
+
apiKey: string;
|
|
79
|
+
source: "environment" | "keychain";
|
|
80
|
+
stored?: StoredCredential;
|
|
81
|
+
} | null>;
|
|
82
|
+
declare function runLoginCommand(args: string[], baseUrl: string, dependencies?: AuthCommandDependencies): Promise<number>;
|
|
83
|
+
declare function runAuthStatusCommand(args: string[], baseUrl: string, dependencies?: AuthCommandDependencies): Promise<number>;
|
|
84
|
+
declare function runLogoutCommand(args: string[], baseUrl: string, dependencies?: AuthCommandDependencies): Promise<number>;
|
|
85
|
+
declare function runAuthCommand(args: string[], baseUrl: string, dependencies?: AuthCommandDependencies): Promise<number>;
|
|
86
|
+
|
|
56
87
|
type CliJobsClient = RunJobsClient & JobsReadClient;
|
|
57
88
|
interface CliClient {
|
|
58
89
|
jobs: CliJobsClient;
|
|
@@ -60,6 +91,7 @@ interface CliClient {
|
|
|
60
91
|
interface CliDependencies {
|
|
61
92
|
createClient?(options: {
|
|
62
93
|
baseUrl?: string;
|
|
94
|
+
apiKey?: string;
|
|
63
95
|
}): CliClient;
|
|
64
96
|
downloadBundle?(url: string, destination: string, options: {
|
|
65
97
|
force: boolean;
|
|
@@ -68,6 +100,12 @@ interface CliDependencies {
|
|
|
68
100
|
}): Promise<void>;
|
|
69
101
|
writeStdout?(text: string): void;
|
|
70
102
|
writeStderr?(text: string): void;
|
|
103
|
+
isStderrTTY?: boolean;
|
|
104
|
+
credentialStore?: CredentialStore;
|
|
105
|
+
openBrowser?(url: string): Promise<void>;
|
|
106
|
+
sleep?(milliseconds: number): Promise<void>;
|
|
107
|
+
now?(): number;
|
|
108
|
+
randomVerifier?(): string;
|
|
71
109
|
}
|
|
72
110
|
declare function downloadBundleAtomically(url: string, destination: string, options: {
|
|
73
111
|
force: boolean;
|
|
@@ -76,4 +114,4 @@ declare function downloadBundleAtomically(url: string, destination: string, opti
|
|
|
76
114
|
}): Promise<void>;
|
|
77
115
|
declare function executeCli(argv: string[], dependencies?: CliDependencies): Promise<number>;
|
|
78
116
|
|
|
79
|
-
export { type CliClient, type CliDependencies, createSyntheticTerminalEvent, downloadBundleAtomically, executeCli, parseTriggerArguments, runTriggerCommand, signSyntheticWebhook };
|
|
117
|
+
export { type CliClient, type CliDependencies, createSyntheticTerminalEvent, downloadBundleAtomically, executeCli, parseTriggerArguments, resolveCredential, runAuthCommand, runAuthStatusCommand, runLoginCommand, runLogoutCommand, runTriggerCommand, signSyntheticWebhook };
|