Skip to content

feat(music): add --model flag, --output-format url, apiDocs#73

Merged
tars90percent merged 3 commits intoMiniMax-AI:mainfrom
raylanlin:pr/music
Apr 10, 2026
Merged

feat(music): add --model flag, --output-format url, apiDocs#73
tars90percent merged 3 commits intoMiniMax-AI:mainfrom
raylanlin:pr/music

Conversation

@raylanlin
Copy link
Copy Markdown
Contributor

Changes

  • --model flag: Allow users to override the default model (music-2.6/music-2.6-free/music-2.5+/music-2.5)
  • --output-format url: Return a 24h-expiry download URL instead of hex data
  • apiDocs: Add official API doc link to --help output
  • Improved --help descriptions:
    • List all 14 supported lyrics structure tags
    • Note prompt (2000) and lyrics (3500) character limits
    • Clarify instrumental model behavior (native vs workaround)
  • --model for music cover: Override default (music-cover/music-cover-free)
  • Updated Command interface: Add apiDocs?: string to CommandSpec/Command (needed by PR feat: terminal UX improvements — Model hint, quota status & env detection #5 docs)

Files

  • src/commands/music/generate.ts
  • src/commands/music/cover.ts
  • src/command.ts (apiDocs interface)

@tars90percent
Copy link
Copy Markdown
Collaborator

Hey Raylan — I just pushed f9a3ecb to main which adds region-aware support for apiDocs. The docs host differs by region (global → platform.minimax.io, CN → platform.minimaxi.com), so rather than hardcoding the full URL, apiDocs should now be a path that gets combined with the correct host at display time.

When you rebase PRs 73-76 on main, here's what to change:

  1. Drop your apiDocs additions to Command/CommandSpec/defineCommand in src/command.ts — already added in main.

  2. Change apiDocs values from full URLs to paths, e.g.:

    // Before:
    apiDocs: 'https://platform.minimax.io/docs/api-reference/music-generation'
    // After:
    apiDocs: '/docs/api-reference/music-generation'
  3. PR feat(docs): add mmx help command + API doc links to --help #76 (mmx help command): Use DOCS_HOSTS[config.region] from src/config/schema instead of the hardcoded https://platform.minimax.io in the API_REFS array and output. The config object is available in execute(), so you can import DOCS_HOSTS and build the full URL at runtime.

This applies to all 4 PRs (#73#76). Let me know if you have any questions!

Raylan LIN added 2 commits April 10, 2026 18:34
…--help

- Add --model flag to music generate (override default model)
- Add --output-format url (24h expiry) to music generate
- Add --model flag to music cover
- Add apiDocs field to Command interface (in command.ts)
- Improve --help descriptions: list all 14 lyrics structure tags,
  note length limits, clarify instrumental model behavior
- Add URL output and music-2.5+ instrumental examples
…dd trailing newline

- Validate --output-format is 'hex' or 'url' before sending to API
- Throw CLIError when URL output requested but API returns no audio_url
  (previously wrote 0-byte empty file silently)
- Use console.log for URL output to include trailing newline (W2 fix)
- Simplify: quiet mode already gets clean URL, non-quiet gets JSON/text
  via formatOutput — no need for separate branches
- Change apiDocs from full URL to path (fixes broken URL in --help)
- Add client-side model validation for --model flag
- Error when --stream and --output-format url are combined
@tars90percent tars90percent merged commit 2d83191 into MiniMax-AI:main Apr 10, 2026
1 check passed
@tars90percent
Copy link
Copy Markdown
Collaborator

Thanks for the PR! I pushed a fix commit (045c016) addressing a few issues before merging:

  • apiDocs values changed from full URLs to paths -- they get concatenated with DOCS_HOSTS[region] in registry.ts, so full URLs produced broken links like https://platform.minimax.iohttps://platform.minimax.io/...
  • Added client-side validation for --model flag -- typos were getting passed to the API and returning cryptic errors
  • Added an error when --stream and --output-format url are combined -- previously url was silently downgraded to hex

Apologies for pushing directly rather than requesting changes -- should have let you address these yourself. Will do that next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants