Skip to content

Commit d49f204

Browse files
Raylan LINtars90percent
authored andcommitted
feat(docs): add mmx help command + apiDocs to all commands
- New 'mmx help' command listing all official API doc links - Add apiDocs field to Command interface (command.ts) - Register apiDocs display in registry printCommandHelp - Add apiDocs to: text chat, speech synthesize, image generate, video generate, music generate, music cover - Update text chat --model: list all 7 models (M2.7/highspeed/M2.5/M2.5-highspeed/M2.1/M2/Text-01) - Update speech synthesize: 8 models (2.8/2.6/02/01 hd+turbo) - Update image description: image-01/image-01-live - Update video description: Hailuo-2.3/2.3-Fast/Hailuo-02
1 parent cbebc42 commit d49f204

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

src/commands/help.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { defineCommand } from '../command';
2+
import type { Config } from '../config/schema';
3+
import type { GlobalFlags } from '../types/flags';
4+
5+
interface ApiRef {
6+
command: string;
7+
title: string;
8+
url: string;
9+
}
10+
11+
const API_REFS: ApiRef[] = [
12+
{ command: 'mmx text chat', title: 'Text Generation (Chat Completion)', url: 'https://platform.minimax.io/docs/api-reference/text-post' },
13+
{ command: 'mmx speech synthesize', title: 'Speech T2A (Text-to-Audio)', url: 'https://platform.minimax.io/docs/api-reference/speech-t2a-http' },
14+
{ command: 'mmx image generate', title: 'Image Generation (T2I / I2I)', url: 'https://platform.minimax.io/docs/api-reference/image-generation-t2i' },
15+
{ command: 'mmx video generate', title: 'Video Generation (T2V / I2V / S2V)', url: 'https://platform.minimax.io/docs/api-reference/video-generation' },
16+
{ command: 'mmx music generate', title: 'Music Generation', url: 'https://platform.minimax.io/docs/api-reference/music-generation' },
17+
{ command: 'mmx music cover', title: 'Music Cover (via Music Generation)', url: 'https://platform.minimax.io/docs/api-reference/music-generation' },
18+
{ command: 'mmx search query', title: 'Web Search', url: 'https://platform.minimax.io/docs/api-reference/web-search' },
19+
{ command: 'mmx vision describe', title: 'Vision (Image Understanding)', url: 'https://platform.minimax.io/docs/api-reference/vision' },
20+
];
21+
22+
export default defineCommand({
23+
name: 'help',
24+
description: 'Show MiniMax API documentation links',
25+
usage: 'mmx help',
26+
apiDocs: 'https://platform.minimax.io/docs/api-reference',
27+
async run(_config: Config, _flags: GlobalFlags) {
28+
process.stdout.write(`
29+
MiniMax API Documentation Links
30+
31+
Official docs: https://platform.minimax.io/docs/api-reference
32+
33+
`);
34+
for (const ref of API_REFS) {
35+
process.stdout.write(` ${ref.command.padEnd(30)} ${ref.title}\n`);
36+
process.stdout.write(` ${' '.repeat(30)} ${ref.url}\n\n`);
37+
}
38+
},
39+
});

src/commands/text/chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function extractText(content: ContentBlock[]): string {
7878
export default defineCommand({
7979
name: 'text chat',
8080
description: 'Send a chat completion (MiniMax Messages API)',
81+
apiDocs: 'https://platform.minimax.io/docs/api-reference/text-post',
8182
usage: 'mmx text chat --message <text> [flags]',
8283
options: [
8384
{ flag: '--model <model>', description: 'Model ID (default: MiniMax-M2.7)' },

src/registry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import configShow from './commands/config/show';
2323
import configSet from './commands/config/set';
2424
import configExportSchema from './commands/config/export-schema';
2525
import update from './commands/update';
26+
import help from './commands/help';
2627

2728
export type { Command, OptionDef } from './command';
2829

@@ -282,4 +283,5 @@ export const registry = new CommandRegistry({
282283
'config set': configSet,
283284
'config export-schema': configExportSchema,
284285
'update': update,
286+
'help': help,
285287
});

0 commit comments

Comments
 (0)