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

# Claude CLI installation

> Install Claude Code CLI

Claude Code CLI requires Node.js and npm. After installation, run `claude` at least once so Claude Code creates its configuration files in your user directory.

## 1. Check Node.js

Run the following commands in Windows Terminal, macOS Terminal, or a Linux shell:

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

If version numbers appear, Node.js and npm are installed.

You can also check globally installed npm packages:

```bash theme={null}
npm list -g --depth=0
```

If the terminal shows `command not found`, or cannot display version numbers, install Node.js first. You can refer to the [Node.js installation guide](https://www.runoob.com/nodejs/nodejs-install-setup.html), then run the checks again.

<Tip>
  We recommend installing the Node.js LTS version. After installation, reopen your terminal and run `node --version` and `npm --version`.
</Tip>

## 2. Install Claude Code CLI

After Node.js is available, install Claude Code globally:

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

Check the installed version:

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

If a version number appears, the CLI is installed.

## 3. Initialize Claude Code

Run Claude Code once after installation:

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

This step is important. Claude Code creates its configuration directory and files in your user directory. These files are needed later when configuring the DUIAPI base URL, model, and API key.

If an interactive screen opens, or you see login, model, or configuration prompts, Claude Code started successfully.

<img src="https://mintcdn.com/duiapi/v5s4WtHrXMbWmd21/images/claude-cli-started.svg?fit=max&auto=format&n=v5s4WtHrXMbWmd21&q=85&s=901d28d0b48573bc1562ed660d17b650" alt="Claude Code started successfully" width="980" height="520" data-path="images/claude-cli-started.svg" />
