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

# Installation

> Install and configure the Swarm CLI.

# Installation

## Install from npm

```bash theme={null}
npm install -g @useswarm/cli
```

Or with other package managers:

```bash theme={null}
pnpm add -g @useswarm/cli
yarn global add @useswarm/cli
```

## Verify installation

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

## Authenticate

```bash theme={null}
swarm login
```

This opens your browser to authorize the CLI with your Swarm account. A device code is displayed in your terminal — confirm it matches in the browser, then click **Authorize CLI**.

Your credentials are stored locally at `~/.config/swarm/config.json` and persist across sessions.

### Custom API URL

If you're using a self-hosted or staging instance:

```bash theme={null}
swarm login --api-url https://your-instance.example.com/api
```

## Log out

```bash theme={null}
swarm logout
```

This removes stored credentials from your machine.

## Requirements

* **Node.js 18** or later
* A Swarm account on the **Pro plan** or higher
* For local testing with Cloudflare tunnels: `cloudflared` binary ([install guide](/guides/local-testing#tunnel-providers))
