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
2 changes: 1 addition & 1 deletion scripts/generate-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {createTools} from '../build/src/tools/tools.js';

const OUTPUT_PATH = path.join(
import.meta.dirname,
'../src/bin/cliDefinitions.ts',
'../src/bin/chrome-devtools-cli-options.ts',
);

async function fetchTools() {
Expand Down
64 changes: 16 additions & 48 deletions src/bin/chrome-devtools-cli-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const commands: Commands = {
name: 'geolocation',
type: 'string',
description:
'Geolocation (`<latitude>x<longitude>`) to emulate. Latitude between -90 and 90. Longitude between -180 and 180. Omit clear the geolocation override.',
'Geolocation (`<latitude>x<longitude>`) to emulate. Latitude between -90 and 90. Longitude between -180 and 180. Omit to clear the geolocation override.',
required: false,
},
userAgent: {
Expand Down Expand Up @@ -155,11 +155,18 @@ export const commands: Commands = {
description: 'An optional list of arguments to pass to the function.',
required: false,
},
dialogAction: {
name: 'dialogAction',
type: 'string',
description:
'Handle dialogs while execution. "accept", "dismiss", or string for response of window.prompt. Defaults to accept.',
required: false,
},
},
},
fill: {
description:
'Type text into a input, text area or select an option from a <select> element.',
'Type text into an input, text area or select an option from a <select> element.',
category: 'Input automation',
args: {
uid: {
Expand All @@ -184,25 +191,6 @@ export const commands: Commands = {
},
},
},
fill_form: {
description: 'Fill out multiple form elements at once',
category: 'Input automation',
args: {
elements: {
name: 'elements',
type: 'array',
description: 'Elements from snapshot to fill out.',
required: true,
},
includeSnapshot: {
name: 'includeSnapshot',
type: 'boolean',
description:
'Whether to include a snapshot in the response. Default is false.',
required: false,
},
},
},
get_console_message: {
description:
'Gets a console message by its ID. You can get all messages by calling list_console_messages.',
Expand Down Expand Up @@ -233,14 +221,14 @@ export const commands: Commands = {
name: 'requestFilePath',
type: 'string',
description:
'The absolute or relative path to save the request body to. If omitted, the body is returned inline.',
'The absolute or relative path to a .network-request file to save the request body to. If omitted, the body is returned inline.',
required: false,
},
responseFilePath: {
name: 'responseFilePath',
type: 'string',
description:
'The absolute or relative path to save the response body to. If omitted, the body is returned inline.',
'The absolute or relative path to a .network-response file to save the response body to. If omitted, the body is returned inline.',
required: false,
},
},
Expand Down Expand Up @@ -324,7 +312,7 @@ export const commands: Commands = {
name: 'pageSize',
type: 'integer',
description:
'Maximum number of messages to return. When omitted, returns all requests.',
'Maximum number of messages to return. When omitted, returns all messages.',
required: false,
},
pageIdx: {
Expand Down Expand Up @@ -388,7 +376,7 @@ export const commands: Commands = {
},
},
list_pages: {
description: 'Get a list of pages open in the browser.',
description: 'Get a list of pages open in the browser.',
category: 'Navigation automation',
args: {},
},
Expand Down Expand Up @@ -601,8 +589,8 @@ export const commands: Commands = {
},
take_memory_snapshot: {
description:
'Capture a memory heapsnapshot of the currently selected page to memory leak debugging',
category: 'Performance',
'Capture a heap snapshot of the currently selected page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.',
category: 'Memory',
args: {
filePath: {
name: 'filePath',
Expand Down Expand Up @@ -637,7 +625,7 @@ export const commands: Commands = {
name: 'uid',
type: 'string',
description:
'The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot.',
'The uid of an element on the page from the page content snapshot. If omitted, takes a page screenshot.',
required: false,
},
fullPage: {
Expand Down Expand Up @@ -722,24 +710,4 @@ export const commands: Commands = {
},
},
},
wait_for: {
description: 'Wait for the specified text to appear on the selected page.',
category: 'Navigation automation',
args: {
text: {
name: 'text',
type: 'array',
description:
'Non-empty list of texts. Resolves when any value appears on the page.',
required: true,
},
timeout: {
name: 'timeout',
type: 'integer',
description:
'Maximum wait time in milliseconds. If set to 0, the default timeout will be used.',
required: false,
},
},
},
} as const;
Loading
Loading