Authentication
The CLI authenticates with a long-lived deplo token. You get one via a browser hand-off (the default), by pasting one from Settings, or from the DEPLO_TOKEN environment variable in CI. Provider credentials are never involved — they stay encrypted server-side.
Browser hand-off (default)#
deplo login gets a token without you ever seeing or copying it. The flow is deliberately boring and auditable:
The CLI opens a loopback listener
An HTTP listener starts on
127.0.0.1on a random port. It is bound to the loopback interface only — it is never reachable from the network.Your browser opens the authorization page
The CLI opens
https://www.deplo.in/cli-auth?port=…&state=…&host=…— the port of the listener, a random one-timestatenonce generated by the CLI, and your machine's hostname so the page can show which machine is asking.You explicitly authorize
Nothing happens automatically. The page shows the request and you click Authorize (signing in with GitHub first if needed). Only then is a CLI token created for your account.
The token travels only to 127.0.0.1
The page redirects to
127.0.0.1:<port>/callbackwith the token and the state nonce. The CLI rejects the response unless the nonce matches the one it generated and the token has thedpl_prefix — a response from anywhere else, or with the wrong nonce, is discarded.Verify and store
The CLI verifies the token against the API (
/auth/me) and writes it to~/.config/deplo/config.jsonwith file mode0600, then prints:text✓ signed in patrickdev · token saved to /Users/patrick/.config/deplo/config.json
The whole hand-off times out after five minutes with Timed out waiting for the browser (5 minutes). Try `deplo login --token` instead.
Pasting a token (headless machines)#
On SSH boxes, containers, or anywhere without a browser, create a token manually at deplo.in → Settings → CLI tokens and paste it:
$ deplo login --token
? Paste your deplo CLI token (dpl_…) › ********
✓ signed in patrickdev · token saved to /home/patrick/.config/deplo/config.jsonThe prompt is masked. You can also pass the token inline — deplo login --token dpl_… — but prefer the prompt so the token stays out of your shell history. A rejected token prints ✗ that token was not accepted — create a new one at deplo.in → Settings → CLI tokens and exits with code 1.
DEPLO_TOKEN for CI#
In pipelines, skip login entirely: set the DEPLO_TOKEN environment variable. It takes precedence over the config file, so nothing is written to disk. See CI Usage for a full GitHub Actions example.
Token properties#
| Property | Behavior |
|---|---|
| dpl_ prefix | All CLI tokens start with dpl_, so they are recognizable in configs and never confused with JWTs. |
| Shown once | The raw token is displayed exactly once at creation. Lose it and you create a new one. |
| Hashed server-side | Only a SHA-256 hash is stored on the platform — the raw token cannot be recovered from a breach. |
| Revocable | Delete any token at Settings → CLI tokens; it stops working immediately. |
| lastUsedAt | Each use stamps the token, so Settings shows you which tokens are actually active. |
Logout vs. revoke#
deplo logoutdeletes~/.config/deplo/config.json— the token is removed from this machine, but remains valid anywhere else it is stored.- Revoking at deplo.in → Settings → CLI tokens kills the token everywhere, instantly. Do both when decommissioning a machine; the CLI reminds you:
$ deplo logout
✓ signed out — token removed from this machine
revoke it fully at deplo.in → Settings → CLI tokensdeplo connect, validated, and stored AES-256-GCM encrypted server-side. If a token leaks, revoke it in Settings — lastUsedAt tells you if it was used.