💬 Commit message: Update 2026-02-08 04:49:18, 8 files, 120 lines
📁 Files changed: 8 📝 Lines changed: 120 • settings.json • .mcp.json • README.md • save.md • cli.js • cli.js.map • package.json • cli.ts
This commit is contained in:
+12
-12
@@ -1,18 +1,18 @@
|
|||||||
{
|
{
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"allow": [
|
"allow": [
|
||||||
"mcp__claude-browse__goto",
|
"mcp__browse__goto",
|
||||||
"mcp__claude-browse__back",
|
"mcp__browse__back",
|
||||||
"mcp__claude-browse__forward",
|
"mcp__browse__forward",
|
||||||
"mcp__claude-browse__reload",
|
"mcp__browse__reload",
|
||||||
"mcp__claude-browse__click",
|
"mcp__browse__click",
|
||||||
"mcp__claude-browse__type",
|
"mcp__browse__type",
|
||||||
"mcp__claude-browse__query",
|
"mcp__browse__query",
|
||||||
"mcp__claude-browse__url",
|
"mcp__browse__url",
|
||||||
"mcp__claude-browse__html",
|
"mcp__browse__html",
|
||||||
"mcp__claude-browse__screenshot",
|
"mcp__browse__screenshot",
|
||||||
"mcp__claude-browse__eval",
|
"mcp__browse__eval",
|
||||||
"mcp__claude-browse__wait"
|
"mcp__browse__wait"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"enableAllProjectMcpServers": true
|
"enableAllProjectMcpServers": true
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"claude-browse": {
|
"browse": {
|
||||||
"command": "npx",
|
"command": "node",
|
||||||
"args": ["browse-mcp"]
|
"args": ["${CLAUDE_PLUGIN_ROOT}/dist/mcp.js"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,24 +20,24 @@ npx playwright install webkit
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Take a screenshot
|
# Take a screenshot
|
||||||
claude-browse https://example.com
|
browse https://example.com
|
||||||
|
|
||||||
# Custom viewport and output
|
# Custom viewport and output
|
||||||
claude-browse -o page.png -w 1920 -h 1080 https://example.com
|
browse -o page.png -w 1920 -h 1080 https://example.com
|
||||||
|
|
||||||
# Query elements
|
# Query elements
|
||||||
claude-browse -q "a[href]" https://example.com
|
browse -q "a[href]" https://example.com
|
||||||
claude-browse -q "img" -j https://example.com # JSON output
|
browse -q "img" -j https://example.com # JSON output
|
||||||
|
|
||||||
# Click and interact
|
# Click and interact
|
||||||
claude-browse -c "button.submit" https://example.com
|
browse -c "button.submit" https://example.com
|
||||||
claude-browse -t "input[name=q]=hello" -c "button[type=submit]" https://google.com
|
browse -t "input[name=q]=hello" -c "button[type=submit]" https://google.com
|
||||||
|
|
||||||
# Chain actions
|
# Chain actions
|
||||||
claude-browse -c ".cookie-accept" -c "a.nav-link" -q "h1" https://example.com
|
browse -c ".cookie-accept" -c "a.nav-link" -q "h1" https://example.com
|
||||||
|
|
||||||
# Interactive mode (visible browser)
|
# Interactive mode (visible browser)
|
||||||
claude-browse -i --headed https://example.com
|
browse -i --headed https://example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
## Server Mode
|
## Server Mode
|
||||||
@@ -45,8 +45,8 @@ claude-browse -i --headed https://example.com
|
|||||||
Start a persistent browser server that accepts commands via HTTP:
|
Start a persistent browser server that accepts commands via HTTP:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
claude-browse -s 3000 # headless
|
browse -s 3000 # headless
|
||||||
claude-browse -s 3000 --headed # visible browser
|
browse -s 3000 --headed # visible browser
|
||||||
```
|
```
|
||||||
|
|
||||||
Send commands:
|
Send commands:
|
||||||
|
|||||||
+1
-1
@@ -12,4 +12,4 @@ Use the `session_save` tool to save:
|
|||||||
|
|
||||||
If no path is specified, save to `session.json` in the current directory.
|
If no path is specified, save to `session.json` in the current directory.
|
||||||
|
|
||||||
This allows you to restore the session later with `/claude-browse:restore`.
|
This allows you to restore the session later with `/browse:restore`.
|
||||||
|
|||||||
Vendored
+16
-16
@@ -32,7 +32,7 @@ const { values, positionals } = parseArgs({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
const HELP = `
|
const HELP = `
|
||||||
Usage: claude-browse [options] <url>
|
Usage: browse [options] <url>
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-o, --output <file> Output screenshot path (default: screenshot.png)
|
-o, --output <file> Output screenshot path (default: screenshot.png)
|
||||||
@@ -56,24 +56,24 @@ Image Processing:
|
|||||||
--compress <quality> Compress with quality 1-100
|
--compress <quality> Compress with quality 1-100
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
claude-browse https://example.com
|
browse https://example.com
|
||||||
claude-browse -o page.png -w 1920 -h 1080 https://example.com
|
browse -o page.png -w 1920 -h 1080 https://example.com
|
||||||
claude-browse -i --headed https://example.com
|
browse -i --headed https://example.com
|
||||||
claude-browse -q "a[href]" https://example.com
|
browse -q "a[href]" https://example.com
|
||||||
claude-browse -q "img" -j https://example.com
|
browse -q "img" -j https://example.com
|
||||||
claude-browse -c "button.submit" https://example.com
|
browse -c "button.submit" https://example.com
|
||||||
claude-browse -t "input[name=q]=hello" -c "button[type=submit]" https://google.com
|
browse -t "input[name=q]=hello" -c "button[type=submit]" https://google.com
|
||||||
claude-browse -c ".cookie-accept" -c "a.nav-link" -q "h1" https://example.com
|
browse -c ".cookie-accept" -c "a.nav-link" -q "h1" https://example.com
|
||||||
|
|
||||||
Image processing examples:
|
Image processing examples:
|
||||||
claude-browse https://example.com --favicon ./favicons/
|
browse https://example.com --favicon ./favicons/
|
||||||
claude-browse https://example.com -o page.webp --convert webp
|
browse https://example.com -o page.webp --convert webp
|
||||||
claude-browse https://example.com --resize 800x600
|
browse https://example.com --resize 800x600
|
||||||
claude-browse https://example.com --compress 60
|
browse https://example.com --compress 60
|
||||||
|
|
||||||
Server mode (default):
|
Server mode (default):
|
||||||
claude-browse # Start server on port 13373
|
browse # Start server on port 13373
|
||||||
claude-browse --headed # Start with visible browser
|
browse --headed # Start with visible browser
|
||||||
|
|
||||||
# Send commands via curl:
|
# Send commands via curl:
|
||||||
curl -X POST http://localhost:13373 -d '{"cmd":"goto","url":"https://example.com"}'
|
curl -X POST http://localhost:13373 -d '{"cmd":"goto","url":"https://example.com"}'
|
||||||
@@ -227,7 +227,7 @@ async function runBrowserMode() {
|
|||||||
}
|
}
|
||||||
async function main() {
|
async function main() {
|
||||||
if (values.version) {
|
if (values.version) {
|
||||||
console.log(`claude-browse ${pkg.version}`);
|
console.log(`browse ${pkg.version}`);
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
if (values.help) {
|
if (values.help) {
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"bin": {
|
"bin": {
|
||||||
"claude-browse": "dist/cli.js",
|
"browse": "dist/cli.js",
|
||||||
"browse-mcp": "dist/mcp.js"
|
"browse-mcp": "dist/mcp.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+16
-16
@@ -36,7 +36,7 @@ const { values, positionals } = parseArgs({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const HELP = `
|
const HELP = `
|
||||||
Usage: claude-browse [options] <url>
|
Usage: browse [options] <url>
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-o, --output <file> Output screenshot path (default: screenshot.png)
|
-o, --output <file> Output screenshot path (default: screenshot.png)
|
||||||
@@ -60,24 +60,24 @@ Image Processing:
|
|||||||
--compress <quality> Compress with quality 1-100
|
--compress <quality> Compress with quality 1-100
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
claude-browse https://example.com
|
browse https://example.com
|
||||||
claude-browse -o page.png -w 1920 -h 1080 https://example.com
|
browse -o page.png -w 1920 -h 1080 https://example.com
|
||||||
claude-browse -i --headed https://example.com
|
browse -i --headed https://example.com
|
||||||
claude-browse -q "a[href]" https://example.com
|
browse -q "a[href]" https://example.com
|
||||||
claude-browse -q "img" -j https://example.com
|
browse -q "img" -j https://example.com
|
||||||
claude-browse -c "button.submit" https://example.com
|
browse -c "button.submit" https://example.com
|
||||||
claude-browse -t "input[name=q]=hello" -c "button[type=submit]" https://google.com
|
browse -t "input[name=q]=hello" -c "button[type=submit]" https://google.com
|
||||||
claude-browse -c ".cookie-accept" -c "a.nav-link" -q "h1" https://example.com
|
browse -c ".cookie-accept" -c "a.nav-link" -q "h1" https://example.com
|
||||||
|
|
||||||
Image processing examples:
|
Image processing examples:
|
||||||
claude-browse https://example.com --favicon ./favicons/
|
browse https://example.com --favicon ./favicons/
|
||||||
claude-browse https://example.com -o page.webp --convert webp
|
browse https://example.com -o page.webp --convert webp
|
||||||
claude-browse https://example.com --resize 800x600
|
browse https://example.com --resize 800x600
|
||||||
claude-browse https://example.com --compress 60
|
browse https://example.com --compress 60
|
||||||
|
|
||||||
Server mode (default):
|
Server mode (default):
|
||||||
claude-browse # Start server on port 13373
|
browse # Start server on port 13373
|
||||||
claude-browse --headed # Start with visible browser
|
browse --headed # Start with visible browser
|
||||||
|
|
||||||
# Send commands via curl:
|
# Send commands via curl:
|
||||||
curl -X POST http://localhost:13373 -d '{"cmd":"goto","url":"https://example.com"}'
|
curl -X POST http://localhost:13373 -d '{"cmd":"goto","url":"https://example.com"}'
|
||||||
@@ -255,7 +255,7 @@ async function runBrowserMode(): Promise<void> {
|
|||||||
|
|
||||||
async function main(): Promise<void> {
|
async function main(): Promise<void> {
|
||||||
if (values.version) {
|
if (values.version) {
|
||||||
console.log(`claude-browse ${pkg.version}`);
|
console.log(`browse ${pkg.version}`);
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user