login
Login to the Spice.ai Platform, or other services with sub-commands.
Usage​
spice login [command] [flags]
Flags​
-h,--helpPrint this help message-k,--keystring API key (for spice.ai)-o,--outputstring Where to store the resulting credentials. One ofenv(default; appends to a local.envfile),json(prints the credentials as JSON to stdout), orkeychain(stores them in the platform keychain, e.g. macOS Keychain).
--output applies to spice login itself (the Spice.ai login, with or without --key). The provider subcommands below always write to .env.
Available Commands​
abfsLogin to a Azure Storage AccountdatabricksLogin to a Databricks instancedelta-lakeConfigure credentials to access a Delta Lake tabledremioLogin to a Dremio instancepostgresLogin to a Postgres instances3Login to an s3 storagesharepointLogin to a Microsoft 365 sharepoint accountsnowflakeLogin to a Snowflake warehousesparkLogin to a Spark Connect remote
Examples​
spice login
Additional Example​
spice login --key <API_KEY>
Browser Login Flow​
Running spice login without --key prints an auth code, opens the Spice.ai authorization page, and then polls the token exchange once per second while the browser flow is completed.
- The wait is bounded at 5 minutes. If the authorization is not completed in that window, the command exits with
Authentication timed out. Please try again.— followed by the last retryable error, when there was one. It does not poll indefinitely. - A refusal stops immediately. An explicitly denied authorization exits with
Access deniedwithout waiting out the deadline, as does a rejection the endpoint cannot answer differently on a retry (for example400,401,403, or410). - Transient failures keep polling. Server errors (
5xx),408,429, and network failures are retried until the deadline. So is404, which is the normal answer while the auth code has not been authorized yet — but an endpoint that answers404for the whole 5 minutes (typically aSPICE_BASE_URLpointing at the wrong deployment) stops at the deadline and says so.
spice cloud login subscription polls the same endpoint under the same 5-minute deadline.
Credentials Stay on Their Origin​
The auth code, device code, and access token in these flows are sent in the request body, which an HTTP 307 or 308 redirect replays verbatim to the redirect target. The CLI's credential-bearing HTTP clients therefore follow redirects only within the same origin (scheme, host, and port), and refuse any hop that leaves it rather than forwarding the credential to another host. This applies to the spice login flows, the Spice Cloud client, and the CLI's own runtime and Cloud Platform requests made with --api-key.
An off-origin redirect surfaces as the 3xx response itself rather than as a transport error, so a misconfigured endpoint stays diagnosable.
spice cloud login​
Authenticate with the Spice Cloud Platform. Running spice cloud login without a subcommand opens an interactive method chooser when stdin is a TTY. Non-interactive callers must specify a method explicitly.
Methods​
spice cloud login subscription​
Browser-based OAuth login flow. Automatically opens a browser for authentication.
spice cloud login subscription
Use --device to print the URL and one-time code without opening a browser (useful for SSH/headless environments):
spice cloud login subscription --device
spice cloud login pat​
Authenticate with a personal access token.
spice cloud login pat --token <TOKEN>
The token can also be provided via the SPICE_CLOUD_PAT environment variable:
export SPICE_CLOUD_PAT=<TOKEN>
spice cloud login pat
spice cloud login api​
Authenticate using OAuth2 client credentials for CI/automation workflows.
spice cloud login api --client-id <CLIENT_ID> --client-secret <CLIENT_SECRET>
Credentials can also be provided via environment variables:
export SPICE_CLOUD_CLIENT_ID=<CLIENT_ID>
export SPICE_CLOUD_CLIENT_SECRET=<CLIENT_SECRET>
spice cloud login api
Environment Variables​
| Variable | Used by | Description |
|---|---|---|
SPICE_CLOUD_PAT | login pat | Personal access token |
SPICE_CLOUD_CLIENT_ID | login api | OAuth2 client ID |
SPICE_CLOUD_CLIENT_SECRET | login api | OAuth2 client secret |
