cli-guide

Guides implementation and debugging of the MiniMax Code CLI command tree, TUI, exec, and ACP adapters.

1.3k|142|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/MiniMax-AI/minimax-code --skill cli-guide-minimax-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-guide
Source: https://github.com/MiniMax-AI/minimax-code/tree/main/.agents/skills/cli-guide
Command: npx skills add https://github.com/MiniMax-AI/minimax-code --skill cli-guide-minimax-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers modifying the MiniMax Code CLI need to understand its layered architecture—command registration, interactive TUI, headless exec, and ACP adapters—before making changes, or they risk fixing one adapter while breaking others. ## Core Features & Use Cases - Architecture Map: Documents entry points from packages/tui/src/index.ts through command registration, TUI, headless exec, ACP protocol adapters, and the in-process CliService runtime boundary. - Change Guidance: Directs where to inspect parsing, dispatch, rendering, output settlement, and protocol handling depending on whether you modify commands, interactive behavior, exec, or ACP. - Verification Workflow: Prescribes building the standalone artifact and checking real --help output, plus smoke/BYOK tests with temporary data directories. - Use Case: When adding a new CLI flag, follow the guide to update cli/program.ts and cli/contract.ts together, then verify with node dist/cli.js --help after pnpm build. ## Quick Start Ask the agent to add a new flag to the exec command and verify it appears in the built CLI help output.

Frequently Asked Questions about cli-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new command or flag to the MiniMax Code CLI?

Inspect `cli/program.ts` for command registration, `cli/contract.ts` for option contracts, and the affected command handler together. Check parsing, help output, dispatch, and error handling, then build with pnpm and verify via `node dist/cli.js --help`.

How do I debug headless exec mode in a terminal coding agent?

Follow the invocation path through output and settlement in `packages/tui/src/headless/`. Verify stdout, stderr, exit codes, and cancellation behavior; checking help output alone is insufficient for exec changes.

What is the execution path from the TUI to model providers?

The path runs from TUI, exec, or ACP through CliService to local applications, then session, turn, and agent services, and finally model providers and tools. Preserve this in-process boundary when making changes.

Does a fix to the ACP adapter also fix the interactive TUI?

Not necessarily. TUI, exec, and ACP are separate adapters over the shared runtime, so trace callers before assuming one adapter fix covers the others. Shared behavior belongs in the application or service layer.

How should CLI changes be tested before release?

Build the standalone artifact with `pnpm build`, inspect actual help output for affected commands, and run behavior checks with temporary data directories and synthetic inputs following existing smoke and BYOK tests. Report offline protocol tests separately from live-provider acceptance.