New:Socket for Asana Is Now Available.Learn more
Get Started

@minimax-ai/code

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@minimax-ai/code

Minimax Code — terminal coding agent

latest
npmnpm
Version
0.3.1
Version published
Weekly downloads
4.2K
35.95%
Maintainers
4
Weekly downloads
 
Created
Source

MiniMax Code

English | 简体中文

An AI coding agent for your terminal. MiniMax Code understands your codebase, edits files, runs commands and tests, and keeps the work in resumable Sessions.

Use it as an interactive TUI, run it headlessly in scripts and CI, or connect it to an ACP-compatible client.

Quick start

Requires Node.js 22.19+ on Node 22, or Node.js 24–26.

npm install -g @minimax-ai/code
cd your-project
mcode

Then describe the outcome you want:

Find the cause of the intermittent 500 error in the login endpoint, fix it, and run the relevant tests.

MiniMax Code will inspect the repository, make the requested changes, run the checks it can, and summarize what it verified.

Why MiniMax Code

CapabilityWhat it gives you
Codebase understandingSearch files, trace call paths, explain architecture, and identify impact before editing
End-to-end executionEdit code, run commands, and verify changes with the repository's own tools
Resumable workKeep each task in a Session and continue where you left off
Human controlReview plans and choose how much access the agent has before sensitive operations
Flexible workflowsWork interactively, automate with structured output, or integrate over ACP
ExtensibilityChoose models and Providers, and add new capabilities with Plugins

Use it your way

Interactive TUI

Start in the current directory:

mcode

Or start with a task already attached:

mcode "Explain this repository and identify the highest-priority technical debt."

While MiniMax Code is working, press Enter to steer the active turn or Alt+Enter to queue a follow-up for the next turn. Use Alt+Up (or Shift+Left) to move the latest queued message back into the Composer before steering it with Enter.

Useful Session commands:

# Continue the latest Session for this workspace
mcode --continue

# Browse Sessions or open one by ID
mcode --session
mcode --session <session-id>

Inside the TUI, /sessions opens the Session Center for recent/archived Sessions, workspace/all scope, rename, archive/restore, and search. Search accepts plain text plus id:, path:, type:, status:, and model: filters. /history opens the current Session's input history and lets you preview a safe fork, edit, conversation rewind, or conversation-and-files rewind using the existing confirmation flow. While a response is running, history remains browse-only.

Inside the TUI, use /export to save the current Session as Markdown.

A no-argument TUI slash command runs only when no message text follows its name (trailing whitespace is allowed). If text follows, the entire line is sent as a regular prompt. Commands that accept arguments continue to run as commands.

The Composer labels live input as Prompt, Command, or Skill and adjusts its Enter action so the submission behavior is visible before sending. For example, /context is a command while /context explain this repository is a prompt; a Skill such as /docs explain the API remains a Skill invocation with instructions.

Agent Team and Runtime background work share one severity-aware Tasks summary line above the Composer, so a long-running Session does not lose input space as work accumulates. Use /tasks to open the unified detail view. It lists every task and its state, opens Agent child transcripts with Enter, retains recent completed Runtime tasks after their results are delivered, and exposes task metadata without taking ownership of task state. Delivered history does not keep the Composer summary visible. Ctrl+T continues to open the Todo plan.

Headless and CI

mcode exec runs a task without opening the TUI:

# Run one task
mcode exec "Review the current changes and run the relevant tests."

# Choose a repository and attach supporting context
mcode exec --cwd ./repo --file error.log "Find the cause of this build failure."

# Produce machine-readable output
mcode exec --output-format json "Summarize the current branch."

For automation, --output-schema accepts an inline JSON object or file path and constrains the model's final answer for Anthropic Messages, OpenAI Responses, and Chat Completions. The outer --output-format json value remains a stable ExecResult; models without strict Structured Output support fail before the Turn starts. --output-last-message is written atomically only after the final answer passes validation and Runtime completes its bounded shutdown. Use --output-format stream-json to stream progress.

Run mcode exec --help for the complete set of headless options.

ACP clients

Start the Agent Client Protocol server over stdin/stdout:

mcode acp

ACP-compatible editors and agent clients can use it to create, load, resume, and close MiniMax Code Sessions.

Models, Providers, and Plugins

Sign in with MiniMax:

mcode login

Desktop and the CLI/TUI share the same OAuth Core credential namespace when their canonical dataDir, build environment, region, and client ID match. Runtime receives only an in-memory access token projection. Installing @minimax-ai/code installs both the mcode and mcode-tools commands; the latter does not depend on starting the TUI to appear on PATH.

Inside a TUI-owned process, mcode-tools obtains short-lived access-token leases from the TUI Auth Lease Broker. It does not read the host auth.json, persist refresh tokens, or expose a second login/logout flow. The command remains installed regardless of login state; without a shared MCode login, brokered calls fail with an authentication-required error. A direct mcode-tools invocation outside a TUI-owned process remains available; TUI does not rewrite that process's environment or configuration.

Internal test and staging builds can route OAuth and managed-backend requests through an explicit lane. Put the global option before the subcommand:

mcode --lane oauth2 login
mcode --lane oauth2
mcode --lane oauth2 exec "Verify the OAuth session"

Production builds reject --lane, and MCode does not infer it from environment variables.

Use /model in the TUI to select a model and reasoning level. Select Add 3rd-party provider… to search models.dev or configure a Custom Provider. API keys stay masked in the form, and Runtime tests the connection before saving and applying the selected model. Use the Provider commands to inspect or configure model sources:

mcode provider list
mcode provider test <provider-id>
mcode provider add --name <name> --base-url <url> --model <model-id>
mcode provider remove <provider-id> --yes

Browse and manage Plugins from the command line:

mcode plugin list --available
mcode plugin add <plugin-id>
mcode plugin enable <plugin-id>
mcode plugin disable <plugin-id>

Run mcode plugin without arguments to open the interactive Plugin manager.

Network proxy

MiniMax Code reads HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and NO_PROXY, including their lowercase variants:

export HTTPS_PROXY=http://127.0.0.1:7890
mcode

localhost, 127.0.0.1, and ::1 always bypass the proxy.

Plans and permissions

Plan Mode lets you review an implementation plan before any code changes begin. Permission modes let you choose the right balance between confirmation and autonomy for the current task:

  • Ask requests confirmation before operations that need approval.
  • Auto handles routine operations automatically and asks when needed.
  • Full access allows broader execution for environments where you already trust the task and workspace.

Keep the narrowest mode that still fits your workflow, especially when working in an unfamiliar repository.

Command reference

CommandPurpose
mcode [prompt]Start the interactive TUI
mcode --continueContinue the latest Session for the current workspace
mcode --session [id]Browse Sessions or open one by ID
mcode exec [prompt]Run a headless task
mcode init [directory]Analyze a repository and create or improve AGENTS.md
mcode login / logoutManage MiniMax authentication
mcode provider ...Manage model Providers
mcode plugin ...Browse and manage Plugins
mcode acpStart the ACP server
mcode updateCheck for and install updates

Run mcode --help or mcode <command> --help for all options available in your installed version.

See CHANGELOG.md for user-visible changes in stable releases.

Troubleshooting

mcode: command not found

Make sure the global npm bin directory is in PATH, then run:

npm list -g @minimax-ai/code --depth=0
npm prefix -g
Unsupported Node.js version

Supported versions are Node.js >=22.19 <23 and >=24 <27. Node 23 is not supported. After switching Node.js versions, reinstall MiniMax Code:

node --version
npm install -g @minimax-ai/code
Authentication or Provider problems

Check the installed version, sign-in state, and Provider connectivity:

mcode --version
mcode login
mcode provider list
mcode provider test <provider-id>

Update and uninstall

# Check for and install updates
mcode update

# Uninstall
npm uninstall -g @minimax-ai/code

License

MIT

FAQs

Package last updated on 03 Sep 2026

Related posts