|
1 | 1 | # minimax-cli |
2 | 2 |
|
3 | | -CLI for the [MiniMax AI Platform](https://platform.minimax.io) — generate text, images, video, speech, and music from the terminal. Supports **Global** (`api.minimax.io`) and **CN** (`api.minimaxi.com`) with automatic region detection. |
| 3 | +CLI for the [MiniMax AI Platform](https://platform.minimax.io) — generate text, images, video, speech, and music from the terminal. |
4 | 4 |
|
5 | | ---- |
6 | | - |
7 | | -### Why minimax-cli? |
8 | | - |
9 | | -Zero-config Agent integration — `minimax config export-schema` dumps a standard Anthropic/OpenAI-compatible JSON Tool Schema in one shot. Cursor, Cline, Dify, and any other Agent framework that speaks tool schemas can start using all minimax commands instantly. |
10 | | - |
11 | | -Pipeline & CI friendly — all data flows through `stdout`, every piece of UI (spinners, status bars, progress bars) stays on `stderr`. `minimax text chat --message "hi" | jq .` Just Works™ — no stray ANSI codes, no mixed streams. |
| 5 | +Supports **Global** (`api.minimax.io`) and **CN** (`api.minimaxi.com`) with automatic region detection. |
12 | 6 |
|
13 | | -Polished terminal experience — every invocation shows a branded dashboard with live quota balance and a real-color status bar exposing region, key source, and active model. Because how you look matters in the shell. |
| 7 | +[中文文档](README_CN.md) |
14 | 8 |
|
15 | 9 | --- |
16 | 10 |
|
17 | 11 | ## Install |
18 | 12 |
|
| 13 | +**Binary (recommended) — macOS / Linux / Windows:** |
| 14 | + |
19 | 15 | ```bash |
20 | | -curl -fsSL https://raw.githubusercontent.com/MiniMax-AI-Dev/minimax-cli/main/install.sh | sh |
| 16 | +curl -fsSL https://raw.githubusercontent.com/MiniMax-AI-Dev/cli/main/install.sh | sh |
21 | 17 | ``` |
22 | 18 |
|
23 | | -Or via npm / bun: |
| 19 | +**npm / bun:** |
24 | 20 |
|
25 | 21 | ```bash |
26 | 22 | npm install -g minimax-cli |
27 | 23 | ``` |
28 | 24 |
|
| 25 | +--- |
| 26 | + |
29 | 27 | ## Quick Start |
30 | 28 |
|
31 | 29 | ```bash |
32 | 30 | minimax auth login --api-key sk-xxxxx |
| 31 | + |
33 | 32 | minimax text chat --message "What is MiniMax?" |
34 | | -minimax image generate --prompt "A cat in a spacesuit" |
35 | | -minimax video generate --prompt "Ocean waves at sunset" |
| 33 | +minimax image "A cat in a spacesuit" |
36 | 34 | minimax speech synthesize --text "Hello!" --out hello.mp3 |
37 | | -minimax music generate --prompt "Indie folk" --lyrics "La la la..." |
38 | | -minimax vision describe --image photo.jpg |
39 | | -minimax search query --q "MiniMax AI latest news" |
| 35 | +minimax search "MiniMax AI latest news" |
| 36 | +minimax vision photo.jpg |
| 37 | +minimax quota |
40 | 38 | ``` |
41 | 39 |
|
| 40 | +--- |
| 41 | + |
42 | 42 | ## Commands |
43 | 43 |
|
44 | | -| Command | Description | |
| 44 | +### Text |
| 45 | + |
| 46 | +```bash |
| 47 | +minimax text chat --message "Write a poem" |
| 48 | +minimax text chat --model MiniMax-M2.7-highspeed --message "Hello" --stream |
| 49 | +minimax text chat --system "You are a coding assistant" --message "Fizzbuzz in Go" |
| 50 | +minimax text chat --message "user:Hi" --message "assistant:Hey!" --message "How are you?" |
| 51 | +cat messages.json | minimax text chat --messages-file - --output json |
| 52 | +``` |
| 53 | + |
| 54 | +### Image |
| 55 | + |
| 56 | +```bash |
| 57 | +minimax image "A cat in a spacesuit" # shorthand |
| 58 | +minimax image generate --prompt "A cat" --n 3 --aspect-ratio 16:9 |
| 59 | +minimax image generate --prompt "Logo" --out-dir ./out/ |
| 60 | +``` |
| 61 | + |
| 62 | +### Video |
| 63 | + |
| 64 | +```bash |
| 65 | +minimax video generate --prompt "Ocean waves at sunset" --async |
| 66 | +minimax video generate --prompt "A robot painting" --download sunset.mp4 |
| 67 | +minimax video task get --task-id 123456 |
| 68 | +minimax video download --file-id 176844028768320 --out video.mp4 |
| 69 | +``` |
| 70 | + |
| 71 | +### Speech |
| 72 | + |
| 73 | +```bash |
| 74 | +minimax speech synthesize --text "Hello!" --out hello.mp3 |
| 75 | +minimax speech synthesize --text "Stream me" --stream | mpv - |
| 76 | +minimax speech synthesize --text "Hi" --voice Boyan_new_hailuo --speed 1.2 |
| 77 | +echo "Breaking news" | minimax speech synthesize --text-file - --out news.mp3 |
| 78 | +minimax speech voices |
| 79 | +``` |
| 80 | + |
| 81 | +### Music |
| 82 | + |
| 83 | +```bash |
| 84 | +minimax music "Upbeat pop" # shorthand |
| 85 | +minimax music generate --prompt "Jazz" --lyrics "La la la" --out song.mp3 |
| 86 | +``` |
| 87 | + |
| 88 | +### Vision |
| 89 | + |
| 90 | +```bash |
| 91 | +minimax vision photo.jpg # shorthand |
| 92 | +minimax vision describe --image https://example.com/img.jpg --prompt "What breed?" |
| 93 | +minimax vision describe --file-id file-123 |
| 94 | +``` |
| 95 | + |
| 96 | +### Search |
| 97 | + |
| 98 | +```bash |
| 99 | +minimax search "MiniMax AI" # shorthand |
| 100 | +minimax search query --q "latest news" --output json |
| 101 | +``` |
| 102 | + |
| 103 | +### Quota & Config |
| 104 | + |
| 105 | +```bash |
| 106 | +minimax quota |
| 107 | +minimax config show |
| 108 | +minimax config set --key region --value cn |
| 109 | +minimax config export-schema | jq . |
| 110 | +``` |
| 111 | + |
| 112 | +### Auth |
| 113 | + |
| 114 | +```bash |
| 115 | +minimax auth login --api-key sk-xxxxx |
| 116 | +minimax auth login # OAuth browser flow |
| 117 | +minimax auth status |
| 118 | +minimax auth refresh |
| 119 | +minimax auth logout |
| 120 | +``` |
| 121 | + |
| 122 | +### Update |
| 123 | + |
| 124 | +```bash |
| 125 | +minimax update |
| 126 | +minimax update latest |
| 127 | +``` |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## Global Flags |
| 132 | + |
| 133 | +| Flag | Description | |
45 | 134 | |---|---| |
46 | | -| `text chat` | Chat completion (MiniMax-M2.7) | |
47 | | -| `image generate` | Image generation (image-01) | |
48 | | -| `video generate` | Video generation (Hailuo-2.3) | |
49 | | -| `speech synthesize` | Text-to-speech (speech-2.8-hd) | |
50 | | -| `music generate` | Music generation (music-2.5) | |
51 | | -| `vision describe` | Image understanding (VLM) | |
52 | | -| `search query` | Web search | |
53 | | -| `quota show` | Usage quotas | |
54 | | -| `config show / set` | Configuration | |
55 | | -| `config export-schema` | Export tool schemas as JSON | |
56 | | -| `auth login/status/refresh/logout` | Authentication | |
57 | | -| `update` | Self-update | |
| 135 | +| `--api-key <key>` | API key (overrides config) | |
| 136 | +| `--region <global\|cn>` | API region | |
| 137 | +| `--output <text\|json\|yaml>` | Output format | |
| 138 | +| `--quiet` | Data only on stdout, no decorations | |
| 139 | +| `--verbose` | Print HTTP request/response | |
| 140 | +| `--dry-run` | Show request body, no API call | |
| 141 | +| `--async` | Return task ID immediately (video) | |
| 142 | +| `--non-interactive` | Disable prompts (CI/agent mode) | |
| 143 | +| `--timeout <seconds>` | Request timeout (default: 300) | |
| 144 | +| `--no-color` | Disable ANSI colors | |
| 145 | + |
| 146 | +Add `--help` to any command for full options. |
58 | 147 |
|
59 | | -Run `minimax <command> --help` for full options. |
| 148 | +--- |
60 | 149 |
|
61 | | -## Agent / CI Usage |
| 150 | +## Agent / CI Integration |
62 | 151 |
|
63 | | -See [skill/SKILL.md](skill/SKILL.md) for the complete agent integration guide, including all command signatures, tool schema export, and piping patterns. |
| 152 | +Export all commands as JSON Tool Schema in one shot: |
64 | 153 |
|
65 | 154 | ```bash |
66 | | -minimax video generate --prompt "A robot." --async --quiet # non-blocking |
67 | | -minimax text chat --message "Hi" --output json | jq . # pipe-friendly |
68 | | -minimax config export-schema | jq . # tool schemas |
| 155 | +minimax config export-schema | jq . |
| 156 | +minimax config export-schema --command "text chat" |
69 | 157 | ``` |
70 | 158 |
|
71 | | -## Changelog |
| 159 | +Compatible with Cursor, Cline, Dify, and any framework that speaks Anthropic/OpenAI tool schemas. See [skill/SKILL.md](skill/SKILL.md) for the full integration guide. |
72 | 160 |
|
73 | | -### v0.5.0 |
74 | | -- **Brand status bar**: HTTP requests now print a beautiful true-color status bar showing `MINIMAX Region: CN | Key: sk-c...nI7s | Model: MiniMax-M2.7` in MiniMax brand colors (blue, purple, cyan, pink) |
75 | | -- Status bar respects `--quiet` flag and only renders in TTY terminals |
76 | | -- Removed duplicate `[Model: ...]` output from `text chat` command |
| 161 | +**Piping:** |
77 | 162 |
|
78 | | -### v0.1.0 |
79 | | -- Initial release — text, image, video, speech, music, vision, and search commands |
| 163 | +```bash |
| 164 | +minimax text chat --message "Hello" --output json | jq .content |
| 165 | +minimax image "A logo" --quiet | xargs curl -O |
| 166 | +minimax video generate --prompt "A robot" --async --quiet |
| 167 | +``` |
| 168 | + |
| 169 | +stdout is always clean data. stderr carries all UI (status bar, spinners, progress). |
| 170 | + |
| 171 | +--- |
80 | 172 |
|
81 | 173 | ## Output Philosophy |
82 | 174 |
|
83 | | -- `stdout` → data only (text, paths, JSON) |
84 | | -- `stderr` → spinners, warnings, help |
| 175 | +- `stdout` → data only (text, URLs, JSON, raw audio bytes) |
| 176 | +- `stderr` → status bar, progress, warnings, help |
| 177 | + |
| 178 | +--- |
85 | 179 |
|
86 | 180 | ## License |
87 | 181 |
|
|
0 commit comments