Install the CLI
Authenticate
Run the login command to connect your Bright Data account:- Validates and stores your API key locally
- Auto-creates required proxy zones (
cli_unlocker,cli_browser) - Sets sensible defaults so you can start immediately
You only need to log in once. All subsequent commands authenticate automatically.
Alternative authentication methods
Headless / SSH environments
Headless / SSH environments
When no browser is available, use the device flow:This prints a URL and a code. Open the URL on any device, enter the code, and the CLI completes authentication.
Direct API key
Direct API key
For CI/CD pipelines or non-interactive environments, pass your API key directly:You can find your API key in the Bright Data control panel.
Environment variable
Environment variable
Set the This is useful for Docker containers, GitHub Actions, and other automated environments.
BRIGHTDATA_API_KEY environment variable to skip login entirely:Interactive setup wizard
For a guided first-time experience, use the init command:| Flag | Description |
|---|---|
--skip-auth | Skip the authentication step (if already logged in) |
-k, --api-key <key> | Provide API key directly |
Verify your setup
After logging in, confirm everything is working:Configuration storage
The CLI stores credentials and configuration locally:| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/brightdata-cli/ |
| Linux | ~/.config/brightdata-cli/ |
| Windows | %APPDATA%\brightdata-cli\ |
| File | Purpose | Permissions |
|---|---|---|
credentials.json | API key | 0o600 (owner-only) |
config.json | Zones, output format, preferences | Standard |
Next steps
Commands
Explore the full command reference.
Usage Examples
Jump into real-world workflows and recipes.