Skip to content

Commit 87fbbda

Browse files
authored
Merge pull request #17 from MiniMax-AI-Dev/fix/audio-url-mode
Fix/audio url mode
2 parents ec3b475 + b4af3c0 commit 87fbbda

5 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/commands/image/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineCommand({
3131
'minimax image generate --prompt "Mountain landscape" --quiet',
3232
],
3333
async run(config: Config, flags: GlobalFlags) {
34-
let prompt = flags.prompt as string | undefined;
34+
let prompt = (flags.prompt ?? (flags._positional as string[]|undefined)?.[0]) as string | undefined;
3535

3636
if (!prompt) {
3737
if (isInteractive({ nonInteractive: config.nonInteractive })) {

src/commands/search/query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineCommand({
3131
'minimax search query --q "latest news" --output json',
3232
],
3333
async run(config: Config, flags: GlobalFlags) {
34-
const query = flags.q as string | undefined;
34+
const query = (flags.q ?? (flags._positional as string[]|undefined)?.[0]) as string | undefined;
3535

3636
if (!query) {
3737
throw new CLIError(

src/commands/speech/synthesize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default defineCommand({
3939
'minimax speech synthesize --text "Stream" --stream | mpv --no-terminal -',
4040
],
4141
async run(config: Config, flags: GlobalFlags) {
42-
let text = flags.text as string | undefined;
42+
let text = (flags.text ?? (flags._positional as string[]|undefined)?.[0]) as string | undefined;
4343

4444
if (flags.textFile) {
4545
const path = flags.textFile as string;

src/commands/vision/describe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default defineCommand({
5959
'minimax vision describe --file-id file-123456789 --prompt "Extract the text"',
6060
],
6161
async run(config: Config, flags: GlobalFlags) {
62-
let image = flags.image as string | undefined;
62+
let image = (flags.image ?? (flags._positional as string[]|undefined)?.[0]) as string | undefined;
6363
let fileId = flags.fileId as string | undefined;
6464
const prompt = (flags.prompt as string) || 'Describe the image.';
6565

src/registry.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ class CommandRegistry {
7777
return { command: node.command, extra: commandPath.slice(matched.length) };
7878
}
7979

80+
// Single child: auto-forward (e.g. `minimax quota` → `minimax quota show`)
81+
if (matched.length > 0 && node.children.size === 1) {
82+
const [, child] = node.children.entries().next().value as [string, CommandNode];
83+
if (child.command) {
84+
return { command: child.command, extra: commandPath.slice(matched.length) };
85+
}
86+
}
87+
8088
// If we matched some path but no command, show help for that group
8189
if (matched.length > 0 && node.children.size > 0) {
8290
const subcommands = Array.from(node.children.entries())

0 commit comments

Comments
 (0)