Introduction
Authentication
CLI Login
Enter the Basilica:
basilica loginOpens a browser. Sign in. You're in.
If Browser Callback Fails
If the browser callback doesn't work (common in remote environments or WSL), use the device code flow:
basilica login --device-codeThis displays a code and URL. Open the URL in any browser, enter the code, and you're authenticated.
Programmatic Access
For SDK usage, CI/CD pipelines, or automation, create an API token.
Generate a Token
First, ensure you're logged in:
basilica loginThen create an API token:
basilica tokens createCopy the token immediately. It won't be shown again.
Use the Token
With the SDK:
from basilica import BasilicaClient
client = BasilicaClient(api_key="your_token")With an environment variable:
export BASILICA_API_TOKEN=your_tokenThe SDK and CLI automatically use BASILICA_API_TOKEN when set:
from basilica import BasilicaClient
# Automatically uses BASILICA_API_TOKEN
client = BasilicaClient()Authentication Priority
When multiple auth methods are configured, Basilica uses this order:
api_keyparameter passed toBasilicaClient()BASILICA_API_TOKENenvironment variable- Stored credentials from
basilica login
Revoke a Token
basilica tokens revoke <token-name>Takes effect immediately. No grace period.
Next Steps
- Getting Started: Deploy your first application
- Python SDK: Learn the full SDK API
- CLI Reference: Complete CLI documentation