Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,26 +151,22 @@ Run `npx chrome-devtools-mcp@latest --help` to see all available configuration o

```sh
Options:
--version Show version number [boolean]
-u, --browserUrl The browser URL to connect to [string]
--headless Whether to run in headless (no UI) mode [boolean] [default: false]
-e, --executablePath Path to custom Chrome executable [string]
--isolated If specified, creates a temporary user-data-dir that is automatically
cleaned up after the browser is closed. [boolean] [default: false]
--channel System installed browser channel to use.
[string] [choices: "stable", "canary", "beta", "dev"]
--help Show help [boolean]
--version Show version number [boolean]
-u, --browserUrl The browser URL to connect to [string]
--headless Whether to run in headless (no UI) mode [boolean] [default: false]
-e, --executablePath Path to custom Chrome executable [string]
--isolated If specified, creates a temporary user-data-dir that is automatically cleaned up after the browser is closed. [boolean] [default: false]
--channel System installed browser channel to use. [string] [choices: "stable", "canary", "beta", "dev"]
--help Show help [boolean]

Examples:
npx chrome-devtools-mcp@latest --browserUrl Connect to an existing browser instance
http://127.0.0.1:9222
npx chrome-devtools-mcp@latest --channel beta Use Chrome Beta installed on this system
npx chrome-devtools-mcp@latest --channel canary Use Chrome Canary installed on this system
npx chrome-devtools-mcp@latest --channel dev Use Chrome Dev installed on this system
npx chrome-devtools-mcp@latest --channel stable Use stable Chrome installed on this system
npx chrome-devtools-mcp@latest --logFile Save logs to a file
/tmp/log.txt
npx chrome-devtools-mcp@latest --help Print CLI options
npx chrome-devtools-mcp@latest --browserUrl http://127.0.0.1:9222 Connect to an existing browser instance
npx chrome-devtools-mcp@latest --channel beta Use Chrome Beta installed on this system
npx chrome-devtools-mcp@latest --channel canary Use Chrome Canary installed on this system
npx chrome-devtools-mcp@latest --channel dev Use Chrome Dev installed on this system
npx chrome-devtools-mcp@latest --channel stable Use stable Chrome installed on this system
npx chrome-devtools-mcp@latest --logFile /tmp/log.txt Save logs to a file
npx chrome-devtools-mcp@latest --help Print CLI options
```

<!-- END AUTO GENERATED CLI -->
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ import path from 'node:path';
import fs from 'node:fs';
import assert from 'node:assert';

export const args = yargs(hideBin(process.argv))
export const yargsInstance = yargs(hideBin(process.argv))
.scriptName('npx chrome-devtools-mcp@latest')
.wrap(100)
.option('browserUrl', {
type: 'string',
description: 'The browser URL to connect to',
Expand Down Expand Up @@ -102,7 +101,9 @@ export const args = yargs(hideBin(process.argv))
['$0 --help', 'Print CLI options'],
])

.help()
.help();
export const args = yargsInstance
.wrap(Math.min(120, yargsInstance.terminalWidth()))
.parseSync();

if (args.logFile) {
Expand Down