Commit Graph

35 Commits

Author SHA1 Message Date
yuanhe ad234508b0 chore: bump version to 1.0.19 2026-08-01 14:33:33 +08:00
yuanhe a14a46a947 release: v1.0.18 2026-07-16 21:43:43 +08:00
yuanhe 98f2941f97 fix: add npm package metadata 2026-07-15 19:11:50 +08:00
yuanhe 2fe66eb586 chore: bump version to 1.0.17 2026-07-15 18:47:48 +08:00
yuanhe 51ea71571c bump version to v1.0.16 2026-06-01 18:33:47 +08:00
yuanhe da44943e7d bump version to v1.0.15 2026-05-17 16:13:06 +08:00
yuanhe 435758c7df release: v1.0.14
- fix test isolation: support MMX_CONFIG_DIR env for config path override
- remove free-tier music models (music-2.6-free, music-cover-free), default to music-2.6 / music-cover
- improve auth login prompt: show region info for API key option
2026-05-17 15:59:33 +08:00
RyanLee 65aed9c858 Merge pull request #128 from MiniMax-AI/release/1.0.13
release: v1.0.13 — audio format validation & lint cleanup
2026-05-11 10:47:41 +08:00
yuanhe 5ac960b7f9 chore: bump version to 1.0.13 2026-05-11 10:45:41 +08:00
yuanhe 64a41467f6 feat: add HTTP/HTTPS proxy support via undici ProxyAgent
Use undici's ProxyAgent + setGlobalDispatcher to inject proxy at
startup — all fetch calls go through it automatically without
touching any call site.

Proxy priority: HTTPS_PROXY > HTTP_PROXY > ALL_PROXY > config file.
Users can also persist via: mmx config set --key proxy --value URL

Supersedes #101, closes #96
2026-05-11 09:56:25 +08:00
FliPPeDround b0cd9355ab Merge branch 'main' into feat/sdk 2026-05-08 12:21:52 +08:00
flippedround ef47037cba feat: support SDK 2026-05-02 19:47:46 +08:00
NianJiuZst dea0e5323f fix: derive cli version from package metadata 2026-04-30 02:01:21 +08:00
yuanhe 5e18c32852 chore: bump version to 1.0.12 2026-04-24 15:47:22 -07:00
yuanhe bceee9a33a chore: bump version to 1.0.11 2026-04-17 13:50:30 -07:00
yuanhe 7a2c843a88 fix: clear cached region when api_key changes via config set
Previously, switching API key with `mmx config set --key api_key`
kept the old cached region, causing requests to hit the wrong
endpoint. Now setting api_key deletes the cached region so it
gets auto-detected on the next command.

Bump version to 1.0.10.
2026-04-16 12:31:20 -07:00
yuanhe 2f7909c14a chore: bump version to 1.0.9 2026-04-16 12:26:41 -07:00
yuanhe a4bbafcbd4 fix: use correct token_plan/remains endpoint for quota query
The old endpoint v1/api/openplatform/coding_plan/remains returned
incorrect data. Switch to v1/token_plan/remains and fix the usage
calculation that previously treated usage_count as remaining.

Bump version to 1.0.8.
2026-04-16 12:11:21 -07:00
tars90percent 5436176eef chore: bump version to 1.0.7 2026-04-10 16:30:34 +08:00
yuanhe f07c4b34d3 fix: bump version to 1.0.6 and fix music generate test regressions
- Bump package.json version to 1.0.6 for npm publish
- Fix --instrumental with --lyrics-file validation (check flag presence, not just content)
- Update tests: new lyrics-required error message, replace 无歌词 example check with --lyrics-optimizer

Made-with: Cursor
2026-04-09 22:17:50 -07:00
yuanhe b185a2045c chore: bump version to 1.0.5
Made-with: Cursor
2026-04-08 19:10:53 -07:00
yuanhe 10327ce813 chore: bump version to 1.0.4
Made-with: Cursor
2026-04-08 12:56:48 -07:00
yuanhe 9ba4cea4b2 feat: colorized CLI help output with MiniMax brand gradient
Made-with: Cursor
2026-04-08 12:40:24 -07:00
yuanhe 6500642ce4 chore: bump version to 1.0.2
Made-with: Cursor
2026-04-08 12:18:26 -07:00
yuanhe 1d14114540 fix: use absolute GitHub URL for logo image in README
Made-with: Cursor
2026-04-08 12:09:33 -07:00
yuanhe 743c6e4a14 chore: bump version to 1.0.0, publish to npm, add SKILL.md frontmatter
- Version bumped to 1.0.0
- README/README_CN updated with npm and npx skills install instructions
- SKILL.md moved to repo root with required name/description frontmatter

Made-with: Cursor
2026-04-08 12:06:09 -07:00
yuanhe bf9bee5e53 refactor: rename CLI command from minimax to mmx
Follow industry convention (gh, az, hf) where platform API CLIs use
abbreviated company names, distinguishing from AI agent CLIs that use
full product names (claude, gemini, copilot).

Changes:
- npm package: minimax-cli → mmx-cli
- binary/command: minimax → mmx
- config directory: ~/.minimax → ~/.mmx
- User-Agent: mmx-cli/<version>
- All help text, usage strings, examples, and docs updated
- ASCII banner updated to MMX
- Build output: dist/mmx.mjs
- OAuth client ID: mmx-cli

Unchanged (company/API references):
- API URLs (api.minimax.io, api.minimaxi.com)
- Environment variables (MINIMAX_API_KEY, MINIMAX_REGION, etc.)
- GitHub repo path (MiniMax-AI-Dev/minimax-cli)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 07:41:28 -07:00
yuanhe 163c8f4ec2 feat: add TypeScript ESLint and clean up unused code
- Add eslint.config.js with typescript-eslint flat config
- Add @eslint/js ^9 and typescript-eslint ^8 devDependencies
- Read VERSION from package.json in build.ts instead of hardcoding 'dev'
- Convert detectPlatform() to async with dynamic import in self-update.ts
- Remove all unused imports and rename unused params to _prefix
- Fix prefer-const violations and add eslint-disable comments where needed
- Fix indentation in video/generate.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 03:19:41 +08:00
yuanhe 27e16066b0 refactor: npm-only distribution
Install: npm install -g minimax-cli (requires Node.js 18+)

- package.json: remove private, add bin/files/engines/prepublishOnly
- build.ts: only builds minimax.mjs, no platform binaries
- install.sh: deleted (replaced by npm install)
- release.yml: tests only, no binary release artifacts
- update command: print "npm update -g minimax-cli" instead of self-update
- main.ts: update notification shows npm command
- README/README_CN: npm install -g minimax-cli

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:36:07 +08:00
yuanhe 6a7e917e6c refactor: JSON-only config, remove yaml dependency
- config/paths.ts: config.yaml → config.json
- config/loader.ts: JSON.parse/stringify, no yaml import
- output/formatter.ts: drop yaml case, OutputFormat = 'text' | 'json'
- config/schema.ts: remove 'yaml' from output types
- config/set.ts, command.ts, registry.ts: update output format docs
- auth/resolver.ts, auth/login.ts, auth/logout.ts: config.yaml → config.json
- package.json, bun.lock: remove yaml dependency
- tests: remove yaml test case, update config.yaml refs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:03:29 +08:00
yuanhe 22dd7acdc7 refactor: decouple flag parsing from hardcoded lists, extract status-bar
- args.ts: replace hardcoded boolean/number/array lists with schema-driven
  parseFlags(argv, OptionDef[]) + scanCommandPath(); adding a new flag no
  longer requires touching the parser
- command.ts: add GLOBAL_OPTIONS as the single source of truth for global
  flag types; main.ts merges with command options for two-pass parsing
- output/status-bar.ts: extract status-bar rendering out of http.ts;
  HTTP client is now pure transport with no UI concerns
- registry.ts: remove commented-out File API dead code
- package.json: add build:dev for single-platform Bun standalone binary
- commands: annotate numeric (type:'number') and array (type:'array') flags
  in text/chat, speech/synthesize, music/generate, video/generate, image/generate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 15:16:46 +08:00
yuanhe 5d3a6a8c46 fix: resolve 8 CLI quality issues found during audit
- quota show: fix box misalignment in no-color mode ([] brackets
  were 2 cols wider than the W formula assumed; move barVisLen calc
  before W so the box is sized to fit the actual content)
- quota show: ignore config-file output setting so the rich HUD is
  shown in TTY even when the user has `output: json` globally
- http: fix User-Agent version hardcoded to 0.1.0; now reads
  CLI_VERSION env var with correct fallback
- http: print the brand status bar only once per process instead of
  on every request
- errors/handler: replace ad-hoc JSON detection with detectOutputFormat
  so error format is consistent with the rest of the CLI
- text/chat: fix description — "Anthropic Messages API" → "MiniMax"
- registry: fix group help alignment — printChildren now collects all
  leaf paths first and aligns description column to the longest path
  (fixes `video task get` being indented further than siblings)
- auth/login, registry: remove dev-journal comments from production code
- package.json, main.ts: sync version fallback to 0.3.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 10:32:12 +08:00
victor0602 510802c390 feat: Agent/CI-friendly architecture — env detection, interactive fallback, async mode, stdout purity
Phase 1 — Infrastructure & Env Awareness
- Add src/utils/env.ts: isInteractive(), isCI() environment detection
  (checks process.stdout.isTTY, process.stdin.isTTY, --non-interactive, CI env vars)
- Add --non-interactive and --async global flags
- Integrate flags through Config and GlobalFlags types

Phase 2 — Interactive Fallback
- Add src/utils/prompt.ts: promptText(), promptConfirm(), failIfMissing()
  (wraps @clack/prompts, no-ops when non-interactive)
- Add @clack/prompts dependency
- image/generate: interactive --prompt when missing in TTY, fail-fast in CI
- text/chat: interactive --message when missing in TTY, fail-fast in CI
- vision/describe: interactive --image when missing in TTY, fail-fast in CI
- video/generate: interactive --prompt when missing in TTY, fail-fast in CI

Phase 3 — Async Task Handling
- Add --async global flag (explicit agent/CI mode)
- --async and --no-wait: always output pure JSON {taskId} to stdout
- Default polling behavior unchanged (blocking, spinner on stderr)
- video/generate: after polling completes, auto-download to ~/.minimax-video/{taskId}.mp4
  and output only the local file path to stdout

Phase 4 — Stdout Purity
- registry.ts: printHelp/printRootHelp/printCommandHelp accept custom output stream
  (defaults to stdout; main.ts passes stderr for --help so stdout stays clean)
- text/chat streaming: thinking/response headers route to stderr in non-TTY mode
  (final text always goes to stdout)
- Global help text updated to list --non-interactive and --async flags
2026-03-27 20:08:22 +08:00
yuanhe 8c79e208f4 Refactor distribution: remove zod, centralize config I/O, add self-update
- Remove zod dependency (-200KB bundle); replace with 20-line manual validation
- Centralize config read/write into readConfigFile/writeConfigFile, eliminating
  yaml parse/stringify duplication across 5 files
- Add src/update/checker.ts: background update check, 24h throttle, fire-and-forget
- Add src/update/self-update.ts: SHA256-verified atomic binary replacement
- Add `minimax update [stable|latest|VERSION]` command
- Startup update notification (prints to stderr after command, respects --quiet)
- Rewrite install.sh: SHA256 verification, Rosetta2 detection, musl detection,
  curl/wget fallback, channel param, defaults to ~/.local/bin (no sudo)
- build.ts: proper bun musl targets, Windows target, generates manifest.json with
  per-platform SHA256 checksums
- release.yml: test job gates release job; uploads manifest.json alongside binaries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 23:02:26 +08:00
tars90percent b540ee49f4 Initial commit: minimax-cli
CLI for the MiniMax API Platform (Token Plan). Supports 16 commands
across 10 resource groups: text chat, speech synthesis, image generation,
video generation, music generation, web search, image understanding,
quota management, auth, and config.

Features:
- Resource-verb grammar (minimax <resource> <command>)
- Auto-detects API region (global/cn) on first run
- Structured output (text, json, yaml)
- SSE streaming for chat
- Async polling for video generation
- Cross-compiles to standalone binaries via Bun
- Works with Node 18+ via npm install
2026-03-26 17:37:11 +08:00