# Automatic CLI setup

> Automatically configure supported AI clients with the ScaleMax CLI, then verify authentication, models, streaming, and local configuration.

Install the published ScaleMax CLI globally for a reusable `scalemax` command. All client guides use this direct command, so repeated `npx` runs are unnecessary.

## Prerequisites

Use Node.js `18.19` or later with `npm` and `npx` available.

## Global install

**macOS / Linux**

```bash
npm install -g scalemax@latest
scalemax
```

**Windows PowerShell**

```powershell
npm.cmd install -g scalemax@latest
scalemax.cmd
```

Windows PowerShell blocks npm’s .ps1 launchers by default (“running scripts is disabled on this system”), so these commands use the .cmd launcher: npx.cmd, npm.cmd, scalemax.cmd. In Command Prompt you can leave out .cmd.

Future commands such as `scalemax doctor`, `scalemax models`, and `scalemax update` are then available directly. See [Updating the CLI](https://docs.scalemax.pro/docs/updating-cli) for moving an existing install to the latest published version, and [Removing configuration](https://docs.scalemax.pro/docs/removing-configuration) for undoing what the installer wrote.

## Optional one-time run

**macOS / Linux**

```bash
npx scalemax@latest
```

**Windows PowerShell**

```powershell
npx.cmd scalemax@latest
```

Windows PowerShell blocks npm’s .ps1 launchers by default (“running scripts is disabled on this system”), so these commands use the .cmd launcher: npx.cmd, npm.cmd, scalemax.cmd. In Command Prompt you can leave out .cmd.

Both forms run the same installer. `scalemax init` and `scalemax setup` are explicit aliases for the no-argument interactive installer.

## What the installer does

1. Prompts for a ScaleMax API key, or reads `SCALEMAX_API_KEY` in non-interactive environments.
2. Validates the key and determines its matching credit, token, or unified billing surface.
3. Reads the authenticated effective model catalog, including any server-side allowlists or additional family grants, and shows only compatible client targets.
4. Backs up existing client files and merges only ScaleMax-owned settings.
5. Offers `doctor` and client-specific verification after setup.

`scalemax doctor` sends a small billable streaming request. A configured client verifier may send an additional small billable request to confirm its protocol-specific route.

## Manual setup

You do not need the CLI for a direct configuration. Use the [manual client guides](https://docs.scalemax.pro/docs/manual-configuration), including the explicitly separate no-`npx` guides for [Claude Code](https://docs.scalemax.pro/docs/manual-configuration/claude-code) and [Codex](https://docs.scalemax.pro/docs/manual-configuration/codex).

## Keep the key private

> The CLI masks stored keys in its output. Do not paste a real key into a command you will share, a repository, a screenshot, or a support transcript.
