> ## Documentation Index
> Fetch the complete documentation index at: https://agent.minimax.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Features

> Learn about the main capabilities provided by MiniMax Code CLI.

<div className="code-docs">
  MiniMax Code CLI is the terminal entry point for developer workflows in MiniMax Code. It complements the desktop app: the app is well suited to visual task management and result review, while the CLI stays close to code repositories, terminals, scripts, CI, and editors.

  ## Three Ways to Use the CLI

  <CardGroup cols={3}>
    <Card title="Interactive TUI" icon="terminal">
      Run `mcode` to explore code, continue conversations, review tool calls, and
      manage sessions from your terminal.
    </Card>

    <Card title="Headless" icon="play">
      Run one task with `mcode exec` and pass structured results to scripts, CI,
      or evaluation workflows.
    </Card>

    <Card title="ACP" icon="plug">
      Run `mcode acp` to connect editors and clients that support Agent Client
      Protocol over standard input and output.
    </Card>
  </CardGroup>

  ## Interactive TUI

  ### Start by Understanding the Repository

  MCode reads project rules, the directory structure, relevant implementation, and available scripts from the current workspace. Run `mcode init .` or `/init` to analyze the repository and generate or update `AGENTS.md`, keeping project conventions alongside the code.

  A typical task follows these steps:

  <Steps>
    <Step title="Understand the context">
      Read project conventions, relevant implementation, and test entry points to
      identify the actual change scope.
    </Step>

    <Step title="Make changes">
      Use file, search, and terminal tools to change code or documentation, with
      your confirmation for important permissions and decisions.
    </Step>

    <Step title="Verify the result">
      Run relevant tests or checks, address failures, and summarize the changes,
      evidence, and remaining risks.
    </Step>
  </Steps>

  ### Core Capabilities

  | Capability             | Description                                                                                           |
  | ---------------------- | ----------------------------------------------------------------------------------------------------- |
  | Sessions               | Create, search, resume, fork, and archive tasks, or continue the latest task from the command line    |
  | Files and media        | Reference files or directories with `@`, and paste image or video files with `Ctrl+V`                 |
  | Plan Mode              | Discuss and review a plan before deciding whether to implement it; switch with `Shift+Tab` or `/plan` |
  | Permission controls    | Use Ask, Auto, or Full access independently of Plan Mode; switch with `Alt+M` or `/permission`        |
  | Queue and steer        | Queue messages while a task is running, or use the current draft to steer the response in progress    |
  | Goals                  | Start a persistent, pausable, and resumable goal with `/goal <goal>`                                  |
  | Providers and models   | Use MiniMax-hosted models, a MiniMax API key, or a compatible custom provider                         |
  | Skills, MCP, plugins   | Reuse engineering workflows, connect team tools and data, and install controlled Agent plugins        |
  | Transcript and context | Review the full conversation, tool details, context budget, and token usage                           |

  ## Headless Mode: Scripts and CI

  `mcode exec` runs without launching the TUI. It is designed for automation, batch processing, and reproducible evaluations.

  ```bash theme={null}
  mcode exec "Fix the failing tests"

  mcode exec \
    --cwd ./repo \
    --file error.log \
    --output-format json \
    "Analyze the error log, fix the issue, and run the relevant tests"
  ```

  Common options:

  | Option                          | Purpose                                                    |
  | ------------------------------- | ---------------------------------------------------------- |
  | `--cwd <path>`                  | Set the workspace directory                                |
  | `--file <path>`                 | Add an attachment; can be used more than once              |
  | `--model <provider/model>`      | Select a model for this run only                           |
  | `--session <id>` / `--continue` | Run within an existing session                             |
  | `--permission <policy>`         | Use the `ask`, `smart`, `full`, or `off` permission policy |
  | `--timeout <duration>`          | Set a timeout such as `30s` or `2m`                        |
  | `--max-steps <count>`           | Limit the number of Assistant steps                        |
  | `--output-format <format>`      | Output `text`, `json`, or `stream-json`                    |
  | `--output-schema <json>`        | Validate the final JSON result against a JSON Schema       |

  Machine-readable output is written to `stdout`, while diagnostics are written to `stderr`. Standard input is read only when you explicitly use `--input -`, preventing CI jobs from waiting for input unexpectedly.

  ## ACP: Connect an Editor

  `mcode acp` runs MCode as an ACP v1 Agent server and transports NDJSON over `stdin/stdout`. It does not require an additional HTTP service or an MCode-specific editor extension.

  For example, add the following under External Agents in Zed:

  ```json theme={null}
  {
    "agent_servers": {
      "minimax-code": {
        "type": "custom",
        "command": "mcode",
        "args": ["acp"],
        "env": {}
      }
    }
  }
  ```

  Once connected, Assistant responses, Thinking, tool status, file locations, and diffs can be projected into the editor. Permission prompts, question selection, and cancellation are handled through the same ACP task flow. If the editor cannot find `mcode`, replace `command` with the absolute path to the executable.

  <Warning>
    The `stdout` stream from `mcode acp` is reserved for ACP protocol messages. Do
    not send natural language directly to it or allow wrapper scripts to write
    logs to `stdout`.
  </Warning>

  ## Command Overview

  | Command                        | Purpose                                                            |
  | ------------------------------ | ------------------------------------------------------------------ |
  | `mcode [prompt]`               | Launch the interactive TUI, optionally with a task                 |
  | `mcode init [directory]`       | Analyze a repository and create or update `AGENTS.md`              |
  | `mcode exec [prompt]`          | Run one Headless task                                              |
  | `mcode acp`                    | Start the ACP stdio server                                         |
  | `mcode login` / `mcode logout` | Manage MiniMax sign-in status                                      |
  | `mcode provider`               | View or manage providers and API key routing                       |
  | `mcode plugin`                 | Browse and manage Agent plugins                                    |
  | `mcode update`                 | Check for and install updates supported by the installation source |

  Run `mcode <command> --help` to view the complete option contract for your installed version.

  ## Capability Boundaries

  * The CLI does not depend on Electron or desktop IPC. Host capabilities such as Browser and Computer Use are available only when the runtime environment explicitly provides them.
  * Image display, link handling, system clipboard access, and keyboard shortcuts ultimately depend on the terminal emulator and its configuration. Use `Ctrl+V` when pasting images.
  * TUI, Headless, and ACP target different interaction patterns. An ACP client sees only the commands and input types explicitly supported by the current protocol.
</div>
