> ## 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 and configuration

> Learn about MiniMax Code CLI entry points, interactive capabilities, configuration, and integrations.

MiniMax Code CLI is the terminal entry point for repositories, scripts, CI, and editor integrations. The three entry points share sessions, models, providers, plugins, and permission controls, while exposing different interaction boundaries.

## Three ways to use the CLI

| Mode | Entry point | Main capability | Output or connection |
| - | - | - | - |
| Interactive TUI | `mcode [prompt]` | Explore code, hold conversations, review tools, and handle permissions | Terminal UI |
| Headless | `mcode exec [prompt]` | One-shot tasks, batch jobs, CI, and evaluations | `text`, `json`, or `stream-json` |
| ACP | `mcode acp` | Run MCode as an Agent server for editors and other hosts | stdin/stdout protocol stream |

## Interactive TUI

### Understand and change a workspace

MCode uses the current workspace as context. It reads project rules, the directory structure, relevant implementation, and available scripts before acting.

```text theme={null}
Read the project rules and relevant tests first. Explain the failure, then fix it and run the smallest relevant test set.
```

The TUI can read and write code and documentation, run terminal commands, inspect diffs, execute tests, and request permission before sensitive tool actions. Use `@` to reference workspace files or directories, and `Ctrl+V` to paste image or video files from the clipboard.

### Plan Mode and permission modes

Plan Mode controls whether the agent plans before execution. Permission mode controls how tool actions are handled. They are independent settings.

| Setting | Entry point | Purpose |
| - | - | - |
| Plan Mode | `/plan on`, `/plan off`, `/plan status`, `/plan view`; `Shift+Tab` | Plan before execution or inspect the current plan |
| Ask | `/permission ask` | Require interactive confirmation for tool actions |
| Auto | `/permission auto` | Classify routine actions automatically and ask when risk is high |
| Full access | `/permission full` | Skip normal permission checks; use only in a workspace whose risks you understand |
| Off | `permissionMode: off`, or Headless `--permission off` | Disable permission mode for a controlled automation environment |

The TUI picker provides Ask, Auto, and Full access. Use `/permission status` to inspect the current mode. Headless does not support `ask`; use the TUI or ACP when a human must approve an action.

### Sessions, goals, and long-running work

Sessions support creation, search, resume, fork, rewind, rename, compaction, export, and copy. While a response is running, press `Enter` or use `/steer <message>` to guide it, and press `Alt+Enter` to queue a follow-up.

Goals keep one objective active across multiple turns:

```text theme={null}
/goal Complete the migration and run the relevant tests
/goal budget=50K
/goal pause
/goal resume
```

Use `/goal edit` to change the objective and `/goal clear` to remove it. Goal budgets accept positive integers with optional `K` or `M` suffixes; use `budget=clear` to remove the cap.

### Ask a side question while the main task runs

Starting in 0.3.2, use `/btw [question]` or `/side [question]` to open a temporary side conversation. It inherits context from the main conversation's most recent committed boundary while the main task keeps running.

```text theme={null}
/btw Why did you choose this implementation?
```

The side conversation retains the current tool permissions, but tools that can modify data always require your explicit confirmation, including in Full access mode. Its composer shows the main task's status so you can see when that task finishes or needs approval.

| Action | Result |
| - | - |
| `Ctrl+/` | Switch between the main and side views while both continue running |
| `/parent` in the side conversation | Return to the main view and retain the side conversation |
| `Ctrl+C` in an empty side composer | Close and discard the side conversation |
| Run `/btw` again from the main view | Discard the old side conversation and start from the current boundary |

Temporary side conversations do not appear in `/sessions` or `/resume`. Switching to another Session automatically cleans them up. Shortcut availability depends on your terminal emulator and its configuration.

### Slash command reference

Type `/` to open autocomplete. Contextual commands appear only when the relevant session or run state exists.

| Category | Command | Purpose |
| - | - | - |
| Session | `/new` (alias `/clear`) | Create a new session |
| Session | `/sessions [query]` (alias `/resume`) | Search, resume, and manage sessions |
| Session | `/goal <objective-or-action>` | Start or manage the current goal |
| Session | `/plan [action]` | Switch or inspect Plan Mode; action is `on`, `off`, `status`, or `view` |
| Session | `/parent` | Return from a child agent session to its parent |
| Session | `/fork` | Fork the current session |
| Session | `/rewind` | Rewind the current session |
| Session | `/edit` | Edit the current session |
| Session | `/retry` | Retry the last message after a failed response |
| Session | `/rename [title]` | Rename the current session |
| Session | `/compact [instructions]` | Compact a long conversation |
| Session | `/btw [question]` (alias `/side`) | Open a temporary side conversation while the main task continues |
| Runtime | `/status` | Show version, account, model, runtime configuration, and quota summaries |
| Runtime | `/permission [action]` | Inspect or change permission mode; action is `status`, `ask`, `auto`, or `full` |
| Runtime | `/login`, `/logout` | Sign in or out of the MiniMax account |
| Runtime | `/doctor` | Inspect configuration and runtime environment |
| Runtime | `/context` | Show context budget and sources |
| Runtime | `/model [filter]` | Search and select a model |
| Runtime | `/provider` | View providers, delete third-party connections, or edit MiniMax credentials |
| Capability | `/plugins [filter]` | Browse, install, enable, and remove plugins |
| Capability | `/skills [filter]` | Search available skills |
| Capability | `/mcp [filter]` | Search MCP configuration |
| Input | `/steer <message>` | Guide the current response |
| Input | `/add-dir <path>` | Add a readable and writable workspace directory |
| Input | `/queue` | Manage messages waiting for the current response |
| Transcript | `/usage` | Show token usage |
| Transcript | `/export [path.md]` | Export the current session |
| Transcript | `/transcript` | Browse, search, and inspect the full conversation |
| Transcript | `/copy` | Copy the last response as Markdown |
| Application | `/help` | Show supported commands and shortcuts |
| Application | `/settings` | Configure the terminal interface |
| Application | `/update` | Check for and install a CLI update |
| Application | `/feedback <message>` | Submit redacted product feedback |
| Application | `/quit` (alias `/exit`) | Exit MCode |

### Inspect status and quotas

Run `/status` in the TUI to inspect the running version, current directory, model, permissions, account and plan, instruction file sources, and Default/Plan mode, including pending transitions. Signed-in accounts also show available 5-hour and weekly quota summaries with remaining percentages and reset countdowns. Use `/usage` for detailed usage.

The status panel wraps long paths and keeps local configuration visible while account details load or when the account request fails.

## Providers and models

The CLI supports MiniMax Token Plan, MiniMax API Key, and custom providers using compatible Anthropic or OpenAI API shapes.

### MiniMax credential source

```bash theme={null}
mcode provider list
mcode provider use token-plan
mcode provider use api-key
```

For a MiniMax API key, set an environment variable and then save and select it. The default variable is `MCODE_PROVIDER_API_KEY`:

```bash theme={null}
export MCODE_PROVIDER_API_KEY="your MiniMax API key"
mcode provider set-minimax-key
```

Use `--api-key-env <name>` to select another variable. The CLI reads the variable but does not print the key.

### Add a custom provider

```bash theme={null}
export MCODE_PROVIDER_API_KEY="your compatible-provider key"

mcode provider add \
  --name "My OpenAI-compatible service" \
  --base-url "https://api.example.com/v1" \
  --api-format openai-completions \
  --model "model-id" \
  --use
```

Supported API formats are `anthropic-messages`, `openai-completions`, `openai-responses`, and `google-generative-ai` (Google Gemini). Pass `--model` more than once to add multiple models; `--use` selects the first model as the default.

Other operations:

```bash theme={null}
mcode provider list --json
mcode provider test <provider-id> --model <model-id>
mcode provider test <provider-id> --json
mcode provider remove <provider-id> --yes
```

The MiniMax OAuth provider is managed with `mcode login` or `/login`, rather than `provider test`.

### Model references

Model references use `provider/model` and can include a variant:

```text theme={null}
provider/model#variant
```

Use `/model [filter]` in the TUI. In Headless mode, `--model` overrides only the current run and does not change global configuration.

## Plugins

Plugins come from an official marketplace or a local marketplace. List sources, installed plugins, and available plugins:

```bash theme={null}
mcode plugin marketplace list
mcode plugin list
mcode plugin list --available
```

Install, enable, disable, or uninstall a plugin:

```bash theme={null}
mcode plugin add <plugin>@official
mcode plugin enable <plugin>@official
mcode plugin disable <plugin>@official
mcode plugin remove <plugin>@official
```

When names collide, specify `@official` or `@local`, or pass `-m, --marketplace official|local`. Add `--json` for scripts. `mcode plugin marketplace upgrade` refreshes all marketplace snapshots; the local source is the `plugins` directory under the data directory.

## ACP

Start the ACP stdio server:

```bash theme={null}
mcode acp
```

ACP stdin/stdout is reserved for protocol messages; logs and diagnostics go to stderr. Do not write natural language directly to the ACP process, and do not let a wrapper mix logs into stdout. The ACP host can handle permission prompts, questions, cancellation, model controls, and Plan capabilities.

A generic editor Agent configuration looks like this:

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

If the editor cannot find `mcode`, use the absolute path to the executable and restart the editor to refresh `PATH`.

## CLI and desktop boundaries

The CLI does not depend on Electron or desktop IPC. Its focus is the terminal, repository, scripts, CI, and ACP. The interactive TUI on macOS and Windows can use [Computer Use](https://agent.minimax.io/docs/cli/computer-use.md) through the official plugin. Browser, desktop panels, and desktop shortcuts belong to the desktop app; see the desktop documentation for them.
