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

# Crush

> Methods for Using the GLM Coding Plan in Crush

Crush is a powerful AI coding agent for the terminal (CLI + TUI). It supports multiple models to handle code generation, debugging, file operations, and more — all inside your command line.

## Step 1: Installing Crush

Select the appropriate installation method based on your system:

<Tabs>
  <Tab title="Homebrew (Recommended for macOS)">
    ```
    brew install charmbracelet/tap/crush
    ```
  </Tab>

  <Tab title="NPM (Cross-Platform)">
    ```
    npm install -g @charmland/crush
    ```
  </Tab>

  <Tab title="Arch Linux">
    ```
    yay -S crush-bin
    ```
  </Tab>

  <Tab title="Nix">
    ```
    nix run github:numtide/nix-ai-tools#crush
    ```
  </Tab>
</Tabs>

## Step 2: Configuring the GLM Model

### 1. Obtain Your Z.AI API Key

Visit Z.AI to get your [API Key](https://z.ai/manage-apikey/apikey-list).

### 2. Launch Crush and Select Model

Run the crush command to start the application:

```
crush
```

In the model selection interface, choose the model you want to use.

### 3. Enter your Z.AI API key

Enter the API Key obtained from Z.AI at the prompt.

## Step 3: Modify Crush Configuration

### 1. Locate the Configuration File

Depending on your OS, the configuration file can be found at:

<CodeGroup>
  ```bash MacOS/Linux theme={null}
  ~/.config/crush/crush.json
  ```

  ```powershell Windows theme={null}
  %USERPROFILE%\.config\crush\crush.json
  ```
</CodeGroup>

### 2. Switch to the GLM Coding Plan Endpoint

Open the crush.json file and configure it as follows, making sure to replace with your API KEY:

```
{
  "providers": {
    "zai": {
      "id": "zai",
      "name": "ZAI Provider",
      "base_url": "https://api.z.ai/api/coding/paas/v4",
      "api_key": "your_api_key"
    }
  }
}
```

## Step 4: Complete Configuration and Pick model

Press `ctrl+p`, choose "Switch Model"

After configuration, restart the Crush app and you're ready to go.

## Coding Plan MCP Servers

Refer to the [Vision MCP Server](/devpack/mcp/vision-mcp-server) , [Search MCP Server](/devpack/mcp/search-mcp-server) and [Web Reader MCP Server](/devpack/mcp/reader-mcp-server) documentation; once configured, you can use them in Crush.
