locopilot login
Authenticate with LocoPilot Cloud (enables Pro tier).
Source: src/cli/commands/login.ts
Synopsis
locopilot login [--key <token>]
| Flag | Default | Description |
|---|---|---|
--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
- Validates the token format — must start with
qs_and be at least 20 characters. - Calls
GET /api/auth/verifyon LocoPilot Cloud. A200confirms the token; a401aborts. Other errors (timeouts, DNS failures) print a warning and save the token anyway — it'll be re-validated on first use. - Calls
GET /api/auth/meto fetch the subscription state and prints a tailored message:
| Plan returned | Printed 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) |
- Writes the token to
~/.locopilot/config.jsonwithmode: 0o600so 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
| Error | Cause |
|---|---|
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 |