Buildspace
CLI

Authentication

Sign in and manage personal access tokens with the Buildspace CLI.

Login via Browser

Opens your default browser to complete a PKCE-based login flow. A personal access token (PAT) is saved to your local config after successful authentication.

buildspace auth login

Options

FlagDescription
--no-openPrint the login URL instead of opening the browser
--expires-days <n>Token expiry in days (default: 30, max: 3650)
--timeout <seconds>Max wait time for browser callback (default: 300)

Store a Token Manually

If you already have a PAT (e.g. for CI), store it directly:

buildspace auth set --token <your-pat>

Non-interactive auth for CI and agents

Set BUILDSPACE_TOKEN instead of running buildspace auth login. The env var takes priority over any saved config file, so no local state is required.

BUILDSPACE_TOKEN=bs_pat_xxx buildspace app list

Two additional env vars let you target self-hosted or local deployments:

Env varPurpose
BUILDSPACE_TOKENPersonal access token
BUILDSPACE_API_URLOverride the API base URL
BUILDSPACE_GIT_URLOverride the Git base URL

Generate a PAT in Creator Studio → Settings → Tokens, or use the Start with AI panel on the Projects page to generate one with a ready-to-paste agent command.

Check token status

buildspace auth status
buildspace auth status --json
buildspace whoami        # alias for auth status
buildspace whoami --json

Returns the configured token's access mode, restricted apps, name, and expiry. With --json:

{
  "authenticated": true,
  "authMethod": "pat",
  "apiUrl": "https://creator.buildspace.studio",
  "gitUrl": "https://api.buildspace.studio",
  "token": {
    "name": "AI Agent — 5/30/2026",
    "keyPrefix": "bs_pat_ab",
    "accessMode": "unrestricted",
    "apps": [],
    "expiresAt": "2026-08-28T00:00:00.000Z"
  }
}

Exit code 1 with { "authenticated": false, "code": "AUTH_REQUIRED" } when no valid token is found.

Show Current Token (masked)

buildspace auth show

Displays the configured token with the middle characters masked, plus the resolved API and Git URLs.

Clear Token

buildspace auth clear

Removes the stored token from your local config.

On this page