Install the CLI
The fastest way to run the Bright Data CLI isnpx, which executes the latest version with no global install:
npx -p @brightdata/cli to run it the same way, with no global dependency to maintain. The Bright Data CLI requires Node.js 20 or later.
For a persistent brightdata command and faster startup, install the CLI globally instead:
Update the CLI
Upgrade to the latest version with the same package manager you installed with: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:Where configuration is stored
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.