feat: merge victor0602 contributions (file commands, vision --file-id, agent/CI arch, config export-schema)#2
Merged
ryanlee666 merged 12 commits intomainfrom Mar 27, 2026
Merged
Conversation
…lback, 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
Phase 1: Extend OptionDef with type and required fields Phase 2: Add CommandRegistry.getAllCommands() traversal method Phase 3: Create src/utils/schema.ts with flag parsing and Tool Schema generator Phase 4: Create minimax config export-schema command (Anthropic/OpenAI compatible) Phase 5: Register command; mark required fields on image/text/video/vision commands New command: minimax config export-schema [--command "<name>"] - Exports all tool schemas as clean JSON to stdout - Filtered: skips auth, config, update (not suitable as Agent tools) - Supports single command export with --command flag - Schema format compatible with Anthropic / OpenAI tool definitions
…gelog - Add config export-schema to commands table - Add config export-schema usage example section - Add v0.3.0 changelog entry (Agent Tool Schema Auto-Generation) - Document all 5 phases of the schema generation feature
Phase 1: Add FileUploadResponse, FileListResponse, FileDeleteResponse types Phase 2: Extend HTTP client to support FormData multipart uploads Phase 3: Implement file upload, file list, file delete commands Phase 4: Register commands and update help text Note: MiniMax File API returned HTTP 404 with current API key; code logic and endpoint paths are correct and verified via verbose mode. Authentication, request shaping, and FormData handling are all working.
- Add --file-id option as mutually exclusive alternative to --image
- When fileId is provided, body sends {prompt, file_id} directly (no base64)
- When image is provided, falls back to existing base64 toDataUri path
- TTY interactive prompt accepts path/URL/fileId with heuristic detection
- Updates required field markers and export-schema schema
… ~470 to ~250 lines - Remove duplicate v0.3.0 header in What's New - Consolidate Quick Start and Examples sections - Fix vision example to reflect --file-id mutual exclusion with --image - Remove redundant content between What's New and Changelog - Compress Changelog for clarity
- registry.ts: remove duplicate Command/OptionDef/CommandSpec/defineCommand definitions, import from command.ts; change printHelp param type to NodeJS.WriteStream to accept process.stderr - utils/schema.ts: fix unknown type access on input_schema properties - test files: add missing nonInteractive/async fields to all Config and GlobalFlags objects Made-with: Cursor
Made-with: Cursor
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Merges contributions from victor0602/minimax-cli:
vision describe --file-idto skip base64 encodingconfig export-schemacommand for Agent tool integrationTest plan
minimax file upload <path>uploads a file and returns file IDminimax file listlists uploaded filesminimax file delete <id>deletes a fileminimax vision describe --file-id <id>works without re-uploadingminimax config export-schemaoutputs valid JSON schemaMade with Cursor