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

# Claude Code CLI

> Connect Claude Code CLI to EvoLink.AI

## Overview

<img src="https://mintcdn.com/muyutechnology/ogYegfyiYikRHauR/images/integration-guide/image-9.png?fit=max&auto=format&n=ogYegfyiYikRHauR&q=85&s=343a46989688b9870d289bae53974074" alt="Claude Code CLI Interface" width="1692" height="517" data-path="images/integration-guide/image-9.png" />

Claude Code CLI is the official command-line tool from Anthropic for interacting with Claude models in the terminal.
By integrating Claude Code CLI with **EvoLink API**, you can directly access Claude model capabilities through EvoLink.

## Prerequisites

Before configuring, make sure you have:

### Get EvoLink API Key

* Log in to [EvoLink Dashboard](https://evolink.ai/dashboard)
* Find API Keys in the dashboard, click "Create New Key" button, then copy the generated Key
* API Key usually starts with `sk-`

## Step 1: Install Claude Code CLI

<Note>
  **Tip:** If you don't know how to open a command line terminal, see [FAQ - How to open command line terminal](#14-how-to-open-command-line-terminal)
</Note>

### 1. One-Command Installation

<Tabs>
  <Tab title="macOS / Linux">
    ```bash theme={null}
    curl -fsSL https://claude.ai/install.sh | bash
    ```

    **Expected result:** You'll see download and installation info, ending with a success message.

    **If error occurs:** `permission denied` means you need to add `sudo` before the command.
  </Tab>

  <Tab title="Windows">
    ### 1.1 Install Node.js and npm (Skip if installed)

    **First-time installation:**

    1. Visit [Node.js official website](https://nodejs.org/) to download and install (LTS version recommended)
    2. If you're unfamiliar with the installation process, refer to [Node.js Installation Guide](https://nodejs.org/en/download/package-manager)
    3. Node.js v20 or higher is recommended

    **Verify installation:**

    ```bash theme={null}
    node -v
    npm -v
    ```

    <img src="https://mintcdn.com/muyutechnology/aVl9y2uT7NNwpwBy/images/integration-guide/claude-node-npm-verify.png?fit=max&auto=format&n=aVl9y2uT7NNwpwBy&q=85&s=13be4f60f117fca3024b2b2c1d0fd208" alt="Node.js and npm version verification" width="1730" height="923" data-path="images/integration-guide/claude-node-npm-verify.png" />

    ### 1.2 Install Claude Code CLI

    Run in PowerShell or CMD:

    ```bash theme={null}
    npm install -g @anthropic-ai/claude-code
    ```

    **Expected result:** You'll see download and installation info, ending with a success message.

    **If error occurs:**

    * `permission denied`: Run PowerShell or CMD as administrator
    * `npm command not found`: Node.js is not properly installed or not added to environment variables
  </Tab>
</Tabs>

**Note:** macOS/Linux uses one-command installation script, Windows uses npm installation.

### 2. Verify Installation

```bash theme={null}
claude --version
```

**Success indicator:** Shows version number (e.g., `1.x.x`).

<img src="https://mintcdn.com/muyutechnology/zYVnvTrpvj8xvjrr/images/integration-guide/image-copy.png?fit=max&auto=format&n=zYVnvTrpvj8xvjrr&q=85&s=4cc1f795f8c39d7341d942e780b0c674" alt="Claude Code CLI Version" width="1730" height="923" data-path="images/integration-guide/image-copy.png" />

## Step 2: Configure EvoLink API

Claude Code CLI is configured via `settings.json`.

<Tabs>
  <Tab title="CC Switch">
    [CC Switch](https://github.com/farion1231/cc-switch) is a desktop GUI tool for managing Claude Code provider configurations through a graphical interface, without manually editing config files.

    ### 1. Install CC Switch

    Download the installer for your platform from [GitHub Releases](https://github.com/farion1231/cc-switch/releases).

    ### 2. Configure EvoLink

    1. Open CC Switch
    2. Click the icon in the top-right corner to enter the configuration page

    <Frame>
      <img src="https://mintcdn.com/muyutechnology/js6gY_V1bzKBWRJz/images/integration-guide/cc-switch/cc-switch-install.png?fit=max&auto=format&n=js6gY_V1bzKBWRJz&q=85&s=9b7aef4e499e4b86a939b8516c718120" alt="CC Switch Open Configuration" width="1374" height="974" data-path="images/integration-guide/cc-switch/cc-switch-install.png" />
    </Frame>

    3. Fill in the fields as shown in the image

    <Frame>
      <img src="https://mintcdn.com/muyutechnology/js6gY_V1bzKBWRJz/images/integration-guide/cc-switch/cc-switch-config-en.png?fit=max&auto=format&n=js6gY_V1bzKBWRJz&q=85&s=aab64a278072380cc26b2e2b3e942194" alt="CC Switch Configure EvoLink" width="1389" height="1007" data-path="images/integration-guide/cc-switch/cc-switch-config-en.png" />
    </Frame>

    4. Click "Add"

    CC Switch will automatically write the configuration to `settings.json`, no manual operation needed.

    <Tip>
      CC Switch also supports system tray quick switching, MCP server management, cloud config sync, and more.
    </Tip>
  </Tab>

  <Tab title="settings.json">
    <Note>
      **Note:** If this is your first time using Claude Code CLI, we recommend starting with "Temporary" to test your configuration before using this method for permanent setup.
    </Note>

    ### 1. Open config directory

    <Tabs>
      <Tab title="Windows">
        Press `Win + R`, paste the following, then press Enter:

        ```
        %userprofile%\.claude
        ```

        **If folder doesn't exist**: Manually create `.claude` folder (press `Win + R`, type `%userprofile%`, press Enter to open user directory, then create a new folder named `.claude`).

        <img src="https://mintcdn.com/muyutechnology/hdDK-GS-iVpfdhZR/images/integration-guide/enclaudewin-r.png?fit=max&auto=format&n=hdDK-GS-iVpfdhZR&q=85&s=96f493f5552d08f86b87c50c87910c6b" alt="Windows Win+R open terminal" width="568" height="334" data-path="images/integration-guide/enclaudewin-r.png" />
      </Tab>

      <Tab title="macOS">
        In Finder, press `Command + Shift + G`, paste the following path, then press Enter:

        ```
        ~/.claude
        ```

        **If folder doesn't exist**: Open Terminal and run `mkdir ~/.claude` to create the folder.
      </Tab>

      <Tab title="Linux">
        Open file manager and navigate to:

        ```
        ~/.claude
        ```

        **If folder doesn't exist**: Open Terminal and run `mkdir ~/.claude` to create the folder.
      </Tab>
    </Tabs>

    ### 2. Edit settings.json

    In the opened folder, if `settings.json` doesn't exist, right-click in empty space → New → Text Document → Rename to `settings.json` (remove `.txt` extension). Then double-click to open with an editor and add the following content:

    ```json theme={null}
    {
      "env": {
        "ANTHROPIC_AUTH_TOKEN": "your-evolink-api-key",
        "ANTHROPIC_BASE_URL": "https://direct.evolink.ai",
        "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
      },
      "permissions": {
        "allow": [],
        "deny": []
      }
    }
    ```

    **⚠️ Important:**

    * **Copy completely** without missing any symbols
    * Replace `"your-evolink-api-key"` with actual API Key (keep quotes)
    * Don't use Chinese input method for punctuation

    **Configuration options:**

    * `ANTHROPIC_AUTH_TOKEN`: Your EvoLink API Key
    * `ANTHROPIC_BASE_URL`: `https://direct.evolink.ai` (EvoLink API endpoint)
    * `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`: Reduce non-essential network requests

          <img src="https://mintcdn.com/muyutechnology/aVl9y2uT7NNwpwBy/images/integration-guide/claude-config-env-en.png?fit=max&auto=format&n=aVl9y2uT7NNwpwBy&q=85&s=2abc02bdf6f9734547f588f53eb9a786" alt="Claude Code CLI configuration environment" width="1264" height="848" data-path="images/integration-guide/claude-config-env-en.png" />
  </Tab>

  <Tab title="Permanent">
    <Tabs>
      <Tab title="Windows">
        **GUI Setup:**

        1. Right-click "This PC" → "Properties" → "Advanced system settings" → "Environment Variables"
        2. In "User variables" or "System variables", create new:
           * Variable name: `ANTHROPIC_BASE_URL`
           * Variable value: `https://direct.evolink.ai`
        3. Add `ANTHROPIC_AUTH_TOKEN` with your API Key as the value
        4. Click "OK" to save

        **PowerShell Command:**

        ```powershell theme={null}
        [System.Environment]::SetEnvironmentVariable('ANTHROPIC_BASE_URL', 'https://direct.evolink.ai', 'User')
        [System.Environment]::SetEnvironmentVariable('ANTHROPIC_AUTH_TOKEN', 'your-evolink-api-key', 'User')
        ```

        **Note:** Restart terminal to take effect.
      </Tab>

      <Tab title="macOS">
        Edit shell configuration file (choose based on your shell):

        **If using zsh (macOS default):**

        ```bash theme={null}
        echo 'export ANTHROPIC_BASE_URL="https://direct.evolink.ai"' >> ~/.zshrc
        echo 'export ANTHROPIC_AUTH_TOKEN="your-evolink-api-key"' >> ~/.zshrc
        ```

        **If using bash:**

        ```bash theme={null}
        echo 'export ANTHROPIC_BASE_URL="https://direct.evolink.ai"' >> ~/.bash_profile
        echo 'export ANTHROPIC_AUTH_TOKEN="your-evolink-api-key"' >> ~/.bash_profile
        ```

        **Apply immediately:**

        ```bash theme={null}
        source ~/.zshrc  # or source ~/.bash_profile
        ```
      </Tab>

      <Tab title="Linux">
        Edit shell configuration file (choose based on your shell):

        **If using bash (common on Linux):**

        ```bash theme={null}
        echo 'export ANTHROPIC_BASE_URL="https://direct.evolink.ai"' >> ~/.bashrc
        echo 'export ANTHROPIC_AUTH_TOKEN="your-evolink-api-key"' >> ~/.bashrc
        ```

        **If using zsh:**

        ```bash theme={null}
        echo 'export ANTHROPIC_BASE_URL="https://direct.evolink.ai"' >> ~/.zshrc
        echo 'export ANTHROPIC_AUTH_TOKEN="your-evolink-api-key"' >> ~/.zshrc
        ```

        **Apply immediately:**

        ```bash theme={null}
        source ~/.bashrc  # or source ~/.zshrc
        ```
      </Tab>
    </Tabs>

    **⚠️ Note**: Replace `your-evolink-api-key` with your actual API Key.
  </Tab>

  <Tab title="Temporary">
    <Tabs>
      <Tab title="Windows">
        In PowerShell:

        ```powershell theme={null}
        $env:ANTHROPIC_BASE_URL="https://direct.evolink.ai"
        $env:ANTHROPIC_AUTH_TOKEN="your-evolink-api-key"
        ```

        In CMD:

        ```cmd theme={null}
        set ANTHROPIC_BASE_URL=https://direct.evolink.ai
        set ANTHROPIC_AUTH_TOKEN=your-evolink-api-key
        ```

        **Note:** Configuration expires after closing the terminal.
      </Tab>

      <Tab title="macOS / Linux">
        In Terminal:

        ```bash theme={null}
        export ANTHROPIC_BASE_URL="https://direct.evolink.ai"
        export ANTHROPIC_AUTH_TOKEN="your-evolink-api-key"
        ```

        **Note:** Configuration expires after closing the terminal.
      </Tab>
    </Tabs>

    **⚠️ Note**: Replace `your-evolink-api-key` with your actual API Key.
  </Tab>
</Tabs>

## Step 3: Start Using Claude Code CLI

### 1. Enter a safe working directory

```bash theme={null}
cd your-working-directory
```

**Note:** Replace `your-working-directory` with actual path

### 2. Interactive mode

```shell theme={null}
claude
```

<img src="https://mintcdn.com/muyutechnology/aVl9y2uT7NNwpwBy/images/integration-guide/claude-interface.png?fit=max&auto=format&n=aVl9y2uT7NNwpwBy&q=85&s=c6294e3424b61a8509244a6d65f96e2e" alt="Claude Code CLI interface" width="1730" height="923" data-path="images/integration-guide/claude-interface.png" />

### 3. Verify configuration

```shell theme={null}
claude "Who are you"
```

**Success indicators:**

* See AI response text (several lines)
* **No** errors like `401`, `403`, `API Key invalid`

**If you see errors:**

* `401 Unauthorized`: API Key not set or invalid → Check settings.json
* `403 Forbidden`: Insufficient API Key permissions → Verify API Key
* `Network error`: Network issue → Check connection

## FAQ

### 1. What is Claude Code CLI and what is it used for?

Claude Code CLI is the official command-line tool from Anthropic that allows users to interact with Claude models in the terminal. It's primarily used for code assistance, text generation, Q\&A conversations, and file analysis—especially suited for developers who need quick AI capabilities in a command-line environment.

### 2. How do I verify installation and configuration on first use?

Run these commands in sequence:

* `claude --version`: Confirm Claude Code CLI is installed
* `claude "Who are you"`: Confirm API configuration is correct

### 3. What's the difference between interactive mode and single command mode?

* **Interactive mode**: Run `claude` to enter continuous conversation for multi-turn interactions, ideal for complex tasks
* **Single command mode**: Run `claude "question"` to get a single response and exit, ideal for quick queries

### 4. Will Claude Code CLI automatically read or upload my local files and code?

No. Claude Code CLI only reads file content when you explicitly reference or authorize it, and will request confirmation before performing sensitive operations. It's recommended to use it in a dedicated project folder.

### 5. How do I use Claude Code CLI to analyze or process local file content?

In interactive mode, you can reference files by:

* Typing the file path for Claude to read
* Dragging files into the terminal window
* Copy and pasting file content

### 6. Does Claude Code CLI support Chinese input and output?

Yes, fully supported. Claude Code CLI supports Chinese input and output—you can ask questions in Chinese and receive Chinese responses.

### 7. No output after execution—what could be the cause?

Common causes include:

* Network connection issues preventing API server access
* Invalid API Key or insufficient balance
* Incorrect `ANTHROPIC_BASE_URL` configuration
* Firewall or proxy blocking requests

### 8. Why don't my config file or environment variable changes take effect?

* Restart your terminal or command line window
* Check that `settings.json` has valid JSON syntax
* Verify the config file path:
  * Windows: `C:\Users\{username}\.claude\settings.json`
  * macOS / Linux: `~/.claude/settings.json`

### 9. What causes 401/403 errors?

* **401 error**: `ANTHROPIC_AUTH_TOKEN` not set or invalid API Key
* **403 error**: Insufficient API Key permissions or expired key
* Verify `ANTHROPIC_BASE_URL` is set to `https://direct.evolink.ai`

### 10. What scenarios is Claude Code CLI suited for? What is it not suited for?

**Suited for:**

* Code writing, debugging, and refactoring
* Quick Q\&A in command-line environments
* File content analysis and processing
* Automation script integration

**Not suited for:**

* Complex interactions requiring a graphical interface
* Real-time collaborative editing
* Large-scale batch file processing

### 11. How do I switch models?

Type `/model` in interactive mode to switch models.

### 12. What Claude models does EvoLink support?

EvoLink supports the following Claude models:

| Model Name                   | Description   |
| ---------------------------- | ------------- |
| `claude-haiku-4-5-20251001`  | Fast response |
| `claude-sonnet-4-5-20250929` | Balanced      |
| `claude-sonnet-4-20250514`   | Standard      |
| `claude-opus-4-1-20250805`   | Advanced      |
| `claude-opus-4-5-20251101`   | Advanced      |
| `claude-sonnet-4-6`          | Latest        |
| `claude-opus-4-7`            | Latest        |
| `claude-opus-4-6`            | Advanced      |

### 13. How do I upload images?

* Option 1: Reference the image path
* Option 2: Drag and drop an image into the terminal
* Option 3: Paste an image directly

All methods require user action—Claude Code CLI will not automatically read or upload local images.

### 14. How to open command line terminal?

<Tabs>
  <Tab title="Windows">
    * Method 1: Press `Win + R`, type `cmd` or `powershell`, then press Enter
    * Method 2: Search for "Command Prompt" or "PowerShell" in the Start menu
    * Method 3: Hold Shift and right-click in a folder, select "Open PowerShell window here"
  </Tab>

  <Tab title="macOS">
    * Method 1: Press `Command + Space` to open Spotlight, type `Terminal`, then press Enter
    * Method 2: Go to "Applications" → "Utilities" → "Terminal"
  </Tab>

  <Tab title="Linux">
    * Method 1: Press `Ctrl + Alt + T` shortcut
    * Method 2: Search for "Terminal" in the application menu
  </Tab>
</Tabs>

## Notes

<Warning>
  Run Claude Code CLI in a dedicated project folder. Avoid running it in sensitive directories (such as system folders or directories containing credentials). Claude Code CLI operates starting from the current working directory.
</Warning>

<Tip>
  If you previously logged in with an official account, clear the `ANTHROPIC_AUTH_TOKEN` environment variable or override it in `settings.json`.
</Tip>
