Skip to Content
V1CLI Referencelore login

lore login

Authenticate with the Lore registry. By default (and with --org), this opens a browser on this machine using Authorization Code Flow with PKCE via a local loopback listener, going straight to the target identity provider connector — you never see a connector-picker screen. Use --device for the OAuth 2.0 Device Authorization Grant (RFC 8628) instead, which doesn’t require a browser on this machine but can’t skip the connector picker.

Usage

lore login [--registry <url>] [--org <slug>] [--device]

Description

Default (no --org, no --device): opens a browser on this machine directly at the identity provider’s login page. A short-lived local HTTP listener catches the redirect back, and the CLI exchanges the resulting code for a token.

--device: falls back to the Device Authorization Grant — prints a URL and code you can complete on any device with a browser (useful over SSH or in headless environments), and polls for authorization. This flow shows the identity provider’s full connector-picker screen if more than one is configured, since the Device Grant can’t hint which one to use.

Flags

FlagDescription
--registryRegistry URL (default: https://registry.lore.infraestrutura.app)
--orgOrg slug. Routes login through that org’s custom identity provider instead of the default connector. Cannot be combined with --device.
--deviceUse the Device Authorization Grant instead of the default local-browser flow. No browser required on this machine; shows the full connector picker. Cannot be combined with --org.

Examples

# Login to the default registry (opens a browser here) lore login # Login to a self-hosted registry lore login --registry https://registry.mycompany.com # Login through an org's custom identity provider (e.g. Microsoft Entra ID) lore login --org acme-corp # Login over SSH / in a headless environment (no local browser) lore login --device

--org requires the org to have a custom identity provider configured (Pro plan only). If the org has none, the CLI tells you so and suggests running lore login without --org.

--device and --org are mutually exclusive: the Device Authorization Grant has no way to hint which connector to use, so combining them would defeat the point of --org. The CLI rejects this combination before making any request.

Token Storage

The auth token is stored in ~/.config/lore/tokens.json, keyed by registry URL, with file permissions restricted to the current user (0600).

For CI environments, use the LORE_AUTH_TOKEN environment variable instead of lore login. Prefer a Service Account — created once from the panel, self-renewing, individually revocable. The static-token guide is the fallback if that panel feature isn’t available on your Registry.

Session lifetime and refresh

After lore login, the CLI renews your session silently. The sign-in token lasts 24 hours, and the CLI exchanges the saved refresh token for a new one when it expires. On the hosted Lore, the refresh token stays valid as long as you use Lore at least once every 90 days, for up to one year, after which you sign in again.

  • Refreshes are coordinated between Lore processes, so several terminals or AI tools starting at once renew the session only once.
  • If the identity provider rejects the session (revoked, or unused for 90 days), interactive commands ask Session expired. Sign in now? [Y/n] and, on yes, open the sign-in and continue. They never ask in CI (CI set), without a terminal, with LORE_NO_PROMPT=1, or when you pass --token / LORE_AUTH_TOKEN.
  • If the identity provider can’t be reached, the command says so and asks you to try again. It doesn’t ask you to sign in, because that wouldn’t help.
  • Governance hooks never refresh inline. They start the refresh in the background and use the cached context in the meantime.
lore auth status # account, expiry, and the last refresh lore auth refresh # refresh now (no browser); --force even if still valid
© 2025 Lore · Built by M1 Cloud