@brightdata/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/README.md +624 -0
  2. package/dist/__tests__/commands/budget.test.d.ts +2 -0
  3. package/dist/__tests__/commands/budget.test.d.ts.map +1 -0
  4. package/dist/__tests__/commands/budget.test.js +199 -0
  5. package/dist/__tests__/commands/budget.test.js.map +1 -0
  6. package/dist/__tests__/commands/dataset.test.d.ts +2 -0
  7. package/dist/__tests__/commands/dataset.test.d.ts.map +1 -0
  8. package/dist/__tests__/commands/dataset.test.js +22 -0
  9. package/dist/__tests__/commands/dataset.test.js.map +1 -0
  10. package/dist/__tests__/commands/login.test.d.ts +2 -0
  11. package/dist/__tests__/commands/login.test.d.ts.map +1 -0
  12. package/dist/__tests__/commands/login.test.js +123 -0
  13. package/dist/__tests__/commands/login.test.js.map +1 -0
  14. package/dist/__tests__/commands/scrape.test.d.ts +2 -0
  15. package/dist/__tests__/commands/scrape.test.d.ts.map +1 -0
  16. package/dist/__tests__/commands/scrape.test.js +73 -0
  17. package/dist/__tests__/commands/scrape.test.js.map +1 -0
  18. package/dist/__tests__/commands/search.test.d.ts +2 -0
  19. package/dist/__tests__/commands/search.test.d.ts.map +1 -0
  20. package/dist/__tests__/commands/search.test.js +95 -0
  21. package/dist/__tests__/commands/search.test.js.map +1 -0
  22. package/dist/__tests__/commands/skill-add.test.d.ts +2 -0
  23. package/dist/__tests__/commands/skill-add.test.d.ts.map +1 -0
  24. package/dist/__tests__/commands/skill-add.test.js +177 -0
  25. package/dist/__tests__/commands/skill-add.test.js.map +1 -0
  26. package/dist/__tests__/commands/skill.test.d.ts +2 -0
  27. package/dist/__tests__/commands/skill.test.d.ts.map +1 -0
  28. package/dist/__tests__/commands/skill.test.js +58 -0
  29. package/dist/__tests__/commands/skill.test.js.map +1 -0
  30. package/dist/__tests__/commands/status.test.d.ts +2 -0
  31. package/dist/__tests__/commands/status.test.d.ts.map +1 -0
  32. package/dist/__tests__/commands/status.test.js +71 -0
  33. package/dist/__tests__/commands/status.test.js.map +1 -0
  34. package/dist/__tests__/commands/version.test.d.ts +2 -0
  35. package/dist/__tests__/commands/version.test.d.ts.map +1 -0
  36. package/dist/__tests__/commands/version.test.js +41 -0
  37. package/dist/__tests__/commands/version.test.js.map +1 -0
  38. package/dist/__tests__/utils/browser_auth.test.d.ts +2 -0
  39. package/dist/__tests__/utils/browser_auth.test.d.ts.map +1 -0
  40. package/dist/__tests__/utils/browser_auth.test.js +38 -0
  41. package/dist/__tests__/utils/browser_auth.test.js.map +1 -0
  42. package/dist/__tests__/utils/config.test.d.ts +2 -0
  43. package/dist/__tests__/utils/config.test.d.ts.map +1 -0
  44. package/dist/__tests__/utils/config.test.js +58 -0
  45. package/dist/__tests__/utils/config.test.js.map +1 -0
  46. package/dist/__tests__/utils/polling.test.d.ts +2 -0
  47. package/dist/__tests__/utils/polling.test.d.ts.map +1 -0
  48. package/dist/__tests__/utils/polling.test.js +65 -0
  49. package/dist/__tests__/utils/polling.test.js.map +1 -0
  50. package/dist/commands/budget.d.ts +15 -0
  51. package/dist/commands/budget.d.ts.map +1 -0
  52. package/dist/commands/budget.js +217 -0
  53. package/dist/commands/budget.js.map +1 -0
  54. package/dist/commands/config.d.ts +12 -0
  55. package/dist/commands/config.d.ts.map +1 -0
  56. package/dist/commands/config.js +60 -0
  57. package/dist/commands/config.js.map +1 -0
  58. package/dist/commands/dataset.d.ts +6 -0
  59. package/dist/commands/dataset.d.ts.map +1 -0
  60. package/dist/commands/dataset.js +250 -0
  61. package/dist/commands/dataset.js.map +1 -0
  62. package/dist/commands/init.d.ts +9 -0
  63. package/dist/commands/init.d.ts.map +1 -0
  64. package/dist/commands/init.js +247 -0
  65. package/dist/commands/init.js.map +1 -0
  66. package/dist/commands/login.d.ts +10 -0
  67. package/dist/commands/login.d.ts.map +1 -0
  68. package/dist/commands/login.js +98 -0
  69. package/dist/commands/login.js.map +1 -0
  70. package/dist/commands/logout.d.ts +5 -0
  71. package/dist/commands/logout.d.ts.map +1 -0
  72. package/dist/commands/logout.js +20 -0
  73. package/dist/commands/logout.js.map +1 -0
  74. package/dist/commands/scrape.d.ts +6 -0
  75. package/dist/commands/scrape.d.ts.map +1 -0
  76. package/dist/commands/scrape.js +79 -0
  77. package/dist/commands/scrape.js.map +1 -0
  78. package/dist/commands/search.d.ts +6 -0
  79. package/dist/commands/search.d.ts.map +1 -0
  80. package/dist/commands/search.js +179 -0
  81. package/dist/commands/search.js.map +1 -0
  82. package/dist/commands/skill-add.d.ts +3 -0
  83. package/dist/commands/skill-add.d.ts.map +1 -0
  84. package/dist/commands/skill-add.js +285 -0
  85. package/dist/commands/skill-add.js.map +1 -0
  86. package/dist/commands/skill.d.ts +5 -0
  87. package/dist/commands/skill.d.ts.map +1 -0
  88. package/dist/commands/skill.js +31 -0
  89. package/dist/commands/skill.js.map +1 -0
  90. package/dist/commands/status.d.ts +14 -0
  91. package/dist/commands/status.d.ts.map +1 -0
  92. package/dist/commands/status.js +99 -0
  93. package/dist/commands/status.js.map +1 -0
  94. package/dist/commands/version.d.ts +18 -0
  95. package/dist/commands/version.d.ts.map +1 -0
  96. package/dist/commands/version.js +35 -0
  97. package/dist/commands/version.js.map +1 -0
  98. package/dist/commands/zones.d.ts +13 -0
  99. package/dist/commands/zones.d.ts.map +1 -0
  100. package/dist/commands/zones.js +70 -0
  101. package/dist/commands/zones.js.map +1 -0
  102. package/dist/index.d.ts +3 -0
  103. package/dist/index.d.ts.map +1 -0
  104. package/dist/index.js +42 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/types/dataset.d.ts +19 -0
  107. package/dist/types/dataset.d.ts.map +1 -0
  108. package/dist/types/dataset.js +3 -0
  109. package/dist/types/dataset.js.map +1 -0
  110. package/dist/types/scrape.d.ts +31 -0
  111. package/dist/types/scrape.d.ts.map +1 -0
  112. package/dist/types/scrape.js +3 -0
  113. package/dist/types/scrape.js.map +1 -0
  114. package/dist/types/search.d.ts +47 -0
  115. package/dist/types/search.d.ts.map +1 -0
  116. package/dist/types/search.js +3 -0
  117. package/dist/types/search.js.map +1 -0
  118. package/dist/utils/auth.d.ts +6 -0
  119. package/dist/utils/auth.d.ts.map +1 -0
  120. package/dist/utils/auth.js +44 -0
  121. package/dist/utils/auth.js.map +1 -0
  122. package/dist/utils/auth_pages.d.ts +3 -0
  123. package/dist/utils/auth_pages.d.ts.map +1 -0
  124. package/dist/utils/auth_pages.js +316 -0
  125. package/dist/utils/auth_pages.js.map +1 -0
  126. package/dist/utils/browser_auth.d.ts +21 -0
  127. package/dist/utils/browser_auth.d.ts.map +1 -0
  128. package/dist/utils/browser_auth.js +290 -0
  129. package/dist/utils/browser_auth.js.map +1 -0
  130. package/dist/utils/client.d.ts +17 -0
  131. package/dist/utils/client.d.ts.map +1 -0
  132. package/dist/utils/client.js +95 -0
  133. package/dist/utils/client.js.map +1 -0
  134. package/dist/utils/config.d.ts +16 -0
  135. package/dist/utils/config.d.ts.map +1 -0
  136. package/dist/utils/config.js +65 -0
  137. package/dist/utils/config.js.map +1 -0
  138. package/dist/utils/credentials.d.ts +11 -0
  139. package/dist/utils/credentials.d.ts.map +1 -0
  140. package/dist/utils/credentials.js +52 -0
  141. package/dist/utils/credentials.js.map +1 -0
  142. package/dist/utils/output.d.ts +23 -0
  143. package/dist/utils/output.d.ts.map +1 -0
  144. package/dist/utils/output.js +89 -0
  145. package/dist/utils/output.js.map +1 -0
  146. package/dist/utils/polling.d.ts +26 -0
  147. package/dist/utils/polling.d.ts.map +1 -0
  148. package/dist/utils/polling.js +46 -0
  149. package/dist/utils/polling.js.map +1 -0
  150. package/dist/utils/skill-installer/agents.d.ts +19 -0
  151. package/dist/utils/skill-installer/agents.d.ts.map +1 -0
  152. package/dist/utils/skill-installer/agents.js +345 -0
  153. package/dist/utils/skill-installer/agents.js.map +1 -0
  154. package/dist/utils/skill-installer/brightdata-skills.d.ts +11 -0
  155. package/dist/utils/skill-installer/brightdata-skills.d.ts.map +1 -0
  156. package/dist/utils/skill-installer/brightdata-skills.js +52 -0
  157. package/dist/utils/skill-installer/brightdata-skills.js.map +1 -0
  158. package/dist/utils/skill-installer/installer.d.ts +34 -0
  159. package/dist/utils/skill-installer/installer.d.ts.map +1 -0
  160. package/dist/utils/skill-installer/installer.js +240 -0
  161. package/dist/utils/skill-installer/installer.js.map +1 -0
  162. package/dist/utils/skill-installer/prompts/search-multiselect.d.ts +22 -0
  163. package/dist/utils/skill-installer/prompts/search-multiselect.d.ts.map +1 -0
  164. package/dist/utils/skill-installer/prompts/search-multiselect.js +251 -0
  165. package/dist/utils/skill-installer/prompts/search-multiselect.js.map +1 -0
  166. package/dist/utils/spinner.d.ts +7 -0
  167. package/dist/utils/spinner.d.ts.map +1 -0
  168. package/dist/utils/spinner.js +27 -0
  169. package/dist/utils/spinner.js.map +1 -0
  170. package/package.json +65 -0
package/README.md ADDED
@@ -0,0 +1,624 @@
1
+ <p align="center">
2
+ <img src="assets/banner.gif" alt="brightdata CLI demo" width="800" />
3
+ </p>
4
+
5
+ <h1 align="center">Bright Data CLI</h1>
6
+
7
+ <p align="center">
8
+ Scrape, search, and extract structured web data — directly from your terminal.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/brightdata-cli"><img src="https://img.shields.io/npm/v/brightdata-cli?color=black&label=npm" alt="npm version" /></a>
13
+ <a href="https://www.npmjs.com/package/brightdata-cli"><img src="https://img.shields.io/npm/dm/brightdata-cli?color=black&label=downloads" alt="downloads" /></a>
14
+ <img src="https://img.shields.io/badge/node-%3E%3D18-black" alt="node requirement" />
15
+ <img src="https://img.shields.io/badge/license-ISC-black" alt="license" />
16
+ </p>
17
+
18
+ ---
19
+
20
+ ## Overview
21
+
22
+ `brightdata-cli` is the official command-line interface for [Bright Data](https://brightdata.com). One command to access the full Bright Data API surface:
23
+
24
+ | Command | What it does |
25
+ |---|---|
26
+ | `brightdata scrape` | Scrape any URL — bypasses CAPTCHAs, JS rendering, anti-bot protections |
27
+ | `brightdata search` | Google / Bing / Yandex search with structured JSON output |
28
+ | `brightdata pipelines` | Extract structured data from 40+ platforms (Amazon, LinkedIn, TikTok…) |
29
+ | `brightdata zones` | List and inspect your Bright Data proxy zones |
30
+ | `brightdata budget` | View account balance and per-zone cost & bandwidth |
31
+ | `brightdata skill` | Install Bright Data AI agent skills into your coding agent |
32
+ | `brightdata config` | Manage CLI configuration |
33
+ | `brightdata init` | Interactive setup wizard |
34
+
35
+ ---
36
+
37
+ ## Table of Contents
38
+
39
+ - [Installation](#installation)
40
+ - [Quick Start](#quick-start)
41
+ - [Authentication](#authentication)
42
+ - [Commands](#commands)
43
+ - [init](#init)
44
+ - [scrape](#scrape)
45
+ - [search](#search)
46
+ - [pipelines](#pipelines)
47
+ - [status](#status)
48
+ - [zones](#zones)
49
+ - [budget](#budget)
50
+ - [skill](#skill)
51
+ - [config](#config)
52
+ - [login / logout](#login--logout)
53
+ - [Configuration](#configuration)
54
+ - [Environment Variables](#environment-variables)
55
+ - [Output Modes](#output-modes)
56
+ - [Pipe-Friendly Usage](#pipe-friendly-usage)
57
+ - [Dataset Types Reference](#dataset-types-reference)
58
+ - [Troubleshooting](#troubleshooting)
59
+
60
+ ---
61
+
62
+ ## Installation
63
+
64
+ ```bash
65
+ npm install -g brightdata-cli
66
+ ```
67
+
68
+ Or run without installing:
69
+
70
+ ```bash
71
+ npx brightdata-cli <command>
72
+ ```
73
+
74
+ > **Requires Node.js ≥ 18.0.0**
75
+
76
+ ---
77
+
78
+ ## Quick Start
79
+
80
+ ```bash
81
+ # 1. Run the interactive setup wizard
82
+ brightdata init
83
+
84
+ # 2. Scrape a page as markdown
85
+ brightdata scrape https://example.com
86
+
87
+ # 3. Search Google
88
+ brightdata search "web scraping best practices"
89
+
90
+ # 4. Extract a LinkedIn profile
91
+ brightdata pipelines linkedin_person_profile "https://linkedin.com/in/username"
92
+
93
+ # 5. Check your account balance
94
+ brightdata budget
95
+ ```
96
+
97
+ ---
98
+
99
+ ## Authentication
100
+
101
+ Get your API key from [brightdata.com/cp/setting/users](https://brightdata.com/cp/setting/users).
102
+
103
+ ```bash
104
+ # Interactive — opens browser, saves key automatically
105
+ brightdata login
106
+
107
+ # Non-interactive — pass key directly
108
+ brightdata login --api-key <your-api-key>
109
+
110
+ # Environment variable — no login required
111
+ export BRIGHTDATA_API_KEY=your-api-key
112
+ ```
113
+
114
+ On first login the CLI checks for required zones (`cli_unlocker`, `cli_browser`) and creates them automatically if missing.
115
+
116
+ ```bash
117
+ # Clear saved credentials
118
+ brightdata logout
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Commands
124
+
125
+ ### `init`
126
+
127
+ Interactive setup wizard. The recommended way to get started.
128
+
129
+ ```bash
130
+ brightdata init
131
+ ```
132
+
133
+ Walks through: API key detection → zone selection → default output format → quick-start examples.
134
+
135
+ | Flag | Description |
136
+ |---|---|
137
+ | `--skip-auth` | Skip the authentication step |
138
+ | `-k, --api-key <key>` | Provide API key directly |
139
+
140
+ ---
141
+
142
+ ### `scrape`
143
+
144
+ Scrape any URL using Bright Data's Web Unlocker. Handles CAPTCHAs, JavaScript rendering, and anti-bot protections automatically.
145
+
146
+ ```bash
147
+ brightdata scrape <url> [options]
148
+ ```
149
+
150
+ | Flag | Description |
151
+ |---|---|
152
+ | `-f, --format <fmt>` | `markdown` · `html` · `screenshot` · `json` (default: `markdown`) |
153
+ | `--country <code>` | Geo-target by ISO country code (e.g. `us`, `de`, `jp`) |
154
+ | `--zone <name>` | Web Unlocker zone name |
155
+ | `--mobile` | Use a mobile user agent |
156
+ | `--async` | Submit async job, return a snapshot ID |
157
+ | `-o, --output <path>` | Write output to file |
158
+ | `--json` / `--pretty` | JSON output (raw / indented) |
159
+ | `-k, --api-key <key>` | Override API key |
160
+
161
+ **Examples**
162
+
163
+ ```bash
164
+ # Scrape as markdown (default)
165
+ brightdata scrape https://news.ycombinator.com
166
+
167
+ # Scrape as raw HTML
168
+ brightdata scrape https://example.com -f html
169
+
170
+ # US geo-targeting, save to file
171
+ brightdata scrape https://amazon.com -f json --country us -o product.json
172
+
173
+ # Pipe to a markdown viewer
174
+ brightdata scrape https://docs.github.com | glow -
175
+
176
+ # Async — returns a snapshot ID you can poll with `status`
177
+ brightdata scrape https://example.com --async
178
+ ```
179
+
180
+ ---
181
+
182
+ ### `search`
183
+
184
+ Search Google, Bing, or Yandex via Bright Data's SERP API. Google results include structured data (organic results, ads, people-also-ask, related searches).
185
+
186
+ ```bash
187
+ brightdata search <query> [options]
188
+ ```
189
+
190
+ | Flag | Description |
191
+ |---|---|
192
+ | `--engine <name>` | `google` · `bing` · `yandex` (default: `google`) |
193
+ | `--country <code>` | Localized results (e.g. `us`, `de`) |
194
+ | `--language <code>` | Language code (e.g. `en`, `fr`) |
195
+ | `--page <n>` | Page number, 0-indexed (default: `0`) |
196
+ | `--type <type>` | `web` · `news` · `images` · `shopping` (default: `web`) |
197
+ | `--device <type>` | `desktop` · `mobile` |
198
+ | `--zone <name>` | SERP zone name |
199
+ | `-o, --output <path>` | Write output to file |
200
+ | `--json` / `--pretty` | JSON output (raw / indented) |
201
+ | `-k, --api-key <key>` | Override API key |
202
+
203
+ **Examples**
204
+
205
+ ```bash
206
+ # Formatted table output (default)
207
+ brightdata search "typescript best practices"
208
+
209
+ # German localized results
210
+ brightdata search "restaurants berlin" --country de --language de
211
+
212
+ # News search
213
+ brightdata search "AI regulation" --type news
214
+
215
+ # Page 2 of results
216
+ brightdata search "web scraping" --page 1
217
+
218
+ # Extract just the URLs
219
+ brightdata search "open source scraping" --json | jq -r '.organic[].link'
220
+
221
+ # Search Bing
222
+ brightdata search "bright data pricing" --engine bing
223
+ ```
224
+
225
+ ---
226
+
227
+ ### `pipelines`
228
+
229
+ Extract structured data from 40+ platforms using Bright Data's Web Scraper API. Triggers an async collection job, polls until ready, and returns results.
230
+
231
+ ```bash
232
+ brightdata pipelines <type> [params...] [options]
233
+ ```
234
+
235
+ | Flag | Description |
236
+ |---|---|
237
+ | `--format <fmt>` | `json` · `csv` · `ndjson` · `jsonl` (default: `json`) |
238
+ | `--timeout <seconds>` | Polling timeout (default: `600`) |
239
+ | `-o, --output <path>` | Write output to file |
240
+ | `--json` / `--pretty` | JSON output (raw / indented) |
241
+ | `-k, --api-key <key>` | Override API key |
242
+
243
+ ```bash
244
+ # List all available dataset types
245
+ brightdata pipelines list
246
+ ```
247
+
248
+ **Examples**
249
+
250
+ ```bash
251
+ # LinkedIn profile
252
+ brightdata pipelines linkedin_person_profile "https://linkedin.com/in/username"
253
+
254
+ # Amazon product → CSV
255
+ brightdata pipelines amazon_product "https://amazon.com/dp/B09V3KXJPB" \
256
+ --format csv -o product.csv
257
+
258
+ # Instagram profile
259
+ brightdata pipelines instagram_profiles "https://instagram.com/username"
260
+
261
+ # Amazon search by keyword
262
+ brightdata pipelines amazon_product_search "laptop" "https://amazon.com"
263
+
264
+ # Google Maps reviews
265
+ brightdata pipelines google_maps_reviews "https://maps.google.com/..." 7
266
+
267
+ # YouTube comments (top 50)
268
+ brightdata pipelines youtube_comments "https://youtube.com/watch?v=..." 50
269
+ ```
270
+
271
+ See [Dataset Types Reference](#dataset-types-reference) for the full list.
272
+
273
+ ---
274
+
275
+ ### `status`
276
+
277
+ Check the status of an async snapshot job (returned by `--async` or `pipelines`).
278
+
279
+ ```bash
280
+ brightdata status <job-id> [options]
281
+ ```
282
+
283
+ | Flag | Description |
284
+ |---|---|
285
+ | `--wait` | Poll until the job completes |
286
+ | `--timeout <seconds>` | Polling timeout (default: `600`) |
287
+ | `-o, --output <path>` | Write output to file |
288
+ | `--json` / `--pretty` | JSON output (raw / indented) |
289
+ | `-k, --api-key <key>` | Override API key |
290
+
291
+ ```bash
292
+ # Check current status
293
+ brightdata status s_abc123xyz
294
+
295
+ # Block until complete
296
+ brightdata status s_abc123xyz --wait --pretty
297
+
298
+ # Custom timeout (5 minutes)
299
+ brightdata status s_abc123xyz --wait --timeout 300
300
+ ```
301
+
302
+ ---
303
+
304
+ ### `zones`
305
+
306
+ List and inspect your Bright Data proxy zones.
307
+
308
+ ```bash
309
+ brightdata zones # List all active zones
310
+ brightdata zones info <name> # Show full details for a zone
311
+ ```
312
+
313
+ ```bash
314
+ # Export all zones as JSON
315
+ brightdata zones --json -o zones.json
316
+
317
+ # Inspect a specific zone
318
+ brightdata zones info my_unlocker_zone --pretty
319
+ ```
320
+
321
+ ---
322
+
323
+ ### `budget`
324
+
325
+ View your account balance and per-zone cost and bandwidth usage. Read-only — no writes to the API.
326
+
327
+ ```bash
328
+ brightdata budget # Show account balance (quick view)
329
+ brightdata budget balance # Account balance + pending charges
330
+ brightdata budget zones # Cost & bandwidth table for all zones
331
+ brightdata budget zone <name> # Detailed cost & bandwidth for one zone
332
+ ```
333
+
334
+ | Flag | Description |
335
+ |---|---|
336
+ | `--from <datetime>` | Start of date range (e.g. `2024-01-01T00:00:00`) |
337
+ | `--to <datetime>` | End of date range |
338
+ | `--json` / `--pretty` | JSON output (raw / indented) |
339
+ | `-k, --api-key <key>` | Override API key |
340
+
341
+ ```bash
342
+ # Current account balance
343
+ brightdata budget
344
+
345
+ # Zone costs for January 2024
346
+ brightdata budget zones --from 2024-01-01T00:00:00 --to 2024-02-01T00:00:00
347
+
348
+ # Detailed view of a specific zone
349
+ brightdata budget zone my_unlocker_zone
350
+ ```
351
+
352
+ ---
353
+
354
+ ### `skill`
355
+
356
+ Install Bright Data AI agent skills into your coding agent (Claude Code, Cursor, Copilot, etc.). Skills provide your agent with context and instructions for using Bright Data APIs effectively.
357
+
358
+ ```bash
359
+ brightdata skill add # Interactive picker — choose skill + agent
360
+ brightdata skill add <name> # Install a specific skill directly
361
+ brightdata skill list # List all available Bright Data skills
362
+ ```
363
+
364
+ **Available skills**
365
+
366
+ | Skill | Description |
367
+ |---|---|
368
+ | `search` | Search Google and get structured JSON results |
369
+ | `scrape` | Scrape any webpage as clean markdown with bot bypass |
370
+ | `data-feeds` | Extract structured data from 40+ websites |
371
+ | `bright-data-mcp` | Orchestrate 60+ Bright Data MCP tools |
372
+ | `bright-data-best-practices` | Reference knowledge base for writing Bright Data code |
373
+
374
+ ```bash
375
+ # Interactive — select skills and choose which agents to install to
376
+ brightdata skill add
377
+
378
+ # Install the scrape skill directly
379
+ brightdata skill add scrape
380
+
381
+ # See what's available
382
+ brightdata skill list
383
+ ```
384
+
385
+ ---
386
+
387
+ ### `config`
388
+
389
+ View and manage CLI configuration.
390
+
391
+ ```bash
392
+ brightdata config # Show all config
393
+ brightdata config get <key> # Get a single value
394
+ brightdata config set <key> <value> # Set a value
395
+ ```
396
+
397
+ | Key | Description |
398
+ |---|---|
399
+ | `default_zone_unlocker` | Default zone for `scrape` and `search` |
400
+ | `default_zone_serp` | Default zone for `search` (overrides unlocker zone) |
401
+ | `default_format` | Default output format: `markdown` or `json` |
402
+ | `api_url` | Override the Bright Data API base URL |
403
+
404
+ ```bash
405
+ brightdata config set default_zone_unlocker my_zone
406
+ brightdata config set default_format json
407
+ ```
408
+
409
+ ---
410
+
411
+ ### `login` / `logout`
412
+
413
+ ```bash
414
+ brightdata login # Interactive login
415
+ brightdata login --api-key <key> # Non-interactive
416
+ brightdata logout # Clear saved credentials
417
+ ```
418
+
419
+ ---
420
+
421
+ ## Configuration
422
+
423
+ Config is stored in an OS-appropriate location:
424
+
425
+ | OS | Path |
426
+ |---|---|
427
+ | macOS | `~/Library/Application Support/brightdata-cli/` |
428
+ | Linux | `~/.config/brightdata-cli/` |
429
+ | Windows | `%APPDATA%\brightdata-cli\` |
430
+
431
+ Two files are stored:
432
+ - `credentials.json` — API key
433
+ - `config.json` — zones, output format, preferences
434
+
435
+ **Priority order** (highest → lowest):
436
+
437
+ ```
438
+ CLI flags → Environment variables → config.json → Defaults
439
+ ```
440
+
441
+ ---
442
+
443
+ ## Environment Variables
444
+
445
+ | Variable | Description |
446
+ |---|---|
447
+ | `BRIGHTDATA_API_KEY` | API key (overrides stored credentials) |
448
+ | `BRIGHTDATA_UNLOCKER_ZONE` | Default Web Unlocker zone |
449
+ | `BRIGHTDATA_SERP_ZONE` | Default SERP zone |
450
+ | `BRIGHTDATA_POLLING_TIMEOUT` | Default polling timeout in seconds |
451
+
452
+ ```bash
453
+ BRIGHTDATA_API_KEY=xxx BRIGHTDATA_UNLOCKER_ZONE=my_zone \
454
+ brightdata scrape https://example.com
455
+ ```
456
+
457
+ ---
458
+
459
+ ## Output Modes
460
+
461
+ Every command supports:
462
+
463
+ | Mode | Flag | Behavior |
464
+ |---|---|---|
465
+ | Human-readable | *(default)* | Formatted table or markdown, with colors |
466
+ | JSON | `--json` | Compact JSON to stdout |
467
+ | Pretty JSON | `--pretty` | Indented JSON to stdout |
468
+ | File | `-o <path>` | Write to file; format inferred from extension |
469
+
470
+ **Auto-detected file formats:**
471
+
472
+ | Extension | Format |
473
+ |---|---|
474
+ | `.json` | JSON |
475
+ | `.md` | Markdown |
476
+ | `.html` | HTML |
477
+ | `.csv` | CSV |
478
+
479
+ ---
480
+
481
+ ## Pipe-Friendly Usage
482
+
483
+ When stdout is not a TTY, colors and spinners are automatically disabled. Errors go to `stderr`, data to `stdout`.
484
+
485
+ ```bash
486
+ # Extract URLs from search results
487
+ brightdata search "nodejs tutorials" --json | jq -r '.organic[].link'
488
+
489
+ # Scrape and view with a markdown reader
490
+ brightdata scrape https://docs.github.com | glow -
491
+
492
+ # Save scraped content to a file
493
+ brightdata scrape https://example.com -f markdown > page.md
494
+
495
+ # Amazon product data as CSV
496
+ brightdata pipelines amazon_product "https://amazon.com/dp/xxx" --format csv > product.csv
497
+
498
+ # Chain search → scrape
499
+ brightdata search "top open source projects" --json \
500
+ | jq -r '.organic[0].link' \
501
+ | xargs brightdata scrape
502
+ ```
503
+
504
+ ---
505
+
506
+ ## Dataset Types Reference
507
+
508
+ ```bash
509
+ brightdata pipelines list # See all types in your terminal
510
+ ```
511
+
512
+ ### E-Commerce
513
+
514
+ | Type | Platform |
515
+ |---|---|
516
+ | `amazon_product` | Amazon product page |
517
+ | `amazon_product_reviews` | Amazon reviews |
518
+ | `amazon_product_search` | Amazon search results |
519
+ | `walmart_product` | Walmart product page |
520
+ | `walmart_seller` | Walmart seller profile |
521
+ | `ebay_product` | eBay listing |
522
+ | `bestbuy_products` | Best Buy |
523
+ | `etsy_products` | Etsy |
524
+ | `homedepot_products` | Home Depot |
525
+ | `zara_products` | Zara |
526
+ | `google_shopping` | Google Shopping |
527
+
528
+ ### Professional Networks
529
+
530
+ | Type | Platform |
531
+ |---|---|
532
+ | `linkedin_person_profile` | LinkedIn person |
533
+ | `linkedin_company_profile` | LinkedIn company |
534
+ | `linkedin_job_listings` | LinkedIn jobs |
535
+ | `linkedin_posts` | LinkedIn posts |
536
+ | `linkedin_people_search` | LinkedIn people search |
537
+ | `crunchbase_company` | Crunchbase |
538
+ | `zoominfo_company_profile` | ZoomInfo |
539
+
540
+ ### Social Media
541
+
542
+ | Type | Platform |
543
+ |---|---|
544
+ | `instagram_profiles` | Instagram profiles |
545
+ | `instagram_posts` | Instagram posts |
546
+ | `instagram_reels` | Instagram reels |
547
+ | `instagram_comments` | Instagram comments |
548
+ | `facebook_posts` | Facebook posts |
549
+ | `facebook_marketplace_listings` | Facebook Marketplace |
550
+ | `facebook_company_reviews` | Facebook reviews |
551
+ | `facebook_events` | Facebook events |
552
+ | `tiktok_profiles` | TikTok profiles |
553
+ | `tiktok_posts` | TikTok posts |
554
+ | `tiktok_shop` | TikTok shop |
555
+ | `tiktok_comments` | TikTok comments |
556
+ | `x_posts` | X (Twitter) posts |
557
+ | `youtube_profiles` | YouTube channels |
558
+ | `youtube_videos` | YouTube videos |
559
+ | `youtube_comments` | YouTube comments |
560
+ | `reddit_posts` | Reddit posts |
561
+
562
+ ### Other
563
+
564
+ | Type | Platform |
565
+ |---|---|
566
+ | `google_maps_reviews` | Google Maps reviews |
567
+ | `google_play_store` | Google Play |
568
+ | `apple_app_store` | Apple App Store |
569
+ | `reuter_news` | Reuters news |
570
+ | `github_repository_file` | GitHub repository files |
571
+ | `yahoo_finance_business` | Yahoo Finance |
572
+ | `zillow_properties_listing` | Zillow |
573
+ | `booking_hotel_listings` | Booking.com |
574
+
575
+ ---
576
+
577
+ ## Troubleshooting
578
+
579
+ **`Error: No Web Unlocker zone specified`**
580
+ ```bash
581
+ brightdata config set default_zone_unlocker <your-zone-name>
582
+ # or
583
+ export BRIGHTDATA_UNLOCKER_ZONE=<your-zone-name>
584
+ ```
585
+
586
+ **`Error: Invalid or expired API key`**
587
+ ```bash
588
+ brightdata login
589
+ ```
590
+
591
+ **`Error: Access denied`**
592
+
593
+ Check zone permissions in the [Bright Data control panel](https://brightdata.com/cp).
594
+
595
+ **`Error: Rate limit exceeded`**
596
+
597
+ Wait a moment and retry. Use `--async` for large jobs to avoid timeouts.
598
+
599
+ **Async job is too slow**
600
+ ```bash
601
+ brightdata pipelines amazon_product <url> --timeout 1200
602
+ # or
603
+ export BRIGHTDATA_POLLING_TIMEOUT=1200
604
+ ```
605
+
606
+ **Garbled output in non-interactive terminal**
607
+
608
+ Colors and spinners are disabled automatically when not in a TTY. If you still see ANSI codes, add `| cat` at the end of your command.
609
+
610
+ ---
611
+
612
+ ## Links
613
+
614
+ - [Bright Data Website](https://brightdata.com)
615
+ - [Control Panel](https://brightdata.com/cp)
616
+ - [API Key Settings](https://brightdata.com/cp/setting/users)
617
+ - [API Reference](https://docs.brightdata.com/api-reference)
618
+ - [Report an Issue](https://github.com/brightdata/brightdata-cli/issues)
619
+
620
+ ---
621
+
622
+ <p align="center">
623
+ <sub>© Bright Data · ISC License</sub>
624
+ </p>
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=budget.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"budget.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/commands/budget.test.ts"],"names":[],"mappings":""}