~/.xpander/credentials. You can have multiple profiles for different organizations or environments (production, staging, …).
xpander login (alias l)
Authenticate via browser. Opens xpander.ai in your default browser, completes the OAuth flow, and writes credentials to the active profile.
| Flag | Description |
|---|---|
--profile <name> | Profile name to write credentials to. Defaults to the active profile (or default). |
--new | Create a new profile even if one already exists with this name. |
xpander configure (alias c)
Set up API credentials manually (for environments without a browser, or when you already have an API key).
| Flag | Description |
|---|---|
--key <api_key> | API key to store. If omitted, the wizard prompts. |
--org <organization_id> | Organization ID. Optional: auto-detected from the key if omitted. |
--profile <name> | Profile to write to. |
--no-validate | Skip credential validation against the cloud (useful when the API is unreachable but you know the key is good). |
- Stores your API key in the profile.
- Validates against xpander.ai (unless
--no-validate). - Auto-detects your organization ID.
- Writes both to
~/.xpander/credentials.
xpander profile
Manage profiles.
| Flag | Description |
|---|---|
--list | List all profiles. |
--set-default <name> | Set a profile as the default. |
--new [name] | Create a new profile. Without a name, runs an interactive wizard. |
--edit <name> | Edit an existing profile. |
--verify [name] | Verify a profile by hitting the API. Without a name, verifies the active profile. |
--profile <name> on any command to override the active profile for a single call:
xpander secrets-sync
Upload your local .env variables to deployed agents as runtime secrets.
| Flag | Description |
|---|---|
--profile <n> | Profile to use. |
.env in the current directory and uploads each KEY=value line to the deployed agent’s secret store. Existing secrets with the same key are overwritten.
Use this after xpander agent deploy whenever you change environment-dependent config without rebuilding the container: for example, rotating an external API key.
Auth priority
When multiple credential sources are present, the CLI resolves auth in this order:--api-keyon the command line.XPANDER_API_KEYenvironment variable.~/.xpander/credentials(the active profile).
Files and locations
| Path | Purpose |
|---|---|
~/.xpander/credentials | Per-profile credentials (API key, organization ID). |
.env (project root) | Local env vars. Read by xpander agent dev and uploaded by xpander agent deploy / secrets-sync. |

