---
title: CLI for API tokens
description: >-
  The Lightning Cloud CLI signs you in and gives you a JWT token to use with the
  API. Its command is harbor. Do everything else in the console or with the API.
canonical: 'https://lightning.ai/docs/platform/cluster/access/cli'
---
# CLI for API tokens {#cli-for-api-tokens}

The Lightning Cloud CLI signs you in and gives you a JWT token to use with the [API](/docs/platform/cluster/api-reference.md). Its command is `harbor`. Do everything else in the console or with the API.

> **Pre-release**
>
> The CLI is in pre-release. Its commands, flags and credential storage may change before version 1.0. If you can't use it, [contact support](/docs/platform/cluster/support.md) for API access.

## Install {#install}

Download the binary for your platform from the [latest release](https://github.com/voltagepark/harbor-cli/releases/latest).

**macOS (Apple Silicon)**

```bash
curl -fsSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-darwin-arm64 -o harbor && sudo install -m 755 harbor /usr/local/bin/harbor && rm harbor
```

**macOS (Intel)**

```bash
curl -fsSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-darwin-amd64 -o harbor && sudo install -m 755 harbor /usr/local/bin/harbor && rm harbor
```

**Linux (x86_64)**

```bash
curl -fsSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-linux-amd64 -o harbor && sudo install -m 755 harbor /usr/local/bin/harbor && rm harbor
```

**Linux (ARM64)**

```bash
curl -fsSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-linux-arm64 -o harbor && sudo install -m 755 harbor /usr/local/bin/harbor && rm harbor
```

**Windows (PowerShell)**

```powershell
curl.exe -sSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-windows-amd64.exe -o harbor.exe
# ARM64: harbor-windows-arm64.exe
```

Check the install:

```bash
harbor version
```

## Sign in and get a token {#sign-in-and-get-a-token}

| Command | What it does |
|---------|--------------|
| `harbor auth login` | Signs you in through your browser. Uses `sea1` unless you add `--region`. |
| `harbor auth status` | Shows who you're signed in as, your organization, and when the token expires. |
| `harbor auth token` | Prints a valid access token for API calls. |
| `harbor auth logout` | Signs you out and removes the cached token. |

```bash
harbor auth login
export API_URL=https://api.sea1.voltagepark.com
export TOKEN=$(harbor auth token --region sea1)

curl "$API_URL/v1/fleets" -H "Authorization: Bearer $TOKEN"
```

## Regions {#regions}

Tokens only work in the region they were issued for. Each command picks its region separately, and signing in to a region doesn't make it the default. Add the same `--region` to both `login` and `token`, and call that region's endpoint:

```bash
harbor auth login --region iad1
export API_URL=https://api.iad1.voltagepark.com
export TOKEN=$(harbor auth token --region iad1)
```

See [Regions & endpoints](/docs/platform/cluster/get-started/regions.md).

## Token caching {#token-caching}

The CLI caches one token per region under `~/.harbor/` and refreshes it before it expires. Run `harbor auth token` again whenever you need a current token. For example, run it at the start of each script instead of storing the token.

See [Authentication](/docs/platform/cluster/access/authentication.md) for how tokens and principals work.

---

**Navigation**

- Parent: [Access & identity](/docs/platform/cluster/access.md)
