Skip to content

Commit e98eb11

Browse files
author
Raylan LIN
committed
docs: improve --help for text chat, search, speech synthesize
- text chat --model: list available models (M2.7, M2.7-highspeed) - text chat --message: clarify role: prefix usage with examples - text chat --messages-file: show expected JSON format - text chat --temperature: explain 0.0-1.0 range and default (0.7) - text chat --top-p: explain probability mass concept and default (0.95) - text chat --tool: mention OpenAI compatibility - speech synthesize --model: list all models with characteristics - speech synthesize --text: note 10,000 char limit and SSML support - speech synthesize --voice: point users to 'mmx speech voices' command - speech synthesize --speed/volume/pitch: add ranges and defaults - speech synthesize --format: list all formats (mp3, wav, ogg, flac) - speech synthesize --sample-rate: list common values - speech synthesize --language: list supported language codes - speech synthesize --subtitles: explain use case (karaoke/video sync) - speech synthesize --pronunciation: clarify word/pronunciation format - speech synthesize --stream: add pipe-to-player example - search query: clarify output includes titles/URLs/snippets - search query: add pipeline example (search → text chat)
1 parent 233ff94 commit e98eb11

3 files changed

Lines changed: 31 additions & 27 deletions

File tree

src/commands/search/query.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ interface SearchResponse {
2020

2121
export default defineCommand({
2222
name: 'search query',
23-
description: 'Search the web via MiniMax',
23+
description: 'Search the web via MiniMax. Returns organic results with titles, URLs, and snippets.',
2424
usage: 'mmx search query --q <query>',
2525
options: [
26-
{ flag: '--q <query>', description: 'Search query string' },
26+
{ flag: '--q <query>', description: 'Search query string. Supports natural language queries.' },
2727
],
2828
examples: [
2929
'mmx search query --q "MiniMax AI"',
30-
'mmx search query --q "latest news" --output json',
30+
'mmx search query --q "latest AI news 2025" --output json',
31+
'# Use in a pipeline: search → text chat',
32+
'RESULTS=$(mmx search query --q "rust async patterns" --output json --quiet) && mmx text chat --message "Summarize: $RESULTS"',
3133
],
3234
async run(config: Config, flags: GlobalFlags) {
3335
const query = (flags.q ?? (flags._positional as string[]|undefined)?.[0]) as string | undefined;

src/commands/speech/synthesize.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,33 @@ import type { SpeechRequest, SpeechResponse } from '../../types/api';
1212

1313
export default defineCommand({
1414
name: 'speech synthesize',
15-
description: 'Synchronous TTS, up to 10k chars (speech-2.8-hd / 2.6 / 02)',
15+
description: 'Synchronous TTS, up to 10,000 characters (speech-2.8-hd / 2.6 / 02)',
1616
usage: 'mmx speech synthesize --text <text> [--out <path>] [flags]',
1717
options: [
18-
{ flag: '--model <model>', description: 'Model ID (default: speech-2.8-hd)' },
19-
{ flag: '--text <text>', description: 'Text to synthesize' },
20-
{ flag: '--text-file <path>', description: 'Read text from file (use - for stdin)' },
21-
{ flag: '--voice <id>', description: 'Voice ID (default: English_expressive_narrator)' },
22-
{ flag: '--speed <n>', description: 'Speech speed multiplier', type: 'number' },
23-
{ flag: '--volume <n>', description: 'Volume level', type: 'number' },
24-
{ flag: '--pitch <n>', description: 'Pitch adjustment', type: 'number' },
25-
{ flag: '--format <fmt>', description: 'Audio format (default: mp3)' },
26-
{ flag: '--sample-rate <hz>', description: 'Sample rate (default: 32000)', type: 'number' },
27-
{ flag: '--bitrate <bps>', description: 'Bitrate (default: 128000)', type: 'number' },
28-
{ flag: '--channels <n>', description: 'Audio channels (default: 1)', type: 'number' },
29-
{ flag: '--language <code>', description: 'Language boost' },
30-
{ flag: '--subtitles', description: 'Include subtitle timing data' },
31-
{ flag: '--pronunciation <from/to>', description: 'Custom pronunciation (repeatable)', type: 'array' },
18+
{ flag: '--model <model>', description: 'Model ID: speech-2.8-hd (default, highest quality), speech-2.6 (balanced), speech-02 (fastest)' },
19+
{ flag: '--text <text>', description: 'Text to synthesize. Max 10,000 characters. Supports SSML-like pronunciation tags.' },
20+
{ flag: '--text-file <path>', description: 'Read text from file (use - for stdin). Same 10k char limit applies.' },
21+
{ flag: '--voice <id>', description: 'Voice ID (default: English_expressive_narrator). Run "mmx speech voices" to list available voices.' },
22+
{ flag: '--speed <n>', description: 'Speech speed multiplier (default: 1.0). Range: 0.5–2.0.', type: 'number' },
23+
{ flag: '--volume <n>', description: 'Volume level in dB (default: 0). Range: -10 to 10.', type: 'number' },
24+
{ flag: '--pitch <n>', description: 'Pitch adjustment in semitones (default: 0). Range: -12 to 12.', type: 'number' },
25+
{ flag: '--format <fmt>', description: 'Audio format: mp3 (default), wav, ogg, flac' },
26+
{ flag: '--sample-rate <hz>', description: 'Sample rate in Hz (default: 32000). Common values: 16000, 24000, 32000, 44100', type: 'number' },
27+
{ flag: '--bitrate <bps>', description: 'Bitrate in bps (default: 128000). Higher = better quality, larger file.', type: 'number' },
28+
{ flag: '--channels <n>', description: 'Audio channels: 1 (mono, default) or 2 (stereo)', type: 'number' },
29+
{ flag: '--language <code>', description: 'Language code to boost pronunciation accuracy (e.g. "en", "zh", "ja", "ko", "es", "fr", "de"). Auto-detected from text if not specified.' },
30+
{ flag: '--subtitles', description: 'Include word-level subtitle timing data in the response. Useful for karaoke or video syncing.' },
31+
{ flag: '--pronunciation <from/to>', description: 'Custom pronunciation mapping. Format: word/pronunciation (repeatable). E.g. --pronunciation "MiniMax/min-ee-maks"', type: 'array' },
3232
{ flag: '--out <path>', description: 'Save audio to file (uses hex decoding)' },
33-
{ flag: '--stream', description: 'Stream raw audio to stdout' },
33+
{ flag: '--stream', description: 'Stream raw audio to stdout. Pipe to a player: --stream | mpv -' },
3434
],
3535
examples: [
3636
'mmx speech synthesize --text "Hello, world!"',
3737
'mmx speech synthesize --text "Hello, world!" --out hello.mp3',
3838
'echo "Breaking news." | mmx speech synthesize --text-file - --out news.mp3',
3939
'mmx speech synthesize --text "Stream" --stream | mpv --no-terminal -',
40+
'mmx speech synthesize --text "Bonjour" --language fr --voice French_expressive_woman --out french.mp3',
41+
'mmx speech synthesize --text "Welcome" --pronunciation "Welcome/wel-kum" --out custom.mp3',
4042
],
4143
async run(config: Config, flags: GlobalFlags) {
4244
let text = (flags.text ?? (flags._positional as string[]|undefined)?.[0]) as string | undefined;

src/commands/text/chat.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ export default defineCommand({
8080
description: 'Send a chat completion (MiniMax Messages API)',
8181
usage: 'mmx text chat --message <text> [flags]',
8282
options: [
83-
{ flag: '--model <model>', description: 'Model ID (default: MiniMax-M2.7)' },
84-
{ flag: '--message <text>', description: 'Message text (repeatable, prefix role: to set role)', required: true, type: 'array' },
85-
{ flag: '--messages-file <path>', description: 'JSON file with messages array (use - for stdin)' },
86-
{ flag: '--system <text>', description: 'System prompt' },
83+
{ flag: '--model <model>', description: 'Model ID: MiniMax-M2.7 (default, balanced), MiniMax-M2.7-highspeed (faster, lower cost)' },
84+
{ flag: '--message <text>', description: 'Message text (repeatable). Prefix with role: to set role — e.g. "user:Hello", "assistant:Hi!", "system:You are helpful"', required: true, type: 'array' },
85+
{ flag: '--messages-file <path>', description: 'JSON file with messages array (use - for stdin). Format: [{"role": "user", "content": "..."}]' },
86+
{ flag: '--system <text>', description: 'System prompt to set assistant behavior' },
8787
{ flag: '--max-tokens <n>', description: 'Maximum tokens to generate (default: 4096)', type: 'number' },
88-
{ flag: '--temperature <n>', description: 'Sampling temperature (0.0, 1.0]', type: 'number' },
89-
{ flag: '--top-p <n>', description: 'Nucleus sampling threshold', type: 'number' },
90-
{ flag: '--stream', description: 'Stream response tokens (default: on in TTY)' },
91-
{ flag: '--tool <json-or-path>', description: 'Tool definition as JSON or file path (repeatable)', type: 'array' },
88+
{ flag: '--temperature <n>', description: 'Sampling temperature: 0.0 (deterministic) to 1.0 (creative). Default: 0.7', type: 'number' },
89+
{ flag: '--top-p <n>', description: 'Nucleus sampling threshold: only sample from top-p probability mass (default: 0.95)', type: 'number' },
90+
{ flag: '--stream', description: 'Stream response tokens as they are generated (default: on in TTY)' },
91+
{ flag: '--tool <json-or-path>', description: 'Function/tool definition as JSON string or file path (repeatable). Compatible with OpenAI tool format.', type: 'array' },
9292
],
9393
examples: [
9494
'mmx text chat --message "What is MiniMax?"',

0 commit comments

Comments
 (0)