stealth-cli 0.5.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/LICENSE +21 -0
- package/README.md +295 -0
- package/bin/stealth.js +50 -0
- package/package.json +65 -0
- package/skills/SKILL.md +244 -0
- package/src/browser.js +341 -0
- package/src/client.js +115 -0
- package/src/commands/batch.js +180 -0
- package/src/commands/browse.js +101 -0
- package/src/commands/config.js +85 -0
- package/src/commands/crawl.js +169 -0
- package/src/commands/daemon.js +143 -0
- package/src/commands/extract.js +153 -0
- package/src/commands/fingerprint.js +306 -0
- package/src/commands/interactive.js +284 -0
- package/src/commands/mcp.js +68 -0
- package/src/commands/monitor.js +160 -0
- package/src/commands/pdf.js +109 -0
- package/src/commands/profile.js +112 -0
- package/src/commands/proxy.js +116 -0
- package/src/commands/screenshot.js +96 -0
- package/src/commands/search.js +162 -0
- package/src/commands/serve.js +240 -0
- package/src/config.js +123 -0
- package/src/cookies.js +67 -0
- package/src/daemon-entry.js +19 -0
- package/src/daemon.js +294 -0
- package/src/errors.js +136 -0
- package/src/extractors/base.js +59 -0
- package/src/extractors/bing.js +47 -0
- package/src/extractors/duckduckgo.js +91 -0
- package/src/extractors/github.js +103 -0
- package/src/extractors/google.js +173 -0
- package/src/extractors/index.js +55 -0
- package/src/extractors/youtube.js +87 -0
- package/src/humanize.js +210 -0
- package/src/index.js +32 -0
- package/src/macros.js +36 -0
- package/src/mcp-server.js +341 -0
- package/src/output.js +65 -0
- package/src/profiles.js +308 -0
- package/src/proxy-pool.js +256 -0
- package/src/retry.js +112 -0
- package/src/session.js +159 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# 🦊 stealth-cli
|
|
2
|
+
|
|
3
|
+
Anti-detection browser CLI powered by [Camoufox](https://camoufox.com). Browse, screenshot, search, extract, crawl — all with C++ level fingerprint spoofing. Zero JavaScript shims, undetectable by design.
|
|
4
|
+
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://nodejs.org)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- 🛡️ **C++ level anti-detection** — Camoufox patches Firefox at native level, not JS shims
|
|
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
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git clone https://github.com/Youhai020616/stealth-cli.git
|
|
26
|
+
cd stealth-cli
|
|
27
|
+
npm install # Installs deps + downloads Camoufox browser (~300MB)
|
|
28
|
+
npm link # Makes 'stealth' command available globally
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Browse a page
|
|
35
|
+
stealth browse https://example.com
|
|
36
|
+
|
|
37
|
+
# Screenshot
|
|
38
|
+
stealth screenshot https://example.com -o page.png
|
|
39
|
+
|
|
40
|
+
# Search with anti-detection
|
|
41
|
+
stealth search google "best coffee beans" -f json
|
|
42
|
+
|
|
43
|
+
# Extract structured data
|
|
44
|
+
stealth extract https://example.com --links --format json
|
|
45
|
+
|
|
46
|
+
# Crawl a site
|
|
47
|
+
stealth crawl https://example.com --depth 2 --limit 50 -o results.jsonl
|
|
48
|
+
|
|
49
|
+
# Interactive REPL
|
|
50
|
+
stealth interactive --url https://example.com
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Commands
|
|
54
|
+
|
|
55
|
+
### Core
|
|
56
|
+
|
|
57
|
+
| Command | Description |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| `stealth browse <url>` | Visit URL, print page content |
|
|
60
|
+
| `stealth screenshot <url>` | Take a screenshot |
|
|
61
|
+
| `stealth pdf <url>` | Save page as PDF |
|
|
62
|
+
| `stealth search <engine> <query>` | Search the web |
|
|
63
|
+
| `stealth extract <url>` | Extract structured data |
|
|
64
|
+
| `stealth crawl <url>` | Recursive crawling |
|
|
65
|
+
| `stealth interactive` | Interactive REPL |
|
|
66
|
+
| `stealth batch <file>` | Batch process URLs from file |
|
|
67
|
+
| `stealth monitor <url>` | Monitor page for changes |
|
|
68
|
+
| `stealth fingerprint` | Show browser fingerprint info |
|
|
69
|
+
|
|
70
|
+
### Management
|
|
71
|
+
|
|
72
|
+
| Command | Description |
|
|
73
|
+
|---------|-------------|
|
|
74
|
+
| `stealth daemon start` | Start background browser |
|
|
75
|
+
| `stealth daemon stop` | Stop background browser |
|
|
76
|
+
| `stealth daemon status` | Show daemon status |
|
|
77
|
+
| `stealth profile create <name>` | Create browser identity |
|
|
78
|
+
| `stealth profile list` | List all profiles |
|
|
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 |
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### `stealth browse <url>`
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
stealth browse https://example.com # Text content
|
|
91
|
+
stealth browse https://example.com -f json # JSON output
|
|
92
|
+
stealth browse https://example.com -f snapshot # Accessibility tree
|
|
93
|
+
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
|
+
```
|
|
98
|
+
|
|
99
|
+
### `stealth screenshot <url>`
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
stealth screenshot https://example.com # → screenshot.png
|
|
103
|
+
stealth screenshot https://example.com -o page.jpg # JPEG output
|
|
104
|
+
stealth screenshot https://example.com --full # Full page
|
|
105
|
+
stealth screenshot https://example.com --width 1920 --height 1080
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `stealth search <engine> <query>`
|
|
109
|
+
|
|
110
|
+
**Supported engines:** google, bing, duckduckgo, youtube, github, stackoverflow, npmjs, amazon, reddit, wikipedia, twitter, linkedin, tiktok, yelp
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
stealth search google "web scraping tools" -f json
|
|
114
|
+
stealth search github "camoufox" --max 20
|
|
115
|
+
stealth search duckduckgo "privacy browser" -f markdown
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### `stealth extract <url>`
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
stealth extract https://example.com --links # All links
|
|
122
|
+
stealth extract https://example.com --images # All images
|
|
123
|
+
stealth extract https://example.com --meta # Meta & OG tags
|
|
124
|
+
stealth extract https://example.com --headers # h1-h6 headings
|
|
125
|
+
stealth extract https://example.com -s ".price" --all # CSS selector
|
|
126
|
+
stealth extract https://example.com -s "a" -a "href" # Attributes
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### `stealth crawl <url>`
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
stealth crawl https://example.com -d 2 -l 50 # Depth 2, max 50
|
|
133
|
+
stealth crawl https://example.com --delay 2000 # 2s between pages
|
|
134
|
+
stealth crawl https://example.com --include "blog" # URL regex filter
|
|
135
|
+
stealth crawl https://example.com --exclude "login|admin"
|
|
136
|
+
stealth crawl https://example.com -o results.jsonl # Save to file
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### `stealth interactive`
|
|
140
|
+
|
|
141
|
+
Interactive REPL for manual browsing.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
stealth interactive # Start empty
|
|
145
|
+
stealth interactive --url https://example.com # Start with a page
|
|
146
|
+
stealth interactive --no-headless # Show browser window
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
REPL commands: `goto`, `search`, `click`, `type`, `snapshot`, `text`, `links`, `screenshot`, `back`, `forward`, `eval`, `help`, `exit`
|
|
150
|
+
|
|
151
|
+
## Daemon Mode
|
|
152
|
+
|
|
153
|
+
Keep a browser alive in the background for instant reuse. No cold start.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
stealth daemon start # Start background browser
|
|
157
|
+
stealth browse https://example.com # ← Uses daemon automatically
|
|
158
|
+
stealth daemon status # Check status
|
|
159
|
+
stealth daemon stop # Shut down
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The daemon auto-shuts down after 5 minutes of idle time.
|
|
163
|
+
|
|
164
|
+
## Browser Profiles
|
|
165
|
+
|
|
166
|
+
Create persistent browser identities with unique fingerprints, cookies, and proxy settings.
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Create from preset
|
|
170
|
+
stealth profile create mybot --preset us-desktop
|
|
171
|
+
stealth profile create jpbot --preset jp-desktop
|
|
172
|
+
|
|
173
|
+
# Create with random fingerprint
|
|
174
|
+
stealth profile create random1 --random
|
|
175
|
+
|
|
176
|
+
# Use profile
|
|
177
|
+
stealth browse https://example.com --profile mybot
|
|
178
|
+
|
|
179
|
+
# Cookies are auto-saved between sessions
|
|
180
|
+
stealth profile list
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Available presets:** `us-desktop`, `us-laptop`, `uk-desktop`, `de-desktop`, `jp-desktop`, `cn-desktop`, `mobile-ios`, `mobile-android`
|
|
184
|
+
|
|
185
|
+
## Proxy Support
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Single proxy
|
|
189
|
+
stealth browse https://example.com --proxy http://user:pass@host:port
|
|
190
|
+
|
|
191
|
+
# Proxy pool rotation
|
|
192
|
+
stealth proxy add http://proxy1:8080
|
|
193
|
+
stealth proxy add http://proxy2:8080
|
|
194
|
+
stealth proxy add socks5://proxy3:1080
|
|
195
|
+
stealth browse https://example.com --proxy-rotate # Auto-rotate
|
|
196
|
+
|
|
197
|
+
# Test proxies
|
|
198
|
+
stealth proxy test
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
When a proxy is used, Camoufox automatically matches locale, timezone, and geolocation to the proxy's exit IP via GeoIP.
|
|
202
|
+
|
|
203
|
+
## MCP Server (AI Agent Integration)
|
|
204
|
+
|
|
205
|
+
Use stealth-cli as a tool in Claude Desktop, Cursor, or any MCP-compatible AI agent.
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
stealth mcp # Start MCP server (stdio)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Add to `claude_desktop_config.json`:
|
|
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
|
+
```
|
|
223
|
+
|
|
224
|
+
**Available MCP tools:** `stealth_browse`, `stealth_screenshot`, `stealth_search`, `stealth_extract`, `stealth_click`, `stealth_type`, `stealth_evaluate`
|
|
225
|
+
|
|
226
|
+
## Pipe-Friendly
|
|
227
|
+
|
|
228
|
+
stdout = data, stderr = status messages. Perfect for piping:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Parse with jq
|
|
232
|
+
stealth browse https://api.example.com -f json | jq '.title'
|
|
233
|
+
|
|
234
|
+
# Chain commands
|
|
235
|
+
stealth extract https://example.com --links -f json \
|
|
236
|
+
| jq '.[].url' \
|
|
237
|
+
| xargs -I {} stealth screenshot {} -o {}.png
|
|
238
|
+
|
|
239
|
+
# Batch from file
|
|
240
|
+
cat urls.txt | xargs -I {} stealth browse {} -f json > output.jsonl
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## As a Library (SDK)
|
|
244
|
+
|
|
245
|
+
```javascript
|
|
246
|
+
import {
|
|
247
|
+
launchBrowser, closeBrowser, navigate,
|
|
248
|
+
getTextContent, takeScreenshot
|
|
249
|
+
} from 'stealth-cli';
|
|
250
|
+
|
|
251
|
+
const handle = await launchBrowser({
|
|
252
|
+
headless: true,
|
|
253
|
+
proxy: 'http://proxy:8080',
|
|
254
|
+
profile: 'us-desktop',
|
|
255
|
+
humanize: true,
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
await navigate(handle, 'https://example.com');
|
|
259
|
+
const text = await getTextContent(handle);
|
|
260
|
+
const screenshot = await takeScreenshot(handle, { path: 'page.png' });
|
|
261
|
+
|
|
262
|
+
await closeBrowser(handle);
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## How Anti-Detection Works
|
|
266
|
+
|
|
267
|
+
stealth-cli uses [Camoufox](https://github.com/daijro/camoufox), a Firefox fork that patches fingerprint generation at the **C++ level**:
|
|
268
|
+
|
|
269
|
+
| Fingerprint Vector | Approach |
|
|
270
|
+
|---|---|
|
|
271
|
+
| `navigator.hardwareConcurrency` | Spoofed in C++ |
|
|
272
|
+
| WebGL renderer / vendor | Spoofed in C++ |
|
|
273
|
+
| AudioContext fingerprint | Spoofed in C++ |
|
|
274
|
+
| Canvas fingerprint | Spoofed in C++ |
|
|
275
|
+
| Screen geometry | Spoofed in C++ |
|
|
276
|
+
| WebRTC leak | Built-in protection |
|
|
277
|
+
| TLS fingerprint | Firefox native (not Chromium) |
|
|
278
|
+
|
|
279
|
+
**No JavaScript shims. No detectable wrappers.** The browser reports spoofed values natively.
|
|
280
|
+
|
|
281
|
+
## Configuration
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
stealth config set headless false # Show browser window by default
|
|
285
|
+
stealth config set proxy http://p:8080 # Default proxy
|
|
286
|
+
stealth config set humanize true # Always simulate human behavior
|
|
287
|
+
stealth config set format json # Default output format
|
|
288
|
+
stealth config set retries 3 # Default retry count
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Config stored at `~/.stealth/config.json`.
|
|
292
|
+
|
|
293
|
+
## License
|
|
294
|
+
|
|
295
|
+
MIT
|
package/bin/stealth.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* stealth-cli — Anti-detection browser CLI powered by Camoufox
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { program } from 'commander';
|
|
8
|
+
import { registerBrowse } from '../src/commands/browse.js';
|
|
9
|
+
import { registerScreenshot } from '../src/commands/screenshot.js';
|
|
10
|
+
import { registerSearch } from '../src/commands/search.js';
|
|
11
|
+
import { registerExtract } from '../src/commands/extract.js';
|
|
12
|
+
import { registerCrawl } from '../src/commands/crawl.js';
|
|
13
|
+
import { registerInteractive } from '../src/commands/interactive.js';
|
|
14
|
+
import { registerDaemon } from '../src/commands/daemon.js';
|
|
15
|
+
import { registerProfile } from '../src/commands/profile.js';
|
|
16
|
+
import { registerProxy } from '../src/commands/proxy.js';
|
|
17
|
+
import { registerPdf } from '../src/commands/pdf.js';
|
|
18
|
+
import { registerMonitor } from '../src/commands/monitor.js';
|
|
19
|
+
import { registerBatch } from '../src/commands/batch.js';
|
|
20
|
+
import { registerFingerprint } from '../src/commands/fingerprint.js';
|
|
21
|
+
import { registerServe } from '../src/commands/serve.js';
|
|
22
|
+
import { registerMcp } from '../src/commands/mcp.js';
|
|
23
|
+
import { registerConfig } from '../src/commands/config.js';
|
|
24
|
+
|
|
25
|
+
program
|
|
26
|
+
.name('stealth')
|
|
27
|
+
.description('🦊 Anti-detection browser CLI powered by Camoufox')
|
|
28
|
+
.version('0.4.0');
|
|
29
|
+
|
|
30
|
+
// Core commands
|
|
31
|
+
registerBrowse(program);
|
|
32
|
+
registerScreenshot(program);
|
|
33
|
+
registerSearch(program);
|
|
34
|
+
registerExtract(program);
|
|
35
|
+
registerCrawl(program);
|
|
36
|
+
registerInteractive(program);
|
|
37
|
+
registerPdf(program);
|
|
38
|
+
registerBatch(program);
|
|
39
|
+
registerMonitor(program);
|
|
40
|
+
registerFingerprint(program);
|
|
41
|
+
registerServe(program);
|
|
42
|
+
registerMcp(program);
|
|
43
|
+
|
|
44
|
+
// Management commands
|
|
45
|
+
registerDaemon(program);
|
|
46
|
+
registerProfile(program);
|
|
47
|
+
registerProxy(program);
|
|
48
|
+
registerConfig(program);
|
|
49
|
+
|
|
50
|
+
program.parse();
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stealth-cli",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Anti-detection browser CLI powered by Camoufox. Browse, search, scrape, and crawl the web with C++ level fingerprint spoofing.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"stealth": "bin/stealth.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "src/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/",
|
|
12
|
+
"src/",
|
|
13
|
+
"skills/",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"start": "node bin/stealth.js",
|
|
19
|
+
"test": "vitest run",
|
|
20
|
+
"test:watch": "vitest",
|
|
21
|
+
"test:unit": "vitest run tests/unit",
|
|
22
|
+
"test:e2e": "vitest run tests/e2e",
|
|
23
|
+
"postinstall": "npx camoufox-js fetch || true",
|
|
24
|
+
"prepublishOnly": "npm test"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"browser",
|
|
28
|
+
"cli",
|
|
29
|
+
"anti-detection",
|
|
30
|
+
"camoufox",
|
|
31
|
+
"stealth",
|
|
32
|
+
"scraping",
|
|
33
|
+
"automation",
|
|
34
|
+
"headless",
|
|
35
|
+
"fingerprint",
|
|
36
|
+
"web-scraping",
|
|
37
|
+
"anti-bot",
|
|
38
|
+
"cloudflare",
|
|
39
|
+
"playwright",
|
|
40
|
+
"firefox"
|
|
41
|
+
],
|
|
42
|
+
"author": "xyh",
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": ""
|
|
47
|
+
},
|
|
48
|
+
"homepage": "",
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": ""
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=18"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"camoufox-js": "^0.9.2",
|
|
57
|
+
"chalk": "^5.3.0",
|
|
58
|
+
"commander": "^14.0.0",
|
|
59
|
+
"ora": "^8.0.0",
|
|
60
|
+
"playwright-core": "^1.58.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"vitest": "^4.1.0"
|
|
64
|
+
}
|
|
65
|
+
}
|
package/skills/SKILL.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# stealth-cli
|
|
2
|
+
|
|
3
|
+
Anti-detection browser CLI powered by Camoufox. Browse the web, search, extract data, take screenshots, and crawl pages — all with C++ level fingerprint spoofing that bypasses Cloudflare, Google, and most bot detection systems.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- User needs to browse a website that blocks automated tools
|
|
8
|
+
- User needs to scrape data from protected pages
|
|
9
|
+
- User needs to search Google/Bing/DuckDuckGo without being blocked
|
|
10
|
+
- User needs screenshots of pages behind anti-bot protection
|
|
11
|
+
- User needs to monitor a page for changes
|
|
12
|
+
- User needs to extract structured data (links, images, meta tags)
|
|
13
|
+
- User needs to crawl a site with anti-detection
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cd ~/Desktop/stealth-cli
|
|
19
|
+
npm install # installs deps + downloads Camoufox (~300MB first time)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Commands
|
|
23
|
+
|
|
24
|
+
### Browse a page
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Text output (default)
|
|
28
|
+
stealth browse https://example.com
|
|
29
|
+
|
|
30
|
+
# JSON output with metadata
|
|
31
|
+
stealth browse https://example.com -f json
|
|
32
|
+
|
|
33
|
+
# With proxy
|
|
34
|
+
stealth browse https://example.com --proxy http://user:pass@host:port
|
|
35
|
+
|
|
36
|
+
# With saved profile identity
|
|
37
|
+
stealth browse https://example.com --profile us-desktop
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Screenshot
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
stealth screenshot https://example.com -o page.png
|
|
44
|
+
stealth screenshot https://example.com --full -o full.png # full page
|
|
45
|
+
stealth screenshot https://example.com --width 1920 --height 1080
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Search (bypasses anti-bot)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Google (auto-humanized: visits homepage, types query, presses enter)
|
|
52
|
+
stealth search google "web scraping tools" -f json
|
|
53
|
+
|
|
54
|
+
# Other engines
|
|
55
|
+
stealth search duckduckgo "query" -f json
|
|
56
|
+
stealth search bing "query" -f json
|
|
57
|
+
stealth search youtube "query" -f json
|
|
58
|
+
stealth search github "query" -f json
|
|
59
|
+
|
|
60
|
+
# With warmup (visit random site first to build browsing history)
|
|
61
|
+
stealth search google "query" -f json --warmup
|
|
62
|
+
|
|
63
|
+
# Supported: google, duckduckgo, bing, youtube, github, amazon,
|
|
64
|
+
# reddit, wikipedia, twitter, linkedin, tiktok, stackoverflow,
|
|
65
|
+
# npmjs, yelp
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Extract data
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Extract all links
|
|
72
|
+
stealth extract https://example.com --links
|
|
73
|
+
|
|
74
|
+
# Extract meta tags (title, description, og:*)
|
|
75
|
+
stealth extract https://example.com --meta
|
|
76
|
+
|
|
77
|
+
# Extract all headings
|
|
78
|
+
stealth extract https://example.com --headers
|
|
79
|
+
|
|
80
|
+
# Extract by CSS selector
|
|
81
|
+
stealth extract https://example.com -s ".product-title" --all
|
|
82
|
+
|
|
83
|
+
# Extract image URLs
|
|
84
|
+
stealth extract https://example.com --images
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Crawl
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Crawl 2 levels deep, max 20 pages
|
|
91
|
+
stealth crawl https://example.com -d 2 -l 20
|
|
92
|
+
|
|
93
|
+
# Save to file
|
|
94
|
+
stealth crawl https://example.com -o results.jsonl
|
|
95
|
+
|
|
96
|
+
# Filter URLs
|
|
97
|
+
stealth crawl https://example.com --include "blog" --exclude "login"
|
|
98
|
+
|
|
99
|
+
# With delay between pages
|
|
100
|
+
stealth crawl https://example.com --delay 2000
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Monitor for changes
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Watch for any change (check every 60s)
|
|
107
|
+
stealth monitor https://example.com/price -s ".price" -i 60
|
|
108
|
+
|
|
109
|
+
# Alert when text appears
|
|
110
|
+
stealth monitor https://example.com --contains "In Stock"
|
|
111
|
+
|
|
112
|
+
# Alert when text disappears
|
|
113
|
+
stealth monitor https://example.com --not-contains "Sold Out"
|
|
114
|
+
|
|
115
|
+
# JSON output for piping
|
|
116
|
+
stealth monitor https://example.com --json -n 10
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Batch processing
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Create a URL list file
|
|
123
|
+
echo "https://example.com\nhttps://httpbin.org/ip" > urls.txt
|
|
124
|
+
|
|
125
|
+
# Browse all URLs
|
|
126
|
+
stealth batch urls.txt -c browse --skip-errors
|
|
127
|
+
|
|
128
|
+
# Screenshot all URLs
|
|
129
|
+
stealth batch urls.txt -c screenshot -o ./screenshots/
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Browser fingerprint check
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Show current fingerprint
|
|
136
|
+
stealth fingerprint
|
|
137
|
+
|
|
138
|
+
# Run anti-detection tests
|
|
139
|
+
stealth fingerprint --check
|
|
140
|
+
|
|
141
|
+
# Compare fingerprints across multiple launches
|
|
142
|
+
stealth fingerprint --compare 3
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Profile management (persistent identities)
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Create from preset
|
|
149
|
+
stealth profile create work --preset us-desktop
|
|
150
|
+
stealth profile create jp --preset jp-desktop
|
|
151
|
+
|
|
152
|
+
# Create random
|
|
153
|
+
stealth profile create random1 --random
|
|
154
|
+
|
|
155
|
+
# List profiles
|
|
156
|
+
stealth profile list
|
|
157
|
+
|
|
158
|
+
# Use profile (auto-saves cookies on exit)
|
|
159
|
+
stealth browse https://example.com --profile work
|
|
160
|
+
|
|
161
|
+
# Available presets: us-desktop, us-laptop, uk-desktop, de-desktop,
|
|
162
|
+
# jp-desktop, cn-desktop, mobile-ios, mobile-android
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Session persistence
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Save/restore browsing session (cookies + last URL)
|
|
169
|
+
stealth browse https://example.com --session my-task
|
|
170
|
+
|
|
171
|
+
# Next time: auto-restores cookies and navigates to last URL
|
|
172
|
+
stealth browse https://other.com --session my-task
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Proxy pool
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
stealth proxy add http://user:pass@host:port --label us-east
|
|
179
|
+
stealth proxy list
|
|
180
|
+
stealth proxy test # test all proxies
|
|
181
|
+
|
|
182
|
+
# Auto-rotate through pool
|
|
183
|
+
stealth browse https://example.com --proxy-rotate
|
|
184
|
+
stealth crawl https://example.com --proxy-rotate
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Daemon mode (fast startup)
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
stealth daemon start # launch background browser
|
|
191
|
+
stealth browse https://... # instant (~1s vs ~6s cold start)
|
|
192
|
+
stealth daemon status
|
|
193
|
+
stealth daemon stop
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### HTTP API server
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
stealth serve --port 9377
|
|
200
|
+
|
|
201
|
+
# Then call via HTTP:
|
|
202
|
+
curl -X POST http://localhost:9377/tabs -d '{"url":"https://example.com"}'
|
|
203
|
+
curl http://localhost:9377/tabs/tab-1/text
|
|
204
|
+
curl http://localhost:9377/tabs/tab-1/screenshot
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Interactive REPL
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
stealth interactive --url https://example.com
|
|
211
|
+
|
|
212
|
+
# Commands: goto, search, click, hclick, type, htype, scroll,
|
|
213
|
+
# snapshot, text, title, url, links, screenshot, back, forward,
|
|
214
|
+
# reload, eval, wait, help, exit
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Output format
|
|
218
|
+
|
|
219
|
+
All commands support `--format` or `-f`:
|
|
220
|
+
- `text` — human-readable (default)
|
|
221
|
+
- `json` — structured JSON
|
|
222
|
+
- `jsonl` — one JSON object per line
|
|
223
|
+
- `snapshot` — accessibility tree snapshot
|
|
224
|
+
- `markdown` — markdown formatted
|
|
225
|
+
|
|
226
|
+
stdout contains data, stderr contains status messages. Pipe-friendly:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
stealth search google "query" -f json | jq '.results[].url'
|
|
230
|
+
stealth extract https://example.com --links -f json | jq '.[].url'
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Common options (all commands)
|
|
234
|
+
|
|
235
|
+
| Option | Description |
|
|
236
|
+
|--------|-------------|
|
|
237
|
+
| `--proxy <url>` | Use proxy server |
|
|
238
|
+
| `--proxy-rotate` | Rotate through proxy pool |
|
|
239
|
+
| `--profile <name>` | Use saved browser profile |
|
|
240
|
+
| `--session <name>` | Persist/restore session |
|
|
241
|
+
| `--cookies <file>` | Import Netscape cookie file |
|
|
242
|
+
| `--humanize` | Enable human behavior simulation |
|
|
243
|
+
| `--retries <n>` | Max retries on failure |
|
|
244
|
+
| `--no-headless` | Show browser window |
|