Documentation Index
Fetch the complete documentation index at: https://developer.lofty.com/llms.txt
Use this file to discover all available pages before exploring further.
lofty-cli supports four authentication methods. They are evaluated in priority order at every command invocation: the first one that yields a valid access token wins. Pick the method that fits how you are running the CLI.
| Method | Best for | Configured via |
|---|---|---|
| Token URL | CI/CD, automation with session ID | LOFTY_TOKEN_URL + LOFTY_SESSION_ID |
| Browser OAuth (PKCE) | Interactive developer use | lofty-cli auth login-browser |
| Client Credentials | Server-to-server | LOFTY_CLIENT_ID + LOFTY_CLIENT_SECRET + LOFTY_CUSTOMER_KEY |
| Direct Token | One-off testing, CI injection | LOFTY_ACCESS_TOKEN |
Tokens obtained by Token URL, Browser OAuth, and Client Credentials are cached locally and refreshed automatically when they expire.
Token URL (highest priority)
Token URL (highest priority)
Use this when an upstream system can mint a session ID and exchange it for tokens through a custom endpoint.You can also pass the values inline:Tokens are cached at
~/.config/tokens/lofty-session-cache.json and refreshed transparently.Browser OAuth (recommended for humans)
Browser OAuth (recommended for humans)
The simplest method for interactive use. The CLI launches your default browser, you log in once, and the token is stored locally.The flow uses OAuth 2.0 with PKCE — no client secret is needed on your machine.
OAuth client credentials
OAuth client credentials
Use this for server-to-server scenarios where there is no human to complete a browser flow. Implements the OAuth 2.0 Client Credentials Grant with an additional resource owner identifier.
Register an OAuth application
Sign in to the Lofty Developer Portal to create an application and obtain your
client_id and client_secret.Specify the target account
The customer key identifies which Lofty account’s data the CLI will access (the resource owner). Each Lofty user has a unique API key — find it in the Lofty CRM under Settings > Integrations > API.
Unlike a standard Client Credentials Grant where the client acts on its own behalf, Lofty requires
LOFTY_CUSTOMER_KEY to specify which account to access. The token is scoped to that account’s data and permissions.Direct access token
Direct access token
When another system has already obtained an access token (e.g. a CI job that ran No
auth login upstream), inject it directly:auth login* command is required; the token is used as-is.Verifying authentication
| Command | Purpose |
|---|---|
lofty-cli auth status | Show which method resolved and where credentials came from |
lofty-cli auth test | Make a real API call (typically GET /me) to confirm the token works |
lofty-cli auth show | Print the active customer key (masked by default) |
Logging out
Where credentials live on disk
| Path | Created by | Contents |
|---|---|---|
~/.config/lofty-cli/customer-key | auth set | Plain-text customer key (chmod 600) |
~/.config/tokens/lofty-session-cache.json | auth login-session | Token URL response |
~/.config/tokens/lofty-pkce-cache.json | auth login-browser | Browser OAuth tokens |
~/.config/tokens/lofty-oauth-cache.json | auth login | Client-credentials tokens |
Troubleshooting
Ifauth test fails, see Troubleshooting for the common causes (clock skew, expired refresh token, wrong customer key, missing scope).