豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 013110b

Browse files
authored
chore: generate cli automatically (#1117)
1 parent 0378457 commit 013110b

File tree

7 files changed

+20
-16
lines changed

7 files changed

+20
-16
lines changed

.github/workflows/presubmit.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ jobs:
5151
- name: Install dependencies
5252
run: npm ci
5353

54-
- name: Generate documents
55-
run: npm run docs
54+
- name: Generate
55+
run: npm run gen
5656

57-
- name: Check if autogenerated docs differ
57+
- name: Check if autogenerated code and docs are out of date
5858
run: |
5959
diff_file=$(mktemp doc_diff_XXXXXX)
6060
git diff --color > $diff_file
6161
if [[ -s $diff_file ]]; then
62-
echo "Please update the documentation by running 'npm run generate-docs'. The following was the diff"
62+
echo "Please update the documentation by running 'npm run gen'. The following was the diff"
6363
cat $diff_file
6464
rm $diff_file
6565
exit 1

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ You can use the `DEBUG` environment variable as usual to control categories that
102102

103103
### Updating documentation
104104

105-
When adding a new tool or updating a tool name or description, make sure to run `npm run docs` to generate the tool reference documentation.
105+
When adding a new tool or updating a tool name or description, make sure to run `npm run gen` to generate the tool reference documentation.
106106

107107
### Contributing to Evals
108108

docs/slim-tool-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run docs' to update-->
1+
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->
22

33
# Chrome DevTools MCP Slim Tool Reference (~359 cl100k_base tokens)
44

docs/tool-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run docs' to update-->
1+
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->
22

33
# Chrome DevTools MCP Tool Reference (~6940 cl100k_base tokens)
44

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"typecheck": "tsc --noEmit",
1414
"format": "eslint --cache --fix . && prettier --write --cache .",
1515
"check-format": "eslint --cache . && prettier --check --cache .;",
16-
"docs": "npm run build && npm run docs:generate && npm run format",
16+
"gen": "npm run build && npm run docs:generate && npm run cli:generate && npm run format",
1717
"docs:generate": "node --experimental-strip-types scripts/generate-docs.ts",
1818
"start": "npm run build && node build/src/index.js",
1919
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/index.js",

scripts/generate-docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ async function generateReference(
323323
console.log(`Found ${toolsWithAnnotations.length} tools`);
324324

325325
// Generate markdown documentation
326-
let markdown = `<!-- AUTO GENERATED DO NOT EDIT - run 'npm run docs' to update-->
326+
let markdown = `<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->
327327
328328
# ${title} (~${(await measureServer(serverArgs)).tokenCount} cl100k_base tokens)
329329

src/bin/cliDefinitions.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export const commands: Commands = {
287287
},
288288
lighthouse_audit: {
289289
description:
290-
'Get Lighthouse score and reports for accessibility, SEO and best practices.',
290+
'Get Lighthouse score and reports for accessibility, SEO and best practices. This excludes performance. For performance audits, run performance_start_trace',
291291
category: 'Debugging',
292292
args: {
293293
mode: {
@@ -393,7 +393,8 @@ export const commands: Commands = {
393393
args: {},
394394
},
395395
navigate_page: {
396-
description: 'Navigates the currently selected page to a URL.',
396+
description:
397+
'Go to a URL, or back, forward, or reload. Use project URL if not specified otherwise.',
397398
category: 'Navigation automation',
398399
args: {
399400
type: {
@@ -441,7 +442,8 @@ export const commands: Commands = {
441442
},
442443
},
443444
new_page: {
444-
description: 'Creates a new page',
445+
description:
446+
'Open a new tab and load a URL. Use project URL if not specified otherwise.',
445447
category: 'Navigation automation',
446448
args: {
447449
url: {
@@ -496,22 +498,24 @@ export const commands: Commands = {
496498
},
497499
performance_start_trace: {
498500
description:
499-
'Starts a performance trace recording on the selected page. This can be used to look for performance problems and insights to improve the performance of the page. It will also report Core Web Vital (CWV) scores for the page.',
501+
'Start a performance trace on the selected webpage. Use to find frontend performance issues, Core Web Vitals (LCP, INP, CLS), and improve page load speed.',
500502
category: 'Performance',
501503
args: {
502504
reload: {
503505
name: 'reload',
504506
type: 'boolean',
505507
description:
506508
'Determines if, once tracing has started, the current selected page should be automatically reloaded. Navigate the page to the right URL using the navigate_page tool BEFORE starting the trace if reload or autoStop is set to true.',
507-
required: true,
509+
required: false,
510+
default: true,
508511
},
509512
autoStop: {
510513
name: 'autoStop',
511514
type: 'boolean',
512515
description:
513516
'Determines if the trace recording should be automatically stopped.',
514-
required: true,
517+
required: false,
518+
default: true,
515519
},
516520
filePath: {
517521
name: 'filePath',
@@ -524,7 +528,7 @@ export const commands: Commands = {
524528
},
525529
performance_stop_trace: {
526530
description:
527-
'Stops the active performance trace recording on the selected page.',
531+
'Stop the active performance trace recording on the selected webpage.',
528532
category: 'Performance',
529533
args: {
530534
filePath: {

0 commit comments

Comments
 (0)