mmx-cli 1.0.27 → 1.0.29

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 CHANGED
@@ -70,9 +70,11 @@ derives the npm package version from that tag. See [the release guide](docs/rele
70
70
 
71
71
  ### `mmx text`
72
72
 
73
+ `text chat` and `text repl` default to `MiniMax-M3.1-Flash`. An explicit `--model` or saved `default-text-model` takes precedence. It is available with Token Plan, MiniMax Code, and pay-as-you-go keys. See the [model guide](https://platform.minimax.io/docs/guides/text-generation#agent).
74
+
73
75
  ```bash
74
76
  mmx text chat --message "Write a poem"
75
- mmx text chat --model MiniMax-M3 --message "Hello" --stream
77
+ mmx text chat --model MiniMax-M3.1-Flash --message "Hello" --stream
76
78
  mmx text chat --system "You are a coding assistant" --message "Fizzbuzz in Go"
77
79
  mmx text chat --message "user:Hi" --message "assistant:Hey!" --message "How are you?"
78
80
  cat messages.json | mmx text chat --messages-file - --output json
@@ -84,8 +86,19 @@ cat messages.json | mmx text chat --messages-file - --output json
84
86
  mmx image "A cat in a spacesuit"
85
87
  mmx image generate --prompt "A cat" --n 3 --aspect-ratio 16:9
86
88
  mmx image generate --prompt "Logo" --out-dir ./out/
89
+
90
+ # MiniMax-H3-Image text-to-image
91
+ mmx image generate --model MiniMax-H3-Image --prompt "An orange cat basking on a windowsill, warm afternoon light, film look" --aspect-ratio 16:9 --area 2K
92
+ mmx image generate --model MiniMax-H3-Image --prompt "Minimal poster" --size 2720x1536 --output-format png --n 2
93
+
94
+ # MiniMax-H3-Image image editing (1-16 reference images, numbered Picture 1, 2, ... in order)
95
+ mmx image generate --model MiniMax-H3-Image --prompt "Replace the cat in Picture 1 with the Shiba Inu in Picture 2, keep the background" --image cat.jpg --image https://example.com/dog.png
87
96
  ```
88
97
 
98
+ Without `--image`, MiniMax-H3-Image calls `/v1/images/generations` (text-to-image); with `--image` it calls `/v1/images/edits` (image editing). Choose one way to set the output size: `--size WIDTHxHEIGHT` (area 655,360–20,000,000 px, aspect ratio 1:3–3:1), or `--aspect-ratio` plus `--area 1K|2K|4K` (default 4K). `--no-prompt-enhance` turns off prompt enhancement for text-to-image and then requires `--size` or a concrete `--aspect-ratio`. A failed image (for example one that fails the content safety check) does not stop the others; files keep their original position in the name and failures are reported on stderr (even with `--quiet`). With `--response-format base64`, the total output area (`n` × width × height) is limited to 20,000,000 px for png and 80,000,000 px for jpg/webp; with `size auto` each image counts as its `--area` level (4K = 4096 × 4096). Requests over the limit are rejected locally.
99
+
100
+ The H3-Image endpoints are not idempotent, so a retry after a timeout generates and bills again. The CLI never retries them automatically and raises the timeout for these requests to at least 600 seconds, matching the server. `--seed`, `--prompt-optimizer`, and `--subject-ref` apply only to image-01.
101
+
89
102
  ### `mmx video`
90
103
 
91
104
  ```bash
@@ -105,7 +118,7 @@ mmx video download --file-id 176844028768320 --out video.mp4
105
118
 
106
119
  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.
107
120
 
108
- `--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.
121
+ `--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. Use `--resolution 768P` for 768P output.
109
122
 
110
123
  ### `mmx speech`
111
124
 
@@ -196,22 +209,28 @@ Credential priority: `--api-key` flag > OAuth (config) > `api_key` (config).
196
209
  mmx quota
197
210
  mmx config show
198
211
  mmx config set --key region --value cn
199
- mmx config set --key default-text-model --value MiniMax-M3
212
+ mmx config set --key default-text-model --value MiniMax-M3.1-Flash
200
213
  mmx config export-schema | jq .
201
214
  ```
202
215
 
203
216
  ### `mmx agent setup`
204
217
 
205
- Configure MiniMax for Claude Code, Codex, Grok Build, OpenCode, Hermes, or Pi while preserving unrelated settings. Run without options for the interactive wizard; supplying options makes the command non-interactive and suitable for scripts.
218
+ Configure MiniMax for Claude Code, Codex, Grok Build, OpenCode, Hermes, Pi, [Oh my Pi](https://github.com/can1357/oh-my-pi), or Zed while preserving unrelated settings. Run without options for the interactive wizard; supplying options makes the command non-interactive and suitable for scripts.
206
219
 
207
220
  ```bash
208
221
  mmx agent setup
209
222
  mmx agent setup --agent codex --agent claude-code --api-key "$MINIMAX_API_KEY" --region global
210
223
  mmx agent setup --all --api-key "$MINIMAX_API_KEY" --region cn --output json
224
+ mmx agent setup --agent oh-my-pi --api-key "$MINIMAX_API_KEY" --region global
225
+ # --agent omp is an alias for --agent oh-my-pi
211
226
  ```
212
227
 
228
+ `agent setup` defaults to `MiniMax-M3.1-Flash` for both Token Plan and pay-as-you-go keys (`sk-api-...`). In non-interactive mode, `--model` overrides this selection.
229
+
213
230
  The command verifies the key and selected region before writing. Existing files are backed up when changed; use `--dry-run` to preview without a live request. In the interactive wizard, compatible agents that are missing from `PATH` can be installed from a second multi-select list using their official packages or installer scripts. The Hermes install uses its official core CLI stages and skips optional system packages, Node workspace, browser, computer-use, setup, and gateway stages. After installation, mmx applies the MiniMax configuration while preserving installer settings. Agents that fail a platform or prerequisite check are explained and left configuration-only. Non-interactive invocations remain configuration-only, and the command never launches an agent.
214
231
 
232
+ Oh my Pi uses its native `~/.omp/agent/models.yml` and `config.yml` (existing `.yaml` files are updated in place). Configuration honors `OMP_PROFILE` / `PI_PROFILE`, `PI_CONFIG_DIR`, and the default-profile `PI_CODING_AGENT_DIR` override. Run `omp` once to migrate legacy JSON-only configuration before using setup. Interactive installation uses the official prebuilt-binary installer, so it does not require Bun or npm.
233
+
215
234
  ### `mmx update`
216
235
 
217
236
  ```bash
package/dist/index.d.ts CHANGED
@@ -259,6 +259,67 @@ export interface ImageResponse {
259
259
  failed_count: number;
260
260
  };
261
261
  }
262
+ export type ImageH3Area = "1K" | "2K" | "4K";
263
+ export type ImageH3OutputFormat = "png" | "jpeg" | "jpg" | "webp";
264
+ export type ImageH3ResponseFormat = "url" | "b64_json";
265
+ /** Shared body of `POST /v1/images/generations` and `POST /v1/images/edits`. */
266
+ export interface ImageH3BaseRequest {
267
+ model: "MiniMax-H3-Image";
268
+ prompt: string;
269
+ n?: number;
270
+ /** `auto` (default) or `WIDTHxHEIGHT`, e.g. `2720x1536`. */
271
+ size?: string;
272
+ /** `auto` (default) or `X:Y`. Only valid when size is unset or `auto`. */
273
+ aspect_ratio?: string;
274
+ /** Area level. Only valid when size is unset or `auto`. Default: `4K`. */
275
+ area?: ImageH3Area;
276
+ output_format?: ImageH3OutputFormat;
277
+ /** JPEG / WEBP quality, 0-100 (default 95). Ignored for PNG. */
278
+ output_compression?: number;
279
+ response_format?: ImageH3ResponseFormat;
280
+ aigc_watermark?: boolean;
281
+ }
282
+ /** Text-to-image: `POST /v1/images/generations`. */
283
+ export interface ImageH3GenerationRequest extends ImageH3BaseRequest {
284
+ disable_prompt_enhanced?: boolean;
285
+ }
286
+ /** Image edit: `POST /v1/images/edits` with 1-16 reference images. */
287
+ export interface ImageH3EditRequest extends ImageH3BaseRequest {
288
+ images: Array<{
289
+ image_url: string;
290
+ }>;
291
+ }
292
+ export interface ImageH3Item {
293
+ url?: string;
294
+ b64_json?: string;
295
+ size?: string;
296
+ revised_prompt?: string;
297
+ error?: {
298
+ code?: string;
299
+ message?: string;
300
+ };
301
+ }
302
+ export interface ImageH3Usage {
303
+ generated_images?: number;
304
+ total_tokens?: number;
305
+ input_tokens?: number;
306
+ output_tokens?: number;
307
+ input_tokens_details?: {
308
+ text_tokens?: number;
309
+ image_tokens?: number;
310
+ };
311
+ output_tokens_details?: {
312
+ image_tokens?: number;
313
+ };
314
+ }
315
+ export interface ImageH3Response {
316
+ created?: number;
317
+ /** Always `n` items in order; failed items carry only `error`. */
318
+ data: ImageH3Item[];
319
+ output_format?: "png" | "jpeg" | "webp";
320
+ usage?: ImageH3Usage;
321
+ request_id?: string;
322
+ }
262
323
  export interface VideoRequest {
263
324
  model: string;
264
325
  prompt: string;
@@ -279,6 +340,7 @@ export interface VideoTaskResponse {
279
340
  video_height?: number;
280
341
  }
281
342
  export type VideoV2ImageRole = "first_frame" | "last_frame" | "reference_image";
343
+ export type VideoV2Resolution = "768P" | "2K";
282
344
  export type VideoV2Ratio = "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
283
345
  export type VideoV2Duration = 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
284
346
  export interface VideoV2TextContent {
@@ -310,7 +372,7 @@ export type VideoV2ContentItem = VideoV2TextContent | VideoV2ImageContent | Vide
310
372
  export interface VideoV2Request {
311
373
  model: "MiniMax-H3";
312
374
  content: VideoV2ContentItem[];
313
- resolution: "2K";
375
+ resolution: VideoV2Resolution;
314
376
  duration: VideoV2Duration;
315
377
  ratio?: VideoV2Ratio;
316
378
  callback_url?: string;
@@ -496,8 +558,17 @@ export interface ImageSaveOptions {
496
558
  /** Suppress progress output. */
497
559
  quiet?: boolean;
498
560
  }
561
+ /**
562
+ * MiniMax-H3-Image request. Without `images` it calls `/v1/images/generations`;
563
+ * with 1-16 `images` it calls `/v1/images/edits`.
564
+ */
565
+ export type ImageH3GenerateRequest = ImageH3GenerationRequest & {
566
+ images?: ImageH3EditRequest["images"];
567
+ };
499
568
  declare class ImageSDK extends Client {
569
+ generate(request: ImageH3GenerateRequest): Promise<ImageH3Response>;
500
570
  generate(request: ModelPartial<ImageRequest>): Promise<ImageResponse>;
571
+ private generateH3;
501
572
  /**
502
573
  * Download and save images from a `generate()` response to disk.
503
574
  *
@@ -505,7 +576,7 @@ declare class ImageSDK extends Client {
505
576
  * and creates intermediate directories as needed. Returns the absolute
506
577
  * paths of all saved files.
507
578
  */
508
- save(response: ImageResponse, options?: ImageSaveOptions): Promise<string[]>;
579
+ save(response: ImageResponse | ImageH3Response, options?: ImageSaveOptions): Promise<string[]>;
509
580
  private validateParams;
510
581
  }
511
582
  export type VideoV2GenerateRequest = Omit<VideoV2Request, "model" | "resolution" | "duration"> & {