Usage
Arguments
| Name | Required | Description |
|---|---|---|
api-key | No | API key starting with phak_. If omitted, triggers device flow authentication |
Options
| Flag | Short | Default | Description |
|---|---|---|---|
--manual | false | Enter API key manually instead of device flow | |
--no-open | false | Skip automatic browser launch during device flow | |
--profile <name> | workspace slug | Save credentials to named profile | |
--print-token | false | Print token to stdout without saving | |
--url <url> | https://cloud.phala.com | Custom API endpoint URL |
Authentication Methods
Device Flow (Recommended)
The simplest method. Opens a browser for authentication:Direct API Key
Provide your API key directly:Manual Entry
Enter API key interactively:Environment Variable
Use API key without persisting:Profiles
Save credentials to different profiles for multiple workspaces:Examples
Basic device flow authentication
Direct API key login
Save to named profile
Print token without saving
Use environment variable (temporary)
Security Notes
- API keys are stored in
~/.phala-cloud/profiles/<profile>.json - File permissions are set to 600 (owner read/write only)
- Never commit API keys to version control
- Use environment variables for CI/CD environments

