stealth-cli 0.5.0 → 0.6.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.
- package/README.md +248 -145
- package/bin/stealth.js +6 -1
- package/package.json +1 -1
- package/src/browser.js +45 -54
- package/src/commands/batch.js +7 -5
- package/src/commands/browse.js +9 -7
- package/src/commands/crawl.js +14 -12
- package/src/commands/extract.js +30 -17
- package/src/commands/fingerprint.js +6 -5
- package/src/commands/interactive.js +4 -2
- package/src/commands/monitor.js +7 -5
- package/src/commands/pdf.js +7 -5
- package/src/commands/screenshot.js +10 -8
- package/src/commands/search.js +10 -19
- package/src/commands/serve.js +43 -24
- package/src/daemon.js +4 -37
- package/src/errors.js +21 -13
- package/src/mcp-server.js +27 -20
- package/src/profiles.js +5 -4
- package/src/proxy-pool.js +8 -10
- package/src/session.js +3 -3
- package/src/utils/browser-factory.js +86 -0
- package/src/utils/resolve-opts.js +83 -0
package/README.md
CHANGED
|
@@ -1,186 +1,256 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>🦊 stealth-cli</h1>
|
|
3
|
+
<p><strong>Anti-detection browser CLI powered by Camoufox</strong></p>
|
|
4
|
+
<p>Browse, search, scrape, and crawl the web with C++ level fingerprint spoofing.<br/>Bypasses Cloudflare, Google, and most bot detection systems.</p>
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://www.npmjs.com/package/stealth-cli"><img src="https://img.shields.io/npm/v/stealth-cli?color=blue" alt="npm version" /></a>
|
|
7
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License" /></a>
|
|
8
|
+
<a href="https://camoufox.com"><img src="https://img.shields.io/badge/engine-Camoufox-red" alt="Camoufox" /></a>
|
|
9
|
+
<img src="https://img.shields.io/badge/node-%3E%3D18-green" alt="Node" />
|
|
10
|
+
<img src="https://img.shields.io/badge/tests-151%20passing-brightgreen" alt="Tests" />
|
|
11
|
+
</p>
|
|
12
|
+
</div>
|
|
2
13
|
|
|
3
|
-
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Demo
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<img src="demo.gif" alt="stealth-cli demo" width="800" />
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
## Why
|
|
4
23
|
|
|
5
|
-
|
|
6
|
-
[](https://nodejs.org)
|
|
24
|
+
Headless Chrome gets fingerprinted. Playwright gets blocked. Stealth plugins become the fingerprint.
|
|
7
25
|
|
|
8
|
-
|
|
26
|
+
**stealth-cli** uses [Camoufox](https://camoufox.com) — a Firefox fork that patches fingerprint generation at the **C++ implementation level**. No JavaScript shims, no wrappers, no tells. The browser reports spoofed values natively.
|
|
9
27
|
|
|
10
|
-
|
|
11
|
-
- 🔍 **14 search engines** — Google, Bing, DuckDuckGo, YouTube, GitHub, and more
|
|
12
|
-
- 🕷️ **Recursive crawler** — Depth control, regex filters, delay, output to JSONL
|
|
13
|
-
- 📸 **Screenshots & PDF** — Full page, viewport, custom resolution
|
|
14
|
-
- 🧲 **Data extraction** — Links, images, meta, headings, CSS selectors
|
|
15
|
-
- 🎭 **Browser profiles** — Persistent fingerprint identities with cookie storage
|
|
16
|
-
- 🔄 **Proxy rotation** — Pool management with health checking
|
|
17
|
-
- 🤖 **Human simulation** — Bezier mouse curves, natural typing, scroll patterns
|
|
18
|
-
- 👻 **Daemon mode** — Background browser for instant command execution
|
|
19
|
-
- 🧩 **MCP server** — Plug into Claude Desktop, Cursor, and other AI agents
|
|
20
|
-
- 📦 **SDK mode** — Import as a library in your own Node.js projects
|
|
28
|
+
Wrap that in a developer-friendly CLI with 16 commands, and you get a tool that both humans and AI agents can use.
|
|
21
29
|
|
|
22
30
|
## Install
|
|
23
31
|
|
|
24
32
|
```bash
|
|
25
|
-
|
|
33
|
+
# From npm (recommended)
|
|
34
|
+
npm install -g stealth-cli
|
|
35
|
+
|
|
36
|
+
# From source
|
|
37
|
+
git clone https://github.com/user/stealth-cli.git
|
|
26
38
|
cd stealth-cli
|
|
27
39
|
npm install # Installs deps + downloads Camoufox browser (~300MB)
|
|
28
|
-
npm link # Makes 'stealth' command available
|
|
40
|
+
npm link # Makes 'stealth' command globally available
|
|
29
41
|
```
|
|
30
42
|
|
|
43
|
+
> First run downloads the Camoufox browser binary (~300MB). Subsequent runs are instant.
|
|
44
|
+
|
|
31
45
|
## Quick Start
|
|
32
46
|
|
|
33
47
|
```bash
|
|
34
|
-
# Browse a page
|
|
48
|
+
# Browse a page with anti-detection
|
|
35
49
|
stealth browse https://example.com
|
|
36
50
|
|
|
37
|
-
#
|
|
51
|
+
# Take a screenshot
|
|
38
52
|
stealth screenshot https://example.com -o page.png
|
|
39
53
|
|
|
40
|
-
# Search
|
|
54
|
+
# Search Google without getting blocked
|
|
41
55
|
stealth search google "best coffee beans" -f json
|
|
42
56
|
|
|
43
|
-
# Extract
|
|
44
|
-
stealth extract https://example.com --links
|
|
57
|
+
# Extract all links from a page
|
|
58
|
+
stealth extract https://example.com --links
|
|
45
59
|
|
|
46
60
|
# Crawl a site
|
|
47
61
|
stealth crawl https://example.com --depth 2 --limit 50 -o results.jsonl
|
|
48
62
|
|
|
49
|
-
# Interactive REPL
|
|
63
|
+
# Interactive browsing (REPL)
|
|
50
64
|
stealth interactive --url https://example.com
|
|
51
65
|
```
|
|
52
66
|
|
|
53
67
|
## Commands
|
|
54
68
|
|
|
55
|
-
### Core
|
|
69
|
+
### Core (11 commands)
|
|
56
70
|
|
|
57
71
|
| Command | Description |
|
|
58
72
|
|---------|-------------|
|
|
59
|
-
| `stealth browse <url>` | Visit URL, print page content |
|
|
60
|
-
| `stealth screenshot <url>` | Take a screenshot |
|
|
61
|
-
| `stealth
|
|
62
|
-
| `stealth
|
|
63
|
-
| `stealth
|
|
64
|
-
| `stealth
|
|
65
|
-
| `stealth
|
|
66
|
-
| `stealth batch <file>` | Batch process URLs from file |
|
|
67
|
-
| `stealth monitor <url>` |
|
|
68
|
-
| `stealth fingerprint` |
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
| `stealth browse <url>` | Visit URL, print page content (text/json/snapshot) |
|
|
74
|
+
| `stealth screenshot <url>` | Take a screenshot (PNG/JPEG, full page, custom size) |
|
|
75
|
+
| `stealth search <engine> <query>` | Search with anti-detection (14 engines) |
|
|
76
|
+
| `stealth extract <url>` | Extract links, images, meta, headings, CSS selectors |
|
|
77
|
+
| `stealth crawl <url>` | Recursive crawling with depth/filter/delay control |
|
|
78
|
+
| `stealth interactive` | Interactive REPL with 20+ browsing commands |
|
|
79
|
+
| `stealth pdf <url>` | Save page as PDF / full-page screenshot |
|
|
80
|
+
| `stealth batch <file>` | Batch process URLs from a file |
|
|
81
|
+
| `stealth monitor <url>` | Watch a page for changes (price drops, stock alerts) |
|
|
82
|
+
| `stealth fingerprint` | Check browser fingerprint & anti-detection status |
|
|
83
|
+
| `stealth serve` | Start HTTP API server for external integrations |
|
|
84
|
+
|
|
85
|
+
### Management (5 commands)
|
|
71
86
|
|
|
72
87
|
| Command | Description |
|
|
73
88
|
|---------|-------------|
|
|
74
|
-
| `stealth daemon start` |
|
|
75
|
-
| `stealth
|
|
76
|
-
| `stealth
|
|
77
|
-
| `stealth
|
|
78
|
-
| `stealth
|
|
79
|
-
| `stealth proxy add <url>` | Add proxy to pool |
|
|
80
|
-
| `stealth proxy list` | List proxies |
|
|
81
|
-
| `stealth proxy test` | Test proxy connectivity |
|
|
82
|
-
| `stealth config set <key> <val>` | Set default config |
|
|
83
|
-
| `stealth mcp` | Start MCP server for AI agents |
|
|
89
|
+
| `stealth daemon start/stop/status` | Background browser for instant startup (~1s vs ~6s) |
|
|
90
|
+
| `stealth profile create/list/delete` | Persistent browser identities (8 presets + random) |
|
|
91
|
+
| `stealth proxy add/list/test` | Proxy pool with rotation and health checking |
|
|
92
|
+
| `stealth config set/get/list/reset` | Global defaults (~/.stealth/config.json) |
|
|
93
|
+
| `stealth mcp` | MCP server for Claude Desktop / Cursor |
|
|
84
94
|
|
|
85
95
|
---
|
|
86
96
|
|
|
87
|
-
|
|
97
|
+
## Usage
|
|
98
|
+
|
|
99
|
+
### Browse
|
|
88
100
|
|
|
89
101
|
```bash
|
|
90
|
-
stealth browse https://example.com # Text
|
|
91
|
-
stealth browse https://example.com -f json # JSON
|
|
102
|
+
stealth browse https://example.com # Text output
|
|
103
|
+
stealth browse https://example.com -f json # JSON with metadata
|
|
92
104
|
stealth browse https://example.com -f snapshot # Accessibility tree
|
|
105
|
+
stealth browse https://example.com --humanize # Human behavior simulation
|
|
106
|
+
stealth browse https://example.com --profile us-desktop # Use saved identity
|
|
93
107
|
stealth browse https://example.com --proxy http://proxy:8080
|
|
94
|
-
stealth browse https://example.com --cookies cookies.txt
|
|
95
|
-
stealth browse https://example.com --profile us-desktop # Use saved profile
|
|
96
|
-
stealth browse https://example.com --humanize # Human behavior
|
|
97
108
|
```
|
|
98
109
|
|
|
99
|
-
###
|
|
110
|
+
### Screenshot
|
|
100
111
|
|
|
101
112
|
```bash
|
|
102
|
-
stealth screenshot https://example.com
|
|
103
|
-
stealth screenshot https://example.com
|
|
104
|
-
stealth screenshot https://example.com --full # Full page
|
|
113
|
+
stealth screenshot https://example.com -o page.png
|
|
114
|
+
stealth screenshot https://example.com --full # Full page
|
|
105
115
|
stealth screenshot https://example.com --width 1920 --height 1080
|
|
106
116
|
```
|
|
107
117
|
|
|
108
|
-
###
|
|
118
|
+
### Search
|
|
109
119
|
|
|
110
|
-
|
|
120
|
+
14 supported engines with structured result extraction.
|
|
121
|
+
|
|
122
|
+
Google uses a special anti-detection flow: visits homepage → types query → presses Enter (not direct URL).
|
|
111
123
|
|
|
112
124
|
```bash
|
|
113
|
-
stealth search google "web scraping tools" -f json
|
|
114
|
-
stealth search
|
|
115
|
-
stealth search duckduckgo "privacy browser" -f
|
|
125
|
+
stealth search google "web scraping tools" -f json # Auto-humanized
|
|
126
|
+
stealth search google "query" -f json --warmup # Extra: visit random site first
|
|
127
|
+
stealth search duckduckgo "privacy browser" -f json
|
|
128
|
+
stealth search bing "anti-detect browser" -f json
|
|
129
|
+
stealth search youtube "tutorial" -f json # Video metadata
|
|
130
|
+
stealth search github "camoufox" -f json # Repo results
|
|
131
|
+
stealth search amazon "mechanical keyboard" -f json
|
|
116
132
|
```
|
|
117
133
|
|
|
118
|
-
|
|
134
|
+
**All 14 engines:** google, bing, duckduckgo, youtube, github, amazon, reddit, wikipedia, twitter, linkedin, tiktok, stackoverflow, npmjs, yelp
|
|
135
|
+
|
|
136
|
+
### Extract
|
|
119
137
|
|
|
120
138
|
```bash
|
|
121
139
|
stealth extract https://example.com --links # All links
|
|
122
140
|
stealth extract https://example.com --images # All images
|
|
123
|
-
stealth extract https://example.com --meta #
|
|
141
|
+
stealth extract https://example.com --meta # Title, description, OG tags
|
|
124
142
|
stealth extract https://example.com --headers # h1-h6 headings
|
|
125
143
|
stealth extract https://example.com -s ".price" --all # CSS selector
|
|
126
|
-
stealth extract https://example.com -s "a" -a "href"
|
|
144
|
+
stealth extract https://example.com -s "a" -a "href" --all # Attributes
|
|
127
145
|
```
|
|
128
146
|
|
|
129
|
-
###
|
|
147
|
+
### Crawl
|
|
130
148
|
|
|
131
149
|
```bash
|
|
132
|
-
stealth crawl https://example.com -d 2 -l 50 # Depth 2, max 50
|
|
133
|
-
stealth crawl https://example.com
|
|
150
|
+
stealth crawl https://example.com -d 2 -l 50 # Depth 2, max 50 pages
|
|
151
|
+
stealth crawl https://example.com -o results.jsonl # Save to file
|
|
134
152
|
stealth crawl https://example.com --include "blog" # URL regex filter
|
|
135
153
|
stealth crawl https://example.com --exclude "login|admin"
|
|
136
|
-
stealth crawl https://example.com
|
|
154
|
+
stealth crawl https://example.com --delay 2000 --humanize # Human-like crawling
|
|
155
|
+
stealth crawl https://example.com --proxy-rotate # Rotate through proxy pool
|
|
137
156
|
```
|
|
138
157
|
|
|
139
|
-
###
|
|
158
|
+
### Monitor
|
|
140
159
|
|
|
141
|
-
|
|
160
|
+
Watch pages for changes — ideal for price tracking, stock alerts, content monitoring.
|
|
142
161
|
|
|
143
162
|
```bash
|
|
144
|
-
stealth
|
|
145
|
-
stealth
|
|
146
|
-
stealth
|
|
163
|
+
stealth monitor https://shop.com/item -s ".price" -i 60 # Check price every 60s
|
|
164
|
+
stealth monitor https://shop.com/item --contains "In Stock"
|
|
165
|
+
stealth monitor https://example.com --not-contains "Sold Out"
|
|
166
|
+
stealth monitor https://example.com --json -n 10 # JSON output, 10 checks max
|
|
147
167
|
```
|
|
148
168
|
|
|
149
|
-
|
|
169
|
+
### Batch
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
echo "https://example.com
|
|
173
|
+
https://github.com
|
|
174
|
+
https://httpbin.org/ip" > urls.txt
|
|
175
|
+
|
|
176
|
+
stealth batch urls.txt -c browse --skip-errors # Browse all
|
|
177
|
+
stealth batch urls.txt -c screenshot -o ./screenshots/ # Screenshot all
|
|
178
|
+
stealth batch urls.txt -c extract -s "h1" # Extract from all
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Fingerprint
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
stealth fingerprint # Show current browser fingerprint
|
|
185
|
+
stealth fingerprint --check # Run anti-detection tests (CreepJS, WebDriver)
|
|
186
|
+
stealth fingerprint --compare 3 # Launch 3 times, compare if fingerprints vary
|
|
187
|
+
stealth fingerprint --profile jp-desktop --json
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Interactive REPL
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
stealth interactive --url https://example.com
|
|
194
|
+
|
|
195
|
+
stealth> goto https://google.com
|
|
196
|
+
stealth> search duckduckgo hello world
|
|
197
|
+
stealth> click "button.submit"
|
|
198
|
+
stealth> hclick "a.link" # Human-like click (mouse movement)
|
|
199
|
+
stealth> type "input[name=q]" hello
|
|
200
|
+
stealth> htype "input[name=q]" hello # Human-like typing (variable speed)
|
|
201
|
+
stealth> scroll down 3
|
|
202
|
+
stealth> text # Page text
|
|
203
|
+
stealth> snapshot # Accessibility tree
|
|
204
|
+
stealth> links # All links
|
|
205
|
+
stealth> screenshot page.png
|
|
206
|
+
stealth> eval document.title # Run JavaScript
|
|
207
|
+
stealth> back / forward / reload
|
|
208
|
+
stealth> exit
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
150
212
|
|
|
151
213
|
## Daemon Mode
|
|
152
214
|
|
|
153
|
-
Keep a browser alive in the background
|
|
215
|
+
Keep a browser alive in the background. Commands reuse it instantly.
|
|
154
216
|
|
|
155
217
|
```bash
|
|
156
218
|
stealth daemon start # Start background browser
|
|
157
|
-
stealth browse https://example.com #
|
|
219
|
+
stealth browse https://example.com # ~1.2s (vs ~6s cold start)
|
|
220
|
+
stealth browse https://other.com # ~1.2s
|
|
158
221
|
stealth daemon status # Check status
|
|
159
|
-
stealth daemon stop # Shut down
|
|
222
|
+
stealth daemon stop # Shut down (auto-stops after 5min idle)
|
|
160
223
|
```
|
|
161
224
|
|
|
162
|
-
The daemon auto-shuts down after 5 minutes of idle time.
|
|
163
|
-
|
|
164
225
|
## Browser Profiles
|
|
165
226
|
|
|
166
|
-
|
|
227
|
+
Persistent browser identities with unique fingerprints. Cookies auto-save between sessions.
|
|
167
228
|
|
|
168
229
|
```bash
|
|
169
|
-
|
|
170
|
-
stealth profile create
|
|
171
|
-
stealth profile create
|
|
230
|
+
stealth profile create work --preset us-desktop
|
|
231
|
+
stealth profile create japan --preset jp-desktop
|
|
232
|
+
stealth profile create rand1 --random # Random fingerprint
|
|
233
|
+
stealth profile list
|
|
234
|
+
stealth profile presets # Show all 8 presets
|
|
235
|
+
|
|
236
|
+
# Use profile — fingerprint + cookies auto-applied
|
|
237
|
+
stealth browse https://example.com --profile work
|
|
238
|
+
# → User-Agent: Windows, locale: en-US, timezone: America/New_York
|
|
239
|
+
```
|
|
172
240
|
|
|
173
|
-
|
|
174
|
-
stealth profile create random1 --random
|
|
241
|
+
**Presets:** `us-desktop` · `us-laptop` · `uk-desktop` · `de-desktop` · `jp-desktop` · `cn-desktop` · `mobile-ios` · `mobile-android`
|
|
175
242
|
|
|
176
|
-
|
|
177
|
-
stealth browse https://example.com --profile mybot
|
|
243
|
+
## Session Persistence
|
|
178
244
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
```
|
|
245
|
+
Save and restore browsing sessions (cookies + last URL + history).
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
stealth browse https://example.com --session my-task --profile work
|
|
249
|
+
# → Cookies saved, URL remembered
|
|
182
250
|
|
|
183
|
-
|
|
251
|
+
# Later: auto-restores cookies and navigates to last URL
|
|
252
|
+
stealth browse https://other.com --session my-task
|
|
253
|
+
```
|
|
184
254
|
|
|
185
255
|
## Proxy Support
|
|
186
256
|
|
|
@@ -188,87 +258,102 @@ stealth profile list
|
|
|
188
258
|
# Single proxy
|
|
189
259
|
stealth browse https://example.com --proxy http://user:pass@host:port
|
|
190
260
|
|
|
191
|
-
# Proxy pool rotation
|
|
192
|
-
stealth proxy add http://proxy1:8080
|
|
193
|
-
stealth proxy add http://proxy2:8080
|
|
194
|
-
stealth proxy
|
|
261
|
+
# Proxy pool with rotation
|
|
262
|
+
stealth proxy add http://proxy1:8080 --label us --region US
|
|
263
|
+
stealth proxy add http://proxy2:8080 --label eu --region EU
|
|
264
|
+
stealth proxy test # Test all proxies
|
|
265
|
+
stealth proxy list # List with status
|
|
195
266
|
stealth browse https://example.com --proxy-rotate # Auto-rotate
|
|
196
|
-
|
|
197
|
-
# Test proxies
|
|
198
|
-
stealth proxy test
|
|
267
|
+
stealth crawl https://example.com --proxy-rotate # Rotate per page
|
|
199
268
|
```
|
|
200
269
|
|
|
201
|
-
When a proxy
|
|
270
|
+
GeoIP: When using a proxy, Camoufox auto-matches locale, timezone, and geolocation to the proxy's exit IP.
|
|
202
271
|
|
|
203
|
-
##
|
|
272
|
+
## Pipe-Friendly
|
|
204
273
|
|
|
205
|
-
|
|
274
|
+
stdout = data, stderr = status. Perfect for Unix pipes:
|
|
206
275
|
|
|
207
276
|
```bash
|
|
208
|
-
stealth
|
|
277
|
+
stealth browse https://api.example.com -f json | jq '.title'
|
|
278
|
+
stealth search google "query" -f json | jq '.results[].url'
|
|
279
|
+
stealth extract https://example.com --links -f json | jq '.data[].url'
|
|
280
|
+
stealth crawl https://example.com -o - | wc -l
|
|
209
281
|
```
|
|
210
282
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
```json
|
|
214
|
-
{
|
|
215
|
-
"mcpServers": {
|
|
216
|
-
"stealth": {
|
|
217
|
-
"command": "node",
|
|
218
|
-
"args": ["/path/to/stealth-cli/bin/stealth.js", "mcp"]
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
```
|
|
283
|
+
## HTTP API Server
|
|
223
284
|
|
|
224
|
-
|
|
285
|
+
```bash
|
|
286
|
+
stealth serve --port 9377
|
|
287
|
+
# → API Token: a1b2c3... (auto-generated, printed on startup)
|
|
225
288
|
|
|
226
|
-
|
|
289
|
+
# Create tab + browse (token required)
|
|
290
|
+
curl -X POST localhost:9377/tabs \
|
|
291
|
+
-H 'Authorization: Bearer <token>' \
|
|
292
|
+
-H 'Content-Type: application/json' \
|
|
293
|
+
-d '{"url":"https://example.com"}'
|
|
227
294
|
|
|
228
|
-
|
|
295
|
+
# Get page text
|
|
296
|
+
curl localhost:9377/tabs/tab-1/text -H 'Authorization: Bearer <token>'
|
|
229
297
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
stealth browse https://api.example.com -f json | jq '.title'
|
|
298
|
+
# Health check (no auth needed)
|
|
299
|
+
curl localhost:9377/health
|
|
233
300
|
|
|
234
|
-
#
|
|
235
|
-
stealth
|
|
236
|
-
| jq '.[].url' \
|
|
237
|
-
| xargs -I {} stealth screenshot {} -o {}.png
|
|
301
|
+
# Disable auth (localhost only)
|
|
302
|
+
stealth serve --no-auth
|
|
238
303
|
|
|
239
|
-
#
|
|
240
|
-
|
|
304
|
+
# Custom token
|
|
305
|
+
stealth serve --token my-secret-token
|
|
306
|
+
|
|
307
|
+
# All endpoints: /health, /tabs, /tabs/:id/navigate, /tabs/:id/snapshot,
|
|
308
|
+
# /tabs/:id/text, /tabs/:id/screenshot, /tabs/:id/click, /tabs/:id/type,
|
|
309
|
+
# /tabs/:id/evaluate, /tabs/:id/close, /shutdown
|
|
241
310
|
```
|
|
242
311
|
|
|
243
312
|
## As a Library (SDK)
|
|
244
313
|
|
|
245
314
|
```javascript
|
|
246
|
-
import {
|
|
247
|
-
launchBrowser, closeBrowser, navigate,
|
|
248
|
-
getTextContent, takeScreenshot
|
|
249
|
-
} from 'stealth-cli';
|
|
315
|
+
import { launchBrowser, closeBrowser, navigate, getTextContent } from 'stealth-cli';
|
|
250
316
|
|
|
251
317
|
const handle = await launchBrowser({
|
|
252
|
-
headless: true,
|
|
253
|
-
proxy: 'http://proxy:8080',
|
|
254
318
|
profile: 'us-desktop',
|
|
255
319
|
humanize: true,
|
|
256
320
|
});
|
|
257
321
|
|
|
258
322
|
await navigate(handle, 'https://example.com');
|
|
259
323
|
const text = await getTextContent(handle);
|
|
260
|
-
|
|
324
|
+
console.log(text);
|
|
261
325
|
|
|
262
326
|
await closeBrowser(handle);
|
|
263
327
|
```
|
|
264
328
|
|
|
329
|
+
## Configuration
|
|
330
|
+
|
|
331
|
+
Set global defaults so you don't repeat flags:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
stealth config set locale zh-CN # Default Chinese locale
|
|
335
|
+
stealth config set humanize true # Always simulate human behavior
|
|
336
|
+
stealth config set retries 3 # Default 3 retries
|
|
337
|
+
stealth config set format json # Default JSON output
|
|
338
|
+
stealth config list # Show all settings
|
|
339
|
+
stealth config reset # Reset to defaults
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Stored at `~/.stealth/config.json`.
|
|
343
|
+
|
|
265
344
|
## How Anti-Detection Works
|
|
266
345
|
|
|
267
|
-
|
|
346
|
+
```
|
|
347
|
+
stealth-cli
|
|
348
|
+
└── camoufox-js (npm)
|
|
349
|
+
└── Camoufox (C++ Firefox fork)
|
|
350
|
+
└── Fingerprint spoofing at the native level
|
|
351
|
+
```
|
|
268
352
|
|
|
269
353
|
| Fingerprint Vector | Approach |
|
|
270
354
|
|---|---|
|
|
271
355
|
| `navigator.hardwareConcurrency` | Spoofed in C++ |
|
|
356
|
+
| `navigator.webdriver` | Always `false` |
|
|
272
357
|
| WebGL renderer / vendor | Spoofed in C++ |
|
|
273
358
|
| AudioContext fingerprint | Spoofed in C++ |
|
|
274
359
|
| Canvas fingerprint | Spoofed in C++ |
|
|
@@ -276,19 +361,37 @@ stealth-cli uses [Camoufox](https://github.com/daijro/camoufox), a Firefox fork
|
|
|
276
361
|
| WebRTC leak | Built-in protection |
|
|
277
362
|
| TLS fingerprint | Firefox native (not Chromium) |
|
|
278
363
|
|
|
279
|
-
|
|
364
|
+
No JavaScript shims. No detectable wrappers. The browser reports spoofed values natively.
|
|
280
365
|
|
|
281
|
-
##
|
|
366
|
+
## Common Options
|
|
282
367
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
368
|
+
Available on all core commands:
|
|
369
|
+
|
|
370
|
+
| Option | Description |
|
|
371
|
+
|--------|-------------|
|
|
372
|
+
| `--proxy <url>` | Use proxy server |
|
|
373
|
+
| `--proxy-rotate` | Rotate through proxy pool |
|
|
374
|
+
| `--profile <name>` | Use saved browser identity |
|
|
375
|
+
| `--session <name>` | Persist/restore browsing session |
|
|
376
|
+
| `--cookies <file>` | Import Netscape-format cookie file |
|
|
377
|
+
| `--humanize` | Simulate human behavior |
|
|
378
|
+
| `--retries <n>` | Max retries on failure (default: 2) |
|
|
379
|
+
| `--no-headless` | Show browser window |
|
|
380
|
+
| `-f, --format` | Output format: text, json, jsonl, snapshot, markdown |
|
|
290
381
|
|
|
291
|
-
|
|
382
|
+
## Project Stats
|
|
383
|
+
|
|
384
|
+
```
|
|
385
|
+
Version: 0.6.0
|
|
386
|
+
Commands: 16
|
|
387
|
+
Tests: 151 passing
|
|
388
|
+
Source: 6,000+ lines
|
|
389
|
+
Files: 52
|
|
390
|
+
Extractors: 6 (Google, Bing, DuckDuckGo, YouTube, GitHub, generic)
|
|
391
|
+
Presets: 8 browser profiles
|
|
392
|
+
Engine: Camoufox (C++ Firefox fork)
|
|
393
|
+
License: MIT
|
|
394
|
+
```
|
|
292
395
|
|
|
293
396
|
## License
|
|
294
397
|
|
package/bin/stealth.js
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { program } from 'commander';
|
|
8
|
+
import { createRequire } from 'module';
|
|
9
|
+
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
const { version } = require('../package.json');
|
|
12
|
+
|
|
8
13
|
import { registerBrowse } from '../src/commands/browse.js';
|
|
9
14
|
import { registerScreenshot } from '../src/commands/screenshot.js';
|
|
10
15
|
import { registerSearch } from '../src/commands/search.js';
|
|
@@ -25,7 +30,7 @@ import { registerConfig } from '../src/commands/config.js';
|
|
|
25
30
|
program
|
|
26
31
|
.name('stealth')
|
|
27
32
|
.description('🦊 Anti-detection browser CLI powered by Camoufox')
|
|
28
|
-
.version(
|
|
33
|
+
.version(version);
|
|
29
34
|
|
|
30
35
|
// Core commands
|
|
31
36
|
registerBrowse(program);
|
package/package.json
CHANGED