国货之光

hetaoBackend 5ea390da64 fix: preserve query parameters in provider endpoint URLs há 2 meses atrás
.agents 4c0d8297c7 test: bound Windows filesystem concurrency and runtime startup (#181) há 2 meses atrás
.github d9ee3a8686 docs: update repository content after source import há 2 meses atrás
docs 0f4b6b1cab fix: restrict credential-bearing config files to owner access (#170) há 2 meses atrás
examples c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
packages 5ea390da64 fix: preserve query parameters in provider endpoint URLs há 2 meses atrás
release 5ea390da64 fix: preserve query parameters in provider endpoint URLs há 2 meses atrás
scripts 4c0d8297c7 test: bound Windows filesystem concurrency and runtime startup (#181) há 2 meses atrás
test 5ea390da64 fix: preserve query parameters in provider endpoint URLs há 2 meses atrás
third_party c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
.gitattributes c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
.gitignore c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
.gitleaks.toml c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
.npmrc c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
AGENTS.md fe9a0dbda2 docs: clarify agent workflow and branch naming rules (#163) há 2 meses atrás
CONTRIBUTING.md ac848adf9c docs: add public contributor development skills (#164) há 2 meses atrás
LICENSE c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
LICENSE-STATUS.md d9ee3a8686 docs: update repository content after source import há 2 meses atrás
NOTICE c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
README.md 33b259bbbe docs: distinguish published and source-build data directories há 2 meses atrás
README_ZH.md 33b259bbbe docs: distinguish published and source-build data directories há 2 meses atrás
SECURITY.md 33b259bbbe docs: distinguish published and source-build data directories há 2 meses atrás
THIRD_PARTY_NOTICES.md c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
package.json c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
pnpm-lock.yaml 17b8ded9c1 build(deps-dev): bump the tooling-minor-patch group with 2 updates (#144) há 2 meses atrás
pnpm-workspace.yaml c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
tsconfig.node.json c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
tsconfig.standalone.json c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás
vitest.oss.config.mjs c59cf53770 Import MiniMax Code CLI source snapshot há 2 meses atrás

README.md

MiniMax Code

MiniMax Code

A terminal coding agent with MiniMax, your own models, and tools beyond code.

Get started · Documentation · Examples · Contributing

English · 简体中文

Source preview

Understand a project, make changes, and run tests from your terminal. Use your MiniMax account or bring your own model, with search, plugins, and multimodal tools in the same workflow.

Watch the 20-second demo → · Real terminal output, with pauses shortened

Quick start

1. Install MCode

Use the official installer for your platform. It installs the latest CLI, prepares a compatible Node.js runtime when needed, and does not require sudo or administrator privileges. Alpine / musl Linux is not supported by the one-command installer.

macOS / Linux / WSL

curl -fsSL https://filecdn.minimax.chat/public/install.sh | bash

Windows (PowerShell)

irm https://filecdn.minimax.chat/public/install.ps1 | iex

npm — if you already have Node.js 22.19+ (22.x), 24.2+ (24.x), 25, or 26:

npm install -g @minimax-ai/code@latest --registry=https://registry.npmjs.org/ --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3

The npm command uses the public registry, includes the optional SQLite dependency, and permits the package and SQLite installation scripts. See the installation guide for version pinning and Node.js compatibility.

Reopen your terminal and check the installation:

mcode --version
mcode --help

See the official quick start, features, and troubleshooting.

2. Sign in or bring your own API key

For a mainland China account:

mcode login

For a Global account:

mcode login --region global

Complete sign-in in your browser, then open mcode and use /status to check your account and /provider to choose a model. Run mcode logout to sign out.

Token Plan requires an account with available credits. The published npm CLI @minimax-ai/code@0.4.12 defaults to ~/.minimax for user data; builds from this repository default to ~/.minimax-code. MINIMAX_DATA_DIR or MAVIS_DATA_DIR can override the data directory. The installer's ~/.minimax-code installation directory is separate from this choice. See Accounts and data before locating or removing configuration and sessions.

Use your own API key (BYOK) BYOK does not require a MiniMax login. Set `MCODE_PROVIDER_API_KEY` in your current shell, then add a provider. Replace the example URL and model name with your provider's values: ```bash mcode provider add --name my-provider --base-url https://example.com/v1 \ --api-format openai-completions --model my-model \ --api-key-env MCODE_PROVIDER_API_KEY --use mcode ``` `--use` tests the first listed model before saving and selecting it. A failed connection test saves nothing. Omit `--use` to save without testing or changing the default model. For custom/local models, add `--context-limit 32768 --output-limit 4096` (use your server's actual limits). Each value must be a positive safe integer and applies to every repeated `--model`. Inspect configured limits with `mcode provider list --json`. Omitting these flags preserves the existing model-limit defaults. Supported API formats: `openai-completions`, `openai-responses`, and `anthropic-messages`. See the [model examples](docs/examples.md#2-choose-your-own-model) for environment variable setup, connection checks, and model overrides for a single run.

3. Run your first task

Open the project you want to work on:

cd /path/to/your/project
mcode

Describe your task in the TUI, or submit it directly when you launch MCode:

mcode "Find a failing test, fix the implementation, and run the relevant tests."

Use mcode init . to generate or update project guidance in AGENTS.md. Describe the expected result, allowed changes, and how to verify the task.

Entry point Command Use it for
Interactive TUI mcode [prompt] Explore code, continue a conversation, and review changes or permissions.
Headless mcode exec [prompt] Shell scripts, CI, batch work, and evaluations.
ACP mcode acp Editors and clients supporting Agent Client Protocol.

Continue your work

# Resume the latest session in the current workspace
mcode --continue

# Open the session picker
mcode --session

Inside the TUI, use /sessions to find previous sessions and /help to see all commands and shortcuts.

Action Shortcut
Send a message or steer the running task Enter
Queue a follow-up while a task is running Alt+Enter
Insert a newline Shift+Enter
Reference a workspace file or directory @
Toggle Plan Mode Shift+Tab
Switch permission modes Alt+M
Close a panel or interrupt a running task Esc

What you can do

Task Capabilities
Edit and verify code Read files, inspect diffs, run shell commands and tests, and control tool execution with permissions and sandboxing.
Choose your model Use a MiniMax account / Token Plan, or custom providers with OpenAI- or Anthropic-compatible API formats.
Search and work with media Use built-in search, mcode-tools media tools, MCP, and managed connectors, subject to account access and service credits.
Keep work moving Resume sessions, plan tasks, use subagents, and extend the agent with official, local, or GitHub plugins and built-in skills.
Connect your workflow Run scripted tasks with the headless CLI, or connect compatible editors and clients through ACP.

Account features, updates, feedback, and diagnostics are also included. Managed tools require network access and the relevant authorization. See capabilities and service boundaries for details.

Try it

Start the TUI in a copy of the example project and enter:

Read clamp.mjs and clamp.test.mjs. Run node --test to reproduce the failure, fix clamp without changing the tests, then run the tests again.

The small, reproducible project is the same task used in the demo above. More examples cover switching models, calling real search, and using your own image inputs.

Build from source

To develop MCode or run this source checkout, you need Git, Node.js 22.19+ (22.x), 24.2+ (24.x), 25, or 26, and pnpm 9.12.0.

git clone https://github.com/MiniMax-AI/minimax-code.git
cd minimax-code
pnpm install --frozen-lockfile
pnpm build
pnpm mcode

The first build requires an internet connection. Dependencies and the integrity-checked mcode-tools bundle come from public npm. See the source installation guide for pnpm setup, system dependencies, and updates.

From the source directory, use pnpm mcode in place of mcode in the examples above. To work on your own project, open its directory and launch the built CLI:

node /absolute/path/to/minimax-code/dist/cli.js

This repository targets the 0.4.12 source preview. Installing the published package and building this checkout are separate paths. Matching versions do not prove identical build provenance; see the version and evidence baseline.

Documentation and contributing

English is the primary documentation language. The Chinese README mirrors this page.

For now, code and documentation pull requests are accepted only from repository collaborators. If you are not a collaborator but have an idea or proposal, please open an issue so we can discuss it. Remove secrets, account details, and private project content from reports.

Desktop app and support

Download for macOS or Windows · Report a problem or ask a question

This repository also hosts issue reporting for the MiniMax Code desktop app. The published source covers the terminal TUI, headless CLI, and ACP; it does not include the desktop application's source. Select the affected product when filing an issue. For a desktop bug, include the app version, operating system, and a log upload ID if available from Settings → General → Upload logs. For a CLI bug, include mcode --version, your interface, and a minimal reproduction. Remove credentials and private project content from reports.

License

First-party code defaults to MIT. Existing file-level and package-level licenses remain in place. See third-party notices and license status for dependencies, assets, and mcode-tools.