executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
minimax-cliNested swiss-knife reference for the MiniMax `mmx` CLI and the canonical MiniMax CLI procedure shipped with the TUI: install `mmx-cli`, discover the correct TUI-managed MiniMax preset/key slot without leaking secrets, match mainland vs international regions, and route image/video/music/TTS generation or one-shot shell vision.
Independent GitHub snapshot · Automated classification · Original documentation governs
mmx CLI and the canonical
MiniMax CLI procedure shipped with the TUI: install mmx-cli, discover the
correct TUI-managed MiniMax preset/key slot without leaking secrets, match
mainland vs international regions, and route image/video/music/TTS generation
or one-shot shell vision.
version: 2.2.0
tags: [manual, cli, minimax, mmx, image, video, music, speech, tts, vision, media-generation]
last_changed_at: "2026-10-12T17:13:18Z"
maintenance: "If you find stale or incorrect information here, use the lingtai-issue-report skill to assemble evidence and obtain per-issue human consent before filing an issue. Never include secrets, credentials, tokens, or private paths."This is a manual, not a tool. It points you at the official MiniMax CLI (
mmx). The CLI's own--helpis the source of truth for syntax; the live docs are the source of truth for models, quotas, regions, and evolving flags. This file covers the LingTai-specific glue: install, credential discovery, region matching, and when to route through this CLI instead of another capability.
Use this skill when a task needs MiniMax-backed media generation or one-shot shell vision:
| Need | Primary route |
|---|---|
| Generate image, video, music, or TTS | mmx image/video/music/speech ... after reading the subcommand's --help |
| Understand an image from a shell script | mmx vision ... for ad-hoc one-shots |
| Vision as an in-turn tool call | Use the built-in vision tool if available; registered MCP setup belongs to mcp-manual |
This skill is the canonical MiniMax CLI reference shipped with the TUI. The top-level minimax-cli skill is only a discoverability pointer into this nested reference, so keep MiniMax command recipes and credential guidance here rather than duplicating them there.
The official CLI is mmx-cli on npm (source: MiniMax-AI/cli). Check first, install if missing:
command -v mmx >/dev/null || npm install -g mmx-cli
Requires node + npm on PATH. If neither is installed, ask the user to install Node; do not bootstrap a Node runtime yourself inside the project.
After install, verify the binary and let the CLI describe its current surface:
mmx --help
mmx doctor --help || true
Never print, commit, or paste MiniMax keys. The TUI stores keys in ~/.lingtai-tui/.env; presets declare which env slot they use through manifest.llm.api_key_env. Modern saved presets usually live under ~/.lingtai-tui/presets/saved/, so scan recursively instead of only checking the top-level presets directory.
Resolution order:
minimax provider any more: a MiniMax preset is an anthropic (or
openai) preset whose base_url points at a MiniMax host
(api.minimaxi.com for CN, api.minimax.io for INTL). Older saved presets
may still say provider: minimax.~/.lingtai-tui/.env without printing the key value.MINIMAX_API_KEY for mmx.List candidate presets (prints slot names and base URLs only, never secret values):
python3 - <<'PY'
import glob, json, os
root = os.path.expanduser("~/.lingtai-tui/presets")
paths = sorted(set(
glob.glob(os.path.join(root, "**", "*.json"), recursive=True)
+ glob.glob(os.path.join(root, "**", "*.jsonc"), recursive=True)
))
def strip_jsonc(text: str) -> str:
# Remove // and /* */ comments outside strings. A regex comment stripper
# would corrupt normal preset URLs such as "https://api.minimaxi.com/anthropic".
out = []
i = 0
in_string = False
escape = False
while i < len(text):
ch = text[i]
nxt = text[i + 1] if i + 1 < len(text) else ""
if in_string:
out.append(ch)
if escape:
escape = False
elif ch == "\\":
escape = True
elif ch == '"':
in_string = False
i += 1
continue
if ch == '"':
in_string = True
out.append(ch)
i += 1
continue
if ch == "/" and nxt == "/":
i += 2
while i < len(text) and text[i] not in "\r\n":
i += 1
continue
if ch == "/" and nxt == "*":
i += 2
while i + 1 < len(text) and not (text[i] == "*" and text[i + 1] == "/"):
i += 1
i += 2 if i + 1 < len(text) else 0
continue
out.append(ch)
i += 1
return "".join(out)
for path in paths:
try:
doc = json.loads(strip_jsonc(open(path, encoding="utf-8").read()))
except Exception:
continue
llm = doc.get("manifest", {}).get("llm", {}) or {}
base = llm.get("base_url") or ""
legacy = (llm.get("provider") or "").lower() == "minimax"
if not legacy and "minimaxi.com" not in base and "minimax.io" not in base:
continue
slot = llm.get("api_key_env") or "MINIMAX_API_KEY" # legacy fallback
base = base or "(default CLI region)"
region = "CN" if "minimaxi.com" in base else "INTL" if "minimax.io" in base else "unknown"
rel = os.path.relpath(path, os.path.expanduser("~/.lingtai-tui"))
print(f"{rel:55s} slot={slot:32s} region={region:7s} base_url={base}")
PY
Export the chosen slot without echoing the key. For ordinary API-key lines a
grep extraction is enough; use Python only if a value is quoted or
whitespace-padded (strip surrounding quotes/space, error if the slot is absent):
SLOT=MINIMAX_CN_1_API_KEY # replace with the slot printed above
export MINIMAX_API_KEY="$(grep -E "^${SLOT}=" ~/.lingtai-tui/.env | head -1 | cut -d= -f2- | sed -E 's/^["'"'"' ]+|["'"'"' ]+$//g')"
[ -n "$MINIMAX_API_KEY" ] || echo "missing $SLOT in ~/.lingtai-tui/.env"
If multiple MiniMax presets exist and the user did not specify which account/region to use, ask. If no MiniMax preset exists, ask the user to save one through the TUI preset library — the anthropic template with base_url set to MiniMax's Anthropic-compatible endpoint (for example https://api.minimaxi.com/anthropic) and their MiniMax key pasted; the TUI will populate the appropriate slot in ~/.lingtai-tui/.env.
Token-plan keys often have prefix sk-cp-...; pay-as-you-go keys (sk-... without cp) may also work but are billed per call. Treat both as secrets.
MiniMax has mainland China and international ecosystems. The credential, API host, and quota plan must match. The preset's base_url is the best local hint:
minimaxi.com -> mainland China account.minimax.io -> international account.Do not hardcode an unverified host. If the CLI supports a region flag or MINIMAX_BASE_URL, set it from the preset's base_url or the current official docs, not from memory:
mmx doctor --help || true
mmx --help | sed -n '1,120p'
# If the CLI documents MINIMAX_BASE_URL and your selected preset has a base_url:
# export MINIMAX_BASE_URL="<base_url from the selected preset>"
A region/key mismatch commonly appears as 2049 invalid api key.
Do not memorize command syntax. Ask the installed CLI immediately before generating:
mmx --help
mmx image --help
mmx video --help
mmx music --help
mmx speech --help
mmx vision --help
mmx doctor
As of this writing the CLI commonly exposes text, image, video, music, speech, and vision subcommands. Outputs usually land in ./minimax-output/, and most subcommands have an output flag such as --out; verify the current flag with --help before every scripted use.
Live docs when --help is not enough:
artifacts/minimax/<task-slug>/.mmx <subcommand> --help and build the command from the live flags../minimax-output/ after the call.Skeleton:
mkdir -p artifacts/minimax/example
mmx music --help
# Build the real command from the help output; example flags may change:
# mmx music generate --prompt "..." --out artifacts/minimax/example/
MiniMax vision can appear through multiple LingTai paths:
vision tool: best when present in the agent's tool list; follow the tool's current manual.mmx vision ...): best for one-shot shell/OCR/image-description jobs.mcp-manual.If a user asks for image understanding and you already have the built-in vision tool, use it first. Load this skill for CLI fallback or batch shell work.
| Symptom | Likely cause / action |
|---|---|
mmx: command not found | Install mmx-cli; verify npm's global bin directory is on PATH |
| No MiniMax preset found | Ask the user to save an anthropic preset with a MiniMax base_url through the TUI preset library |
Slot printed by preset scan but missing from .env | Preset/key state is incomplete; ask the user to re-save the preset or add the key through the TUI |
2049 invalid api key | Region/key mismatch or wrong slot; re-check selected preset base URL and slot |
2056 usage limit exceeded | Quota/plan exhausted; stop and report plainly |
| Media call appears to hang | Music/video can take 1-10 minutes; wait rather than retrying immediately |
| CLI flags differ from examples | Trust mmx <subcommand> --help; update this skill if the drift is persistent |
The older MCP-server route (minimax-mcp, minimax-coding-plan-mcp) still exists for MCP workflows and is owned by mcp-manual. Prefer the official CLI here when a shell command is sufficient: one binary covers media, speech, text, and ad-hoc vision.
Found a bug or issue? If you encounter any problems with this skill, load the
lingtai-issue-reportskill and follow its instructions to report it.