mmx-cli 1.0.18 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -19
- package/dist/index.d.ts +71 -91
- package/dist/mmx.mjs +290 -294
- package/dist/sdk.mjs +702 -415
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<img src="https://file.cdn.minimax.io/public/MMX.png" alt="MiniMax" width="100%" />
|
|
1
|
+
<img src="https://file.cdn.minimax.io/public/MMX-capabilities.png" alt="MiniMax" width="100%" />
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<strong>The official CLI for the MiniMax AI Platform</strong><br>
|
|
5
|
-
Built for AI agents. Generate text, images, video,
|
|
5
|
+
Built for AI agents. Generate text, images, video, and speech — from any agent or terminal.
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
@@ -21,12 +21,11 @@
|
|
|
21
21
|
- **Image** — Text-to-image with aspect ratio and batch controls
|
|
22
22
|
- **Video** — Async video generation with progress tracking
|
|
23
23
|
- **Speech** — TTS with 30+ voices, speed control, streaming playback
|
|
24
|
-
- **Music** — Text-to-music with lyrics, instrumental mode, auto lyrics, and cover generation from reference audio
|
|
25
24
|
- **Vision** — Image understanding and description
|
|
26
25
|
- **Search** — Web search powered by MiniMax
|
|
27
26
|
- **Dual Region** — Seamless Global (`api.minimax.io`) and CN (`api.minimaxi.com`) support
|
|
28
27
|
|
|
29
|
-
<img src="https://file.cdn.minimax.io/public/MMX-CLI.png" alt="MiniMax" width="100%" />
|
|
28
|
+
<img src="https://file.cdn.minimax.io/public/MMX-CLI-help.png" alt="MiniMax" width="100%" />
|
|
30
29
|
|
|
31
30
|
## Install
|
|
32
31
|
|
|
@@ -56,7 +55,6 @@ mmx text chat --message "What is MiniMax?"
|
|
|
56
55
|
mmx image "A cat in a spacesuit"
|
|
57
56
|
mmx speech synthesize --text "Hello!" --out hello.mp3
|
|
58
57
|
mmx video generate --prompt "Ocean waves at sunset"
|
|
59
|
-
mmx music generate --prompt "Upbeat pop" --lyrics "[verse] La da dee, sunny day"
|
|
60
58
|
mmx search "MiniMax AI latest news"
|
|
61
59
|
mmx vision photo.jpg
|
|
62
60
|
mmx quota
|
|
@@ -85,12 +83,24 @@ mmx image generate --prompt "Logo" --out-dir ./out/
|
|
|
85
83
|
### `mmx video`
|
|
86
84
|
|
|
87
85
|
```bash
|
|
86
|
+
# Hailuo-2.3 (Video Generation V1)
|
|
88
87
|
mmx video generate --prompt "Ocean waves at sunset" --download sunset.mp4
|
|
89
88
|
mmx video generate --prompt "A robot painting" --async
|
|
89
|
+
|
|
90
|
+
# MiniMax-H3 (Video Generation V2)
|
|
91
|
+
mmx video generate --api-key "$MINIMAX_API_KEY" --model MiniMax-H3 --prompt "Ocean waves at sunset"
|
|
92
|
+
mmx video generate --api-key "$MINIMAX_API_KEY" --model MiniMax-H3 --prompt "The subject walks forward" --image start.jpg
|
|
93
|
+
mmx video generate --api-key "$MINIMAX_API_KEY" --model MiniMax-H3 --prompt "Keep the same character" --reference-image character.png --reference-video motion.mp4
|
|
94
|
+
|
|
90
95
|
mmx video task get --task-id 123456
|
|
96
|
+
mmx video task get --task-id 424010985738629 --model MiniMax-H3
|
|
91
97
|
mmx video download --file-id 176844028768320 --out video.mp4
|
|
92
98
|
```
|
|
93
99
|
|
|
100
|
+
For MiniMax-H3, local files and Base64 data URIs are preflight-checked against the documented limits: image 30 MB, reference video 50 MB, reference audio 15 MB, and total JSON request body 64 MB. The API validates dimensions, aspect ratio, duration, frame rate, and codecs for all media.
|
|
101
|
+
|
|
102
|
+
`--region` is an existing global CLI option, not an H3 parameter. Normal video generation does not need it; the CLI uses the saved or automatically detected region. H3 defaults to 2K, 5 seconds, and 16:9 for text-to-video.
|
|
103
|
+
|
|
94
104
|
### `mmx speech`
|
|
95
105
|
|
|
96
106
|
```bash
|
|
@@ -101,20 +111,6 @@ echo "Breaking news" | mmx speech synthesize --text-file - --out news.mp3
|
|
|
101
111
|
mmx speech voices
|
|
102
112
|
```
|
|
103
113
|
|
|
104
|
-
### `mmx music`
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
# Generate with lyrics
|
|
108
|
-
mmx music generate --prompt "Upbeat pop" --lyrics "[verse] La da dee, sunny day" --out song.mp3
|
|
109
|
-
# Auto-generate lyrics from prompt
|
|
110
|
-
mmx music generate --prompt "Indie folk, melancholic, rainy night" --lyrics-optimizer --out song.mp3
|
|
111
|
-
# Instrumental (no vocals)
|
|
112
|
-
mmx music generate --prompt "Cinematic orchestral" --instrumental --out bgm.mp3
|
|
113
|
-
# Cover — generate a cover version from a reference audio file
|
|
114
|
-
mmx music cover --prompt "Jazz, piano, warm female vocal" --audio-file original.mp3 --out cover.mp3
|
|
115
|
-
mmx music cover --prompt "Indie folk" --audio https://example.com/song.mp3 --out cover.mp3
|
|
116
|
-
```
|
|
117
|
-
|
|
118
114
|
### `mmx vision`
|
|
119
115
|
|
|
120
116
|
```bash
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export interface Config {
|
|
|
17
17
|
defaultTextModel?: string;
|
|
18
18
|
defaultSpeechModel?: string;
|
|
19
19
|
defaultVideoModel?: string;
|
|
20
|
-
defaultMusicModel?: string;
|
|
21
20
|
verbose: boolean;
|
|
22
21
|
quiet: boolean;
|
|
23
22
|
noColor: boolean;
|
|
@@ -151,6 +150,9 @@ export interface SpeechRequest {
|
|
|
151
150
|
speed?: number;
|
|
152
151
|
vol?: number;
|
|
153
152
|
pitch?: number;
|
|
153
|
+
emotion?: string;
|
|
154
|
+
text_normalization?: boolean;
|
|
155
|
+
latex_read?: boolean;
|
|
154
156
|
};
|
|
155
157
|
audio_setting?: {
|
|
156
158
|
format?: string;
|
|
@@ -226,11 +228,6 @@ export interface VideoRequest {
|
|
|
226
228
|
image: string[];
|
|
227
229
|
}>;
|
|
228
230
|
}
|
|
229
|
-
export interface VideoResponse {
|
|
230
|
-
base_resp: BaseResp;
|
|
231
|
-
task_id: string;
|
|
232
|
-
status: string;
|
|
233
|
-
}
|
|
234
231
|
export interface VideoTaskResponse {
|
|
235
232
|
base_resp: BaseResp;
|
|
236
233
|
task_id: string;
|
|
@@ -239,39 +236,66 @@ export interface VideoTaskResponse {
|
|
|
239
236
|
video_width?: number;
|
|
240
237
|
video_height?: number;
|
|
241
238
|
}
|
|
242
|
-
export
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
format?: string;
|
|
254
|
-
sample_rate?: number;
|
|
255
|
-
bitrate?: number;
|
|
256
|
-
channel?: number;
|
|
239
|
+
export type VideoV2ImageRole = "first_frame" | "last_frame" | "reference_image";
|
|
240
|
+
export type VideoV2Ratio = "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
|
|
241
|
+
export type VideoV2Duration = 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
|
|
242
|
+
export interface VideoV2TextContent {
|
|
243
|
+
type: "text";
|
|
244
|
+
text: string;
|
|
245
|
+
}
|
|
246
|
+
export interface VideoV2ImageContent {
|
|
247
|
+
type: "image_url";
|
|
248
|
+
image_url: {
|
|
249
|
+
url: string;
|
|
257
250
|
};
|
|
258
|
-
|
|
259
|
-
stream?: boolean;
|
|
260
|
-
aigc_watermark?: boolean;
|
|
251
|
+
role?: VideoV2ImageRole;
|
|
261
252
|
}
|
|
262
|
-
export interface
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
audio_url?: string;
|
|
267
|
-
status: number;
|
|
253
|
+
export interface VideoV2VideoContent {
|
|
254
|
+
type: "video_url";
|
|
255
|
+
video_url: {
|
|
256
|
+
url: string;
|
|
268
257
|
};
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
258
|
+
role: "reference_video";
|
|
259
|
+
}
|
|
260
|
+
export interface VideoV2AudioContent {
|
|
261
|
+
type: "audio_url";
|
|
262
|
+
audio_url: {
|
|
263
|
+
url: string;
|
|
264
|
+
};
|
|
265
|
+
role: "reference_audio";
|
|
266
|
+
}
|
|
267
|
+
export type VideoV2ContentItem = VideoV2TextContent | VideoV2ImageContent | VideoV2VideoContent | VideoV2AudioContent;
|
|
268
|
+
export interface VideoV2Request {
|
|
269
|
+
model: "MiniMax-H3";
|
|
270
|
+
content: VideoV2ContentItem[];
|
|
271
|
+
resolution: "2K";
|
|
272
|
+
duration: VideoV2Duration;
|
|
273
|
+
ratio?: VideoV2Ratio;
|
|
274
|
+
callback_url?: string;
|
|
275
|
+
}
|
|
276
|
+
export interface VideoV2Task {
|
|
277
|
+
id: string;
|
|
278
|
+
model: string;
|
|
279
|
+
status: "queued" | "running" | "succeeded" | "failed" | "cancelled" | "expired";
|
|
280
|
+
error?: {
|
|
281
|
+
code?: string;
|
|
282
|
+
message?: string;
|
|
274
283
|
};
|
|
284
|
+
created_at?: number;
|
|
285
|
+
updated_at?: number;
|
|
286
|
+
content?: {
|
|
287
|
+
url?: string;
|
|
288
|
+
};
|
|
289
|
+
resolution?: string;
|
|
290
|
+
duration?: number;
|
|
291
|
+
usage?: {
|
|
292
|
+
total_seconds?: number;
|
|
293
|
+
input_seconds?: number;
|
|
294
|
+
output_seconds?: number;
|
|
295
|
+
input_image_count?: number;
|
|
296
|
+
};
|
|
297
|
+
ratio?: string;
|
|
298
|
+
task_type?: string;
|
|
275
299
|
}
|
|
276
300
|
export interface QuotaResponse {
|
|
277
301
|
model_remains: QuotaModelRemain[];
|
|
@@ -385,11 +409,17 @@ declare class ImageSDK extends Client {
|
|
|
385
409
|
save(response: ImageResponse, options?: ImageSaveOptions): Promise<string[]>;
|
|
386
410
|
private validateParams;
|
|
387
411
|
}
|
|
388
|
-
export
|
|
412
|
+
export type VideoV2GenerateRequest = Omit<VideoV2Request, "model" | "resolution" | "duration"> & {
|
|
413
|
+
model?: VideoV2Request["model"];
|
|
414
|
+
resolution?: VideoV2Request["resolution"];
|
|
415
|
+
duration?: VideoV2Request["duration"];
|
|
416
|
+
};
|
|
417
|
+
export type VideoGenerateRequest = ModelPartial<VideoRequest> | VideoV2GenerateRequest;
|
|
418
|
+
export type VideoAsyncGenerateRequest = VideoGenerateRequest & {
|
|
389
419
|
async?: boolean;
|
|
390
420
|
pollInterval?: number;
|
|
391
421
|
timeout?: number;
|
|
392
|
-
}
|
|
422
|
+
};
|
|
393
423
|
export interface VideoDownloadRequest {
|
|
394
424
|
fileId: string;
|
|
395
425
|
outPath: string;
|
|
@@ -400,10 +430,11 @@ declare class VideoSDK extends Client {
|
|
|
400
430
|
}): Promise<{
|
|
401
431
|
taskId: string;
|
|
402
432
|
}>;
|
|
403
|
-
generate(request:
|
|
404
|
-
getTask({ taskId }: {
|
|
433
|
+
generate(request: VideoAsyncGenerateRequest): Promise<VideoTaskResponse | VideoV2Task>;
|
|
434
|
+
getTask({ taskId, model }: {
|
|
405
435
|
taskId: string;
|
|
406
|
-
|
|
436
|
+
model?: string;
|
|
437
|
+
}): Promise<VideoTaskResponse | VideoV2Task>;
|
|
407
438
|
download(request: VideoDownloadRequest): Promise<{
|
|
408
439
|
size: number;
|
|
409
440
|
save: string;
|
|
@@ -411,56 +442,6 @@ declare class VideoSDK extends Client {
|
|
|
411
442
|
}>;
|
|
412
443
|
private validateParams;
|
|
413
444
|
}
|
|
414
|
-
export interface MusicGenerateRequest extends MusicRequest {
|
|
415
|
-
/** Vocal style, e.g. "warm male baritone", "bright female soprano", "duet with harmonies" */
|
|
416
|
-
vocals?: string;
|
|
417
|
-
/** Music genre, e.g. folk, pop, jazz */
|
|
418
|
-
genre?: string;
|
|
419
|
-
/** Mood or emotion, e.g. warm, melancholic, uplifting */
|
|
420
|
-
mood?: string;
|
|
421
|
-
/** Instruments to feature, e.g. "acoustic guitar, piano" */
|
|
422
|
-
instruments?: string;
|
|
423
|
-
/** Tempo description, e.g. fast, slow, moderate */
|
|
424
|
-
tempo?: string;
|
|
425
|
-
/** Exact tempo in beats per minute */
|
|
426
|
-
bpm?: number;
|
|
427
|
-
/** Musical key, e.g. C major, A minor, G sharp */
|
|
428
|
-
key?: string;
|
|
429
|
-
/** Elements to avoid in the generated music */
|
|
430
|
-
avoid?: string;
|
|
431
|
-
/** Use case context, e.g. "background music for video", "theme song" */
|
|
432
|
-
use_case?: string;
|
|
433
|
-
/** Song structure, e.g. "verse-chorus-verse-bridge-chorus" */
|
|
434
|
-
structure?: string;
|
|
435
|
-
/** Reference tracks or artists, e.g. "similar to Ed Sheeran, Taylor Swift" */
|
|
436
|
-
references?: string;
|
|
437
|
-
/** Additional fine-grained requirements not covered above */
|
|
438
|
-
extra?: string;
|
|
439
|
-
/** Generate instrumental music (no vocals) */
|
|
440
|
-
instrumental?: boolean;
|
|
441
|
-
/** Use case */
|
|
442
|
-
useCase?: string;
|
|
443
|
-
}
|
|
444
|
-
declare class MusicSDK extends Client {
|
|
445
|
-
private generateStream;
|
|
446
|
-
generate(request: ModelPartial<MusicGenerateRequest> & {
|
|
447
|
-
stream: true;
|
|
448
|
-
}): Promise<AsyncGenerator<Uint8Array<ArrayBuffer>>>;
|
|
449
|
-
generate(request: ModelPartial<MusicGenerateRequest>): Promise<MusicResponse>;
|
|
450
|
-
/**
|
|
451
|
-
* Save generated music audio to a file. Decodes the hex-encoded audio
|
|
452
|
-
* from the API response and writes it to disk. Creates intermediate
|
|
453
|
-
* directories as needed.
|
|
454
|
-
*
|
|
455
|
-
* @param response — The response from `generate()`.
|
|
456
|
-
* @param outPath — Target file path. Defaults to `music_<timestamp>.mp3`.
|
|
457
|
-
* @param ext — File extension (default: `"mp3"`).
|
|
458
|
-
* @returns The absolute path of the saved file.
|
|
459
|
-
*/
|
|
460
|
-
save(response: MusicResponse, outPath?: string, ext?: string): string;
|
|
461
|
-
private buildPrompt;
|
|
462
|
-
private validateParams;
|
|
463
|
-
}
|
|
464
445
|
export interface SearchResult {
|
|
465
446
|
title: string;
|
|
466
447
|
link: string;
|
|
@@ -514,7 +495,6 @@ export declare class MiniMaxSDK extends Client {
|
|
|
514
495
|
readonly speech: SpeechSDK;
|
|
515
496
|
readonly image: ImageSDK;
|
|
516
497
|
readonly video: VideoSDK;
|
|
517
|
-
readonly music: MusicSDK;
|
|
518
498
|
readonly search: SearchSDK;
|
|
519
499
|
readonly vision: VisionSDK;
|
|
520
500
|
readonly quota: QuotaSDK;
|