Skip to content

feat: merge victor0602 contributions (file commands, vision --file-id, agent/CI arch, config export-schema)#2

Merged
ryanlee666 merged 12 commits intomainfrom
victor-main
Mar 27, 2026
Merged

feat: merge victor0602 contributions (file commands, vision --file-id, agent/CI arch, config export-schema)#2
ryanlee666 merged 12 commits intomainfrom
victor-main

Conversation

@ryanlee666
Copy link
Copy Markdown
Collaborator

Summary

Merges contributions from victor0602/minimax-cli:

  • feat: File upload/list/delete commands (v0.4.0)
  • feat: vision describe --file-id to skip base64 encoding
  • feat: config export-schema command for Agent tool integration
  • feat: Agent/CI-friendly architecture — env detection, interactive fallback, async mode, stdout purity
  • feat: Switch text chat to Anthropic Messages API, improve agent ergonomics
  • refactor: Remove zod, centralize config I/O, add self-update
  • docs: Streamline README, add v0.2.0–v0.4.0 changelogs

Test plan

  • minimax file upload <path> uploads a file and returns file ID
  • minimax file list lists uploaded files
  • minimax file delete <id> deletes a file
  • minimax vision describe --file-id <id> works without re-uploading
  • minimax config export-schema outputs valid JSON schema
  • Non-interactive (CI) mode works via env vars

Made with Cursor

victor0602 and others added 12 commits March 27, 2026 20:08
…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
@ryanlee666 ryanlee666 merged commit fb2d1af into main Mar 27, 2026
2 checks passed
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