Skip to main content
Start with the installed version and command help to identify whether an issue is related to installation, authentication, configuration, or task execution:

Installation and environment

Close and reopen the terminal, then run mcode --version. If the command is still missing, check that the global npm or installer directory is in PATH. On Windows, an already-open VS Code process may retain an old environment; fully restart VS Code.
Manual installation requires Node.js 22.19.0 or later in the 22.x line, or Node.js 24, 25, or 26. The official installer prepares a compatible runtime when needed. Alpine and other musl-based Linux distributions are not currently supported by the installer.
Confirm access to the MiniMax file CDN, npm registry, and Node.js download source. Some platforms may also need GitHub for native dependencies. If you use a proxy, set HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, or NO_PROXY before retrying.
Run mcode update and restart the current MCode process after it completes. For an npm installation, run npm uninstall -g @minimax-ai/code. For an installer installation, use the installer or uninstall method for that installation.

Sign-in and authentication

For a mainland China account, run mcode login. For a Global account, run mcode login --region global. After sign-in, use /status in the TUI to check account, model, and runtime status. You can also run mcode acp login --region <region> under the ACP command.
The login command starts a temporary callback service on the local loopback address and tries to open a browser with xdg-open. On Debian or Ubuntu, install the browser opener first:
Keep the original mcode login process running until browser sign-in finishes. For an SSH remote host, forward the callback port printed by the login command:
Each login may use a different port; do not permanently reuse the example port.
Keep the login process running. Copy the complete callback URL from the browser and request it from a second terminal:
Keep the URL in single quotes so the shell does not split & parameters into background commands. Check the callback listener with ss -ltnp | grep <port>.A callback URL can contain a temporary credential. Do not share, screenshot, or commit it.
Run mcode login, then use /status to inspect the account and /model to select an available model. For a MiniMax API key or custom provider, follow the Provider instructions in the Features page and run mcode provider test <provider-id>.

Data directory, configuration, and proxy

The default data root is ~/.minimax, and the configuration file is <data-dir>/config.yaml. The directory also stores sessions, logs, plugins, skills, and other runtime data. Set MINIMAX_DATA_DIR to choose another directory; MAVIS_DATA_DIR is a compatibility fallback, and MINIMAX_DATA_DIR wins when both are set.
Add values such as these to config.yaml:
defaultModel uses provider/model and can include #variant. mcode exec --model overrides only the current run. permissionMode accepts default, auto, bypassPermissions, or off.
The CLI supports HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY, and lowercase variants. It always bypasses localhost, 127.0.0.1, and ::1 so login callbacks and local services remain reachable.

Providers and API keys

Set the key and then run mcode provider set-minimax-key:
The default variable is MCODE_PROVIDER_API_KEY; use --api-key-env <name> for another variable. The CLI reads the key but does not print it.
Run mcode provider add with at least one model:
Supported formats are anthropic-messages, openai-completions, and openai-responses. Use mcode provider list, mcode provider test <provider-id>, and mcode provider remove <provider-id> --yes to manage the provider.

Headless and CI

Use mcode exec; it does not launch the TUI:
Read from stdin explicitly with --input -:
Common options are:
  • --cwd <path>: workspace directory;
  • --file <path>: repeatable attachments, up to 10 files and 100 MB total;
  • --model <provider/model[#variant]>: override the model for this run;
  • --effort <level>: override reasoning effort for this run using a supported level;
  • --session <id> or --continue: continue an existing session;
  • --config <path>: use an explicit Runtime configuration;
  • --permission smart|full|off: Headless permission policy, default smart;
  • --timeout <duration>: timeout such as 30s or 2m;
  • --max-steps <count>: maximum Assistant steps;
  • --output-format text|json|stream-json: output format;
  • --output-schema <schema>: inline or file JSON Schema;
  • -o, --output-last-message <path>: write the final message after success.
--input - cannot be combined with a positional prompt. Headless rejects --permission ask because it has no interactive host.
text prints the final answer, json prints one stable ExecResult, and stream-json prints newline-delimited events. Results go to stdout; diagnostics go to stderr. Check the JSON status first and treat model and usage as optional.With --output-schema, the final answer must be JSON matching the schema. Parsing or validation failures return status: failed with STRUCTURED_OUTPUT_INVALID. --output-last-message writes atomically only after a successful run and Runtime shutdown.
Check both the process exit code and the JSON status:
Headless cannot wait for a questionnaire, permission prompt, or other human input. If an existing session has a pending interaction, the run fails and asks you to use the TUI or ACP first.

ACP and plugins

mcode acp reserves stdin/stdout for ACP protocol messages; logs and diagnostics go to stderr. Do not write natural language directly to the ACP process or mix wrapper logs into stdout. If the editor cannot find mcode, configure the absolute executable path and restart the editor.
Run mcode plugin marketplace list and mcode plugin list --available first. Specify <plugin>@official or <plugin>@local when names collide. Refresh marketplace snapshots with mcode plugin marketplace upgrade; the local source is the plugins directory under the data directory.

Sessions, terminals, and desktop boundaries

Run mcode --continue in the original workspace, or use mcode --session to open the session manager. In the TUI, use /sessions [query]. For long conversations, use /compact; export with /export [path.md] or inspect the full history with /transcript.
Plan Mode controls whether the agent plans before execution (Shift+Tab or /plan). Permission mode controls how tool actions are approved (Alt+M or /permission). They are independent settings.
The CLI does not depend on Electron or desktop IPC. Browser, Computer Use, desktop panels, and desktop shortcuts appear only when the current host explicitly provides them; desktop-specific behavior belongs in the desktop documentation.
Image and video paste depends on whether the terminal emulator forwards the shortcut and clipboard file to MCode. Remote SSH sessions usually cannot read the local clipboard; use @ for a workspace file or mcode exec --file <path> for an attachment.