---
title: Get access
sidebar:
  order: 2
description: "How accounts, dashboard sign-in, CLI tokens, and headless agent access relate to each other."
---

Access is per person, then reusable by that person's tools. The examples use `example.com` as the platform's deployment domain; use the one your admin gives you.

## Account creation

**The admin** creates your account in the dashboard (`Admin` → `Users` → `Create user`) with an email, a username and a temporary password. The username is a 3 to 32 character lowercase slug and becomes part of your project hostnames. The admin sends you those and the platform's domain.

## Signing in, once, with a browser

1. **Sign in to the dashboard**

    Visit `https://dashboard.example.com` and sign in with the email and password the admin gave you.

2. **Run the device-code login**

    ```sh npm
    npx sproutboat login --api-url https://control.example.com
    ```

    ```sh pnpm
    pnpm sproutboat login --api-url https://control.example.com
    ```

    ```sh bun
    bunx sproutboat login --api-url https://control.example.com
    ```

    ```sh yarn
    yarn sproutboat login --api-url https://control.example.com
    ```

    It prints a URL and a short code.

3. **Approve the device**

    Open the printed URL in the browser tab where you are signed in and approve it.

The CLI writes a long-lived token to `~/.config/sproutboat/credentials.json` under the endpoint URL. Every later command uses it. It keeps one credential per endpoint, so you can be signed in to several platforms; `sproutboat whoami` shows the active one and `sproutboat logout` forgets it.

## Headless and agent access

Copy the token out of `credentials.json` and pass it as an environment variable. No `login` call, no browser:

```sh npm
export SPROUTBOAT_API_URL=https://control.example.com
export SPROUTBOAT_TOKEN=sproutboat_...
npx sproutboat deploy
```

```sh pnpm
export SPROUTBOAT_API_URL=https://control.example.com
export SPROUTBOAT_TOKEN=sproutboat_...
pnpm sproutboat deploy
```

```sh bun
export SPROUTBOAT_API_URL=https://control.example.com
export SPROUTBOAT_TOKEN=sproutboat_...
bunx sproutboat deploy
```

```sh yarn
export SPROUTBOAT_API_URL=https://control.example.com
export SPROUTBOAT_TOKEN=sproutboat_...
yarn sproutboat deploy
```

:::note
Revoke tokens in the dashboard under `Settings` → `API tokens`. A CLI token cannot manage other credentials.
:::
