> ## 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.

# Configuration and models

> Configure MiniMax Code CLI data directories, credentials, providers, models, proxies, skills, MCP, and plugins.

This page describes the configuration users can control from the CLI. Use `/status`, `/doctor`, and `/model` in the TUI to inspect the effective state, or run a command with `--help`.

## Configuration layers

| Layer | Entry point | Scope |
| - | - | - |
| Current run | CLI options such as `mcode exec --model ...` | Overrides one process or task |
| Runtime config | `<data-dir>/config.yaml` | Stores default model, permission mode, and MiniMax source |
| Provider credentials | `mcode provider ...` | Stores provider metadata and credential references |
| Project rules | `AGENTS.md` in the workspace | Describes project conventions and validation |

Command-line overrides apply only to the current run and do not silently rewrite global configuration.

## Data directory

The default data root is `~/.minimax`. It stores configuration, sessions, logs, plugins, skills, and other runtime data. Choose another directory with:

```bash theme={null}
export MINIMAX_DATA_DIR=/path/to/mcode-data
```

`MAVIS_DATA_DIR` is a compatibility fallback; `MINIMAX_DATA_DIR` wins when both are set. The configuration file is:

```text theme={null}
<data-dir>/config.yaml
```

## Runtime settings

```yaml theme={null}
defaultModel: "provider-id/model-id"
defaultModelVariant: standard
permissionMode: auto
minimaxModelSource: token_plan
```

| Field | Values or format | Purpose |
| - | - | - |
| `defaultModel` | `provider/model` | Default model |
| `defaultModelVariant` | A provider-supported variant | Default model variant |
| `permissionMode` | `default`, `auto`, `bypassPermissions`, `off` | Default tool permission mode |
| `minimaxModelSource` | `token_plan`, `minimax_api_key` | MiniMax credential source |

Models can use `provider/model#variant`. Use `/model [filter]` in the TUI or `--model` for a one-run override.

## Context capacity and status line

New sessions inherit the selected model's context capacity. Starting with 0.4.12, the default status line shows the known total capacity, such as `Context 1M` or `Context 512K`, until valid usage is available. It then switches to the remaining percentage, such as `Context 80% left`, without showing both indicators. Shorter labels retain `Ctx` when space is limited.

If you already customized the status line, run `/statusline` and enable `context-window`, or restore the default configuration. This item shows total capacity; `context-remaining` shows the remaining percentage. Explicitly configured items can both be enabled together and do not follow the default automatic switching rule. When the current session's capacity is unavailable, the capacity item is hidden instead of displaying another session's value.

## Sign-in and MiniMax credentials

```bash theme={null}
mcode login
mcode login --region global
mcode logout
```

The default region is mainland China; pass `--region global` for a Global account.

Running `mcode logout` or `/logout` in the TUI clears the local sign-in state, prints a complete browser sign-out link, and tries to open the page for the current account region and environment. On a remote or headless machine, copy the link from the terminal into your own browser. Command completion does not wait for the browser or page result.

When using Token Plan, the CLI checks the managed login. When using an API key, set the variable first:

```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 key but does not print it.

## Custom providers

Adding a provider requires at least one model:

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

mcode provider add \
  --name "My 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`
* `google-generative-ai` (Google Gemini; a Base URL with only the host gets `/v1beta` appended automatically)

Manage providers with:

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

Pass `--model` more than once to add multiple models. `--use` selects the first model as the default. Manage the MiniMax OAuth provider with `mcode login`, not `provider test`.

## Proxy

The CLI supports these variables and lowercase variants:

```bash theme={null}
export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=internal.example.com
```

Supported names are `HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`, and `NO_PROXY`. The CLI always bypasses `localhost`, `127.0.0.1`, and `::1` for login callbacks and local services.

## Skills and MCP

In the TUI:

```text theme={null}
/skills [filter]
/mcp [filter]
```

`/skills` searches available skills and `/mcp` searches MCP configuration. Available entries depend on the data directory, project, and host. Run `/doctor` to inspect configuration and `/status` to inspect runtime state.

Starting with 0.4.5, models that support web search use a built-in search tool without requiring a separate search MCP server. User-configured MCP servers are unaffected.

## Plugins

Plugins come from an official or local marketplace:

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

Install and manage them with:

```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, append `@official` or `@local`, or pass `-m, --marketplace official|local`. Add `--json` for scripts. The local source is the `plugins` directory under the data directory.

## Configuration checks

```bash theme={null}
mcode --version
mcode provider list --json
mcode plugin list --json
```

In the TUI, run `/doctor` for configuration checks, `/status` for account and model state, and `/model` for available models. Confirm that `minimaxModelSource` matches the login or API-key configuration.
