Skip to content

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

Python

fix: preserve MiniMax reviewer fixes after rebase

yuhaoc66af71e47c3
diff --git a/minimax/agent-harness/cli_anything/minimax/minimax_cli.py b/minimax/agent-harness/cli_anything/minimax/minimax_cli.py
index beb269fd3..508bb4621 100644
--- a/minimax/agent-harness/cli_anything/minimax/minimax_cli.py
+++ b/minimax/agent-harness/cli_anything/minimax/minimax_cli.py
@@ -16,6 +16,7 @@ from __future__ import annotations
import sys
import os
import json
+import shlex
import click
from pathlib import Path
@@ -409,6 +410,10 @@ def test(model_opt=None):
@handle_error
def models(show_tts):
"""List available MiniMax models."""
+ if _json_output:
+ output(TTS_MODELS if show_tts else CHAT_MODELS)
+ return
+
if show_tts:
for m in TTS_MODELS:
click.echo(f"{m['id']} — {m['description']}")
@@ -421,6 +426,10 @@ def models(show_tts):
@handle_error
def voices():
"""List available TTS voice IDs."""
+ if _json_output:
+ output(TTS_VOICES)
+ return
+
for v in TTS_VOICES:
click.echo(v)
@@ -471,9 +480,11 @@ def repl():
skin.help(commands)
continue
- parts = line.split()
try:
+ parts = shlex.split(line)
cli.main(parts, standalone_mode=False)
+ except ValueError as e:
+ skin.error(str(e))
except SystemExit:
pass
except click.exceptions.UsageError as e:
diff --git a/minimax/agent-harness/cli_anything/minimax/tests/test_full_e2e.py b/minimax/agent-harness/cli_anything/minimax/tests/test_full_e2e.py
index 383209df6..fa26d7faa 100644
--- a/minimax/agent-harness/cli_anything/minimax/tests/test_full_e2e.py
+++ b/minimax/agent-harness/cli_anything/minimax/tests/test_full_e2e.py
@@ -158,9 +158,19 @@ class TestCLISubprocessSmoke:
models = self._run(["models"], tmp_path)
assert "MiniMax-M2.7" in models.stdout
+ models_json = self._run(["--json", "models"], tmp_path)
+ model_payload = json.loads(models_json.stdout)
+ assert isinstance(model_payload, list)
+ assert model_payload[0]["id"] == "MiniMax-M2.7"
+
voices = self._run(["voices"], tmp_path)
assert "English_Graceful_Lady" in voices.stdout
+ voices_json = self._run(["--json", "voices"], tmp_path)
+ voice_payload = json.loads(voices_json.stdout)
+ assert isinstance(voice_payload, list)
+ assert "English_Graceful_Lady" in voice_payload
+
def test_missing_api_key_fails_before_network_call(self, tmp_path):
result = self._run(
["--json", "chat", "--prompt", "hello"],
diff --git a/skills/cli-anything-minimax/SKILL.md b/skills/cli-anything-minimax/SKILL.md
new file mode 100644
index 000000000..fac237a7c
--- /dev/null
+++ b/skills/cli-anything-minimax/SKILL.md
@@ -0,0 +1,136 @@
+---
+name: "cli-anything-minimax"
+description: >-
+ Command-line interface for MiniMax AI — chat (MiniMax-M2.7) and TTS (speech-2.8-hd) via the MiniMax API.
+---
+
+# cli-anything-minimax
+
+A CLI harness for **MiniMax AI** — providing chat completions and text-to-speech synthesis through the MiniMax API.
+
+## Installation
+
+```bash
+pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=minimax/agent-harness
+```
+
+**Prerequisites:**
+- Python 3.10+
+- MiniMax API key from [platform.minimax.io](https://platform.minimax.io)
+
+## Usage
+
+### Basic Commands
+
+```bash
+# Show help
+cli-anything-minimax --help
+
+# Start interactive REPL
+cli-anything-minimax
+
+# Chat with MiniMax-M2.7
+cli-anything-minimax chat --prompt "What is AI?"
+
+# High-speed model
+cli-anything-minimax chat --prompt "Quick answer" --model MiniMax-M2.7-highspeed
+
+# Stream chat response
+cli-anything-minimax stream --prompt "Write a poem about code"
+
+# Synthesize speech
+cli-anything-minimax tts --text "Hello world" --output hello.mp3
+
+# JSON output for agents
+cli-anything-minimax --json chat --prompt "Hello"
+```
+
+## Command Groups
+
+### Chat
+
+| Command | Description |
+|---------|-------------|
+| `chat` | Chat with MiniMax LLM |
+| `stream` | Stream chat completion |
+
+### TTS
+
+| Command | Description |
+|---------|-------------|
+| `tts` | Synthesize text to speech (hex-decoded MP3 via SSE) |
+| `voices` | List available voice IDs |
+
+### Session
+
+| Command | Description |
+|---------|-------------|
+| `session status` | Show session status |
+| `session clear` | Clear session history |
+| `session history` | Show command history |
+
+### Config
+
+| Command | Description |
+|---------|-------------|
+| `config set` | Set a configuration value |
+| `config get` | Get a configuration value (or show all) |
+| `config delete` | Delete a configuration value |
+| `config path` | Show the config file path |
+
+### Utility
+
+| Command | Description |
+|---------|-------------|
+| `test` | Test API connectivity |
+| `models` | List chat models |
+| `models --tts` | List TTS models |
+
+## Examples
+
+### Configure API Key
+
+```bash
+export MINIMAX_API_KEY="your-api-key"
+# or
+cli-anything-minimax config set api_key "your-api-key"
+```
+
+### Chat
+
+```bash
+cli-anything-minimax chat --prompt "Explain quantum computing"
+cli-anything-minimax stream --prompt "Write a Python quicksort"
+```
+
+### TTS
+
+```bash
+cli-anything-minimax tts --text "Hello!" --output hello.mp3
+cli-anything-minimax tts --text "Fast" --model speech-2.8-turbo --voice English_Insightful_Speaker --output fast.mp3
+```
+
+## Chat Models
+
+| Model ID | Description |
+|----------|-------------|
+| `MiniMax-M2.7` | Peak Performance. Ultimate Value. (default) |
+| `MiniMax-M2.7-highspeed` | Same performance, faster and more agile |
+
+## TTS Models
+
+| Model ID | Description |
+|----------|-------------|
+| `speech-2.8-hd` | High-definition TTS (default) |
+| `speech-2.8-turbo` | Fast TTS |
+
+## For AI Agents
+
+1. **Always use `--json` flag** for parseable output
+2. **Check return codes** — 0 for success, non-zero for errors
+3. **Parse stderr** for error messages on failure
+4. **Use absolute paths** for TTS output files
+
+## Version
+
+1.0.0