关于 cli-anything-minimax
cli-anything-minimax 是面向 MiniMax AI 的命令行工具,供用户和 Agent 通过 MiniMax API 使用聊天补全与文本转语音。它提供交互和单次命令,并支持会话及配置管理。
主要功能
- 01聊天与流式补全
- 02文本转语音合成
- 03列出聊天模型和音色
- 04管理会话与配置
适用场景
- 01向 MiniMax 聊天模型发送提示词
- 02将文本生成为语音
- 03查看可用模型或音色
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ hkuds/ cli-anything --skill cli-anything-minimax安装后在 Claude Code 中输入/cli-anything-minimax确认已加载。
详细介绍
cli-anything-minimax
一个面向 MiniMax AI 的 CLI 工具,通过 MiniMax API 提供对话补全和文本转语音合成功能。
安装
pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=minimax/agent-harness
前置要求:
- Python 3.10+
- 来自 platform.minimax.io 的 MiniMax API key
用法
基本命令
# Show help
cli-anything-minimax --help
# Start interactive REPL
cli-anything-minimax
# Chat with MiniMax-M3
cli-anything-minimax chat --prompt "What is AI?"
# Alternate chat model
cli-anything-minimax chat --prompt "Quick answer" --model MiniMax-M2.7
# 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"
TTS 选项
--text(必填)/ --model / --output,以及语音和音频控制选项:--speed(0.5..2.0)、--vol(0..10)、--pitch(-12..12)、--sample(8k/16k/22.05k/24k/32k/44.1k)、--bitrate(32k/64k/128k/256k)、--format(pcm)、--channel(1..2)。默认值请参见 tts --help。
命令分组
Chat
| 命令 | 描述 |
|---|---|
chat | 与 MiniMax 大模型对话 |
stream | 流式对话补全 |
TTS
| 命令 | 描述 |
|---|---|
tts | 将文本合成为语音(通过 SSE 进行十六进制解码的 MP3) |
voices | 列出可用的语音 ID |
Session
| 命令 | 描述 |
|---|---|
session status | 显示会话状态 |
session clear | 清除会话历史记录 |
session history | 显示命令历史记录 |
Config
| 命令 | 描述 |
|---|---|
config set | 设置配置值 |
config get | 获取配置值(或显示全部) |
config delete | 删除配置值 |
config path | 显示配置文件路径 |
Utility
| 命令 | 描述 |
|---|---|
test | 测试 API 连通性 |
models | 列出对话模型 |
models --tts | 列出 TTS 模型 |
示例
配置 API Key
export MINIMAX_API_KEY="your-api-key"
# or
cli-anything-minimax config set api_key "your-api-key"
Chat
cli-anything-minimax chat --prompt "Explain quantum computing"
cli-anything-minimax stream --prompt "Write a Python quicksort"
TTS
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
对话模型
| 模型 ID | 描述 |
|---|---|
MiniMax-M3 | 新一代旗舰模型(默认) |
MiniMax-M2.7 | 巅峰性能。极致价值。 |
TTS 模型
| 模型 ID | 描述 |
|---|---|
speech-2.8-hd | 高清 TTS(默认) |
speech-2.8-turbo | 快速 TTS |
speech-2.6-hd | 高清 TTS |
speech-2.6-turbo | 快速 TTS |
speech-02-hd | 高清 TTS |
speech-02-turbo | 快速 TTS |
speech-01-hd | 高清 TTS |
speech-01-turbo | 快速 TTS |
面向 AI Agent
- 始终使用
--json标志,以获得可解析的输出 - 检查返回码——0 表示成功,非零表示错误
- 解析 stderr,以获取失败时的错误信息
- 使用绝对路径,用于 TTS 输出文件
版本
1.0.0
评论
支持 Markdown