Skip to main content

locopilot login

Authenticate with LocoPilot Cloud (enables Pro tier).

Source: src/cli/commands/login.ts

Synopsis

locopilot login [--key <token>]
FlagDefaultDescription
--key <token>(interactive prompt)API key starting with qs_

If --key is omitted, the CLI prompts for your token using a hidden password input.

What it does

  1. Validates the token format — must start with qs_ and be at least 20 characters.
  2. Calls GET /api/auth/verify on LocoPilot Cloud. A 200 confirms the token; a 401 aborts. Other errors (timeouts, DNS failures) print a warning and save the token anyway — it'll be re-validated on first use.
  3. Calls GET /api/auth/me to fetch the subscription state and prints a tailored message:
Plan returnedPrinted line
pro_active✔ Logged in (Pro — active until <date>)
pro_past_due✔ Logged in (Pro — past due, update billing at https://locopilot.com/dashboard)
pro_canceled / pro_inactive✔ Logged in (subscription <state> — re-subscribe at https://locopilot.com/pricing)
free✔ Logged in (Free — upgrade at https://locopilot.com/pricing for cloud features)
  1. Writes the token to ~/.locopilot/config.json with mode: 0o600 so only you can read it. Existing fields (like a cached tunnel URL) are preserved.

Where to get a token

Sign in at locopilot.com/dashboard and click Create API key. Tokens are shown once — save it immediately.

LocoPilot Login

Get your API key at https://locopilot.com/dashboard

? Enter your LocoPilot API key (qs_...) ********

Verifying token...

✔ Logged in (Pro — active until 6/9/2026)

Token stored at: ~/.locopilot/config.json
Run `locopilot logout` to remove it.

Tier semantics

The local CLI never caches subscription state. Every Pro-gated call re-fetches /api/auth/me from the cloud, so a cancelled subscription is enforced immediately.

Errors

ErrorCause
Invalid token format — must start with qs_Wrong format — copy/paste the entire qs_… string
Token too short — check for copy/paste errors.Token is < 20 characters
Invalid API key — authentication failed.The cloud returned 401 — token is wrong or revoked
Warning: could not reach LocoPilot Cloud — saving token offline.Network issue — the token is saved and validated lazily