Skip to main content

skl login

Request a device code, wait for approval in the browser, and store the device token.

Synopsis​

skl login
skl login --dev-user <user_id>

Flags​

  • --dev-user <user_id>. Store Authorization: Bearer dev:<user_id> without a device poll. The API accepts this token only when its ALLOW_DEV_AUTH setting is on, which is the default while CLERK_SECRET_KEY is empty. See Self-host the server.

Output​

To approve this device, open:
https://tryskl.fyi/device?user_code=ABCD-2345
And enter code: ABCD-2345

Waiting for approval (poll /v1/auth/device/token) ...
Logged in. Device token stored in local state

The device appears on the server as skl@<hostname>.

Commands that need the token read SKL_TOKEN, then SKL_TOKEN_FILE, then state.db. When none of those has a token, skl reads the keyring entry left by versions before 0.2 once and copies it into state.db.

What it writes​

  • The device token, as meta.device_token in state.db.
  • api_base in config.toml, set to the API origin this command used.
  • A background sync may run after login.

Errors​

  • device authorization expired; run skl login again. The code was not approved in time.
  • device authorization was denied. You denied the request in the browser.
  • cannot reach API at <url>.