{"_id":"@dyyz1993/xpage","_rev":"6-13d77e89814d671284680171d8e07d09","name":"@dyyz1993/xpage","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@dyyz1993/xpage","version":"1.0.0","keywords":["playwright","browser","automation","cdp","cli"],"author":{"name":"dyyz1993"},"license":"MIT","_id":"@dyyz1993/xpage@1.0.0","maintainers":[{"name":"dyyz1993","email":"dyyz1993@qq.com"}],"bin":{"xpage":"dist/bin/mpage.js"},"dist":{"shasum":"318464c6b4bbe044c41a851c1ae261cfd7aeae5d","tarball":"https://registry.npmjs.org/@dyyz1993/xpage/-/xpage-1.0.0.tgz","fileCount":30,"integrity":"sha512-4H6jQxLMwC0LFLRQARY8QbhlbGRAsK46pCP9h2HzcKaFs7+SlS7VnBkX7ETRLotbWgh0T5nlPHBEksTYK+igbw==","signatures":[{"sig":"MEQCIExfq88KbS5Kqp/UQdlgtgtzPVMeukad9TmOc5Ty+6Q2AiB0k0bit4d9FQjrTiI+lt99OobUb0wyZ1DkC11dyAougg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":152036},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"dist/src/index.d.ts","import":"dist/src/index.js"}},"gitHead":"93cf6b0d11c76dc126dc068bda9a8673675e927c","scripts":{"dev":"npx tsx bin/mpage.ts","lint":"eslint . --ext .ts,.tsx","test":"tsx --test tests/**/*.test.ts","build":"tsup","xpage":"npx tsx bin/mpage.ts","lint:fix":"eslint . --ext .ts,.tsx --fix","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"dyyz1993","email":"dyyz1993@qq.com"},"repository":{"url":"","type":"git"},"_npmVersion":"11.6.2","description":"Playwright browser automation CLI with CDP support","directories":{},"_nodeVersion":"25.2.1","dependencies":{"zod":"^3.24.0","playwright-core":"^1.58.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","tsup":"^8.0.0","eslint":"^8.57.0","typescript":"^5.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^7.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/xpage_1.0.0_1773556462771_0.2387864426105888","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@dyyz1993/xpage","version":"1.0.2","keywords":["playwright","browser","automation","cdp","cli"],"author":{"name":"dyyz1993"},"license":"MIT","_id":"@dyyz1993/xpage@1.0.2","maintainers":[{"name":"dyyz1993","email":"dyyz1993@qq.com"}],"bin":{"mpage":"dist/bin/mpage.js"},"dist":{"shasum":"63c3413d0fc1bc67755a777443ebd0e46e9cb09e","tarball":"https://registry.npmjs.org/@dyyz1993/xpage/-/xpage-1.0.2.tgz","fileCount":11,"integrity":"sha512-czWq/QBk8Q6nGHE0FzpMqFAg3y83sHuYPrFVKkN6MSOv+RhLKpnjLkrtlLVKhjs4Gdqdfm4SBlycPY8d84abpw==","signatures":[{"sig":"MEUCIQCKnu8fSShGm0oFpHvZlQkbn/gtjXQUJETo67FoRipCvgIgU07nLlr4rYfT5NULOis3iv3NBV8IEkhXBKHR5SbkVxE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":762082},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"dist/src/index.d.ts","import":"dist/src/index.js"}},"gitHead":"f371d6d4e254cf0ace86cc60cb764a42700a9b3e","scripts":{"dev":"npx tsx bin/mpage.ts","lint":"eslint . --ext .ts,.tsx","test":"tsx --test tests/**/*.test.ts","build":"tsup","xpage":"npx tsx bin/mpage.ts","format":"prettier --write \"src/**/*.ts\" \"bin/**/*.ts\" \"tests/**/*.ts\"","prepare":"husky","lint:fix":"eslint . --ext .ts,.tsx --fix","validate":"npm run typecheck && npm run lint && npm run build && npm test","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.ts\" \"bin/**/*.ts\" \"tests/**/*.ts\"","test:plugins":"vitest run tests/e2e","validate:xcli":"cd xcli && npm run typecheck && npm run lint && npm test","prepublishOnly":"npm run build","validate:mpage":"npm run typecheck && npm run lint && npm run build","metadata:report":"tsx tools/metadata-query.ts report","improvement:report":"tsx tools/improvement-tracker.ts report","test:plugins:watch":"vitest tests/e2e","test:plugins:report":"tsx tools/test-reporter.ts"},"_npmUser":{"name":"dyyz1993","email":"dyyz1993@qq.com"},"repository":{"url":"","type":"git"},"_npmVersion":"11.6.2","description":"Playwright browser automation CLI with CDP support","directories":{},"lint-staged":{"*.ts":["prettier --write","eslint --fix"],"xcli/src/**/*.ts":["prettier --write","eslint --fix --config xcli/.eslintrc.cjs --no-ignore"],"xcli/tests/**/*.ts":["prettier --write"]},"_nodeVersion":"25.2.1","dependencies":{"zod":"^3.24.0","yaml":"^2.8.2","playwright":"^1.59.1","playwright-core":"^1.58.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","tsup":"^8.0.0","husky":"^9.1.7","jsdom":"^29.0.0","eslint":"^8.57.0","vitest":"^4.1.0","prettier":"^3.8.1","typescript":"^5.0.0","@types/node":"^20.0.0","lint-staged":"^16.4.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","@typescript-eslint/parser":"^7.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/xpage_1.0.2_1777732472410_0.7455910266671728","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@dyyz1993/xpage","version":"1.0.3","keywords":["playwright","browser","automation","cdp","recording","playback","engine"],"author":{"name":"dyyz1993"},"license":"MIT","_id":"@dyyz1993/xpage@1.0.3","maintainers":[{"name":"dyyz1993","email":"dyyz1993@qq.com"}],"dist":{"shasum":"a25a153922d3788852615da7a1e7b155a2931a04","tarball":"https://registry.npmjs.org/@dyyz1993/xpage/-/xpage-1.0.3.tgz","fileCount":11,"integrity":"sha512-XCY4JJ/8kGAKOuQuNfZDQPdJeBPYdNrnasI0S26d7SuIHZDJURonIOwbN9RgPmgyzjLbcQIpt0nwL8Ez9y3t8w==","signatures":[{"sig":"MEQCID4iIN2Yyh5lHuCYJZZRgeUFe3H0PanfRjqqGqXcLkxQAiArosrkktVt9cOoxnMAATcvZhRoVQMDm9Iy56j+EbTAmg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":781838},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"87fdbbef7a29bce819001bfbf10980e4a1396e2f","private":false,"scripts":{"lint":"eslint . --ext .ts,.tsx","test":"tsx --test tests/**/*.test.ts","build":"pnpm run build:packages && tsup","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","prepare":"husky","lint:fix":"eslint . --ext .ts,.tsx --fix","validate":"npm run typecheck && npm run lint && npm run build && npm test","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","lint:packages":"pnpm -r --filter './packages/*' --stream run lint","build:packages":"pnpm -r --filter './packages/*' --sort --workspace-concurrency=1 run build","prepublishOnly":"npm run build","typecheck:packages":"pnpm -r --filter './packages/*' --stream run typecheck"},"_npmUser":{"name":"dyyz1993","email":"dyyz1993@qq.com"},"repository":{"url":"","type":"git"},"_npmVersion":"11.6.2","description":"Browser automation engine library based on Playwright","directories":{},"lint-staged":{"*.ts":["prettier --write","eslint --fix"]},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.20.0","zod":"^3.24.0","yaml":"^2.8.2","playwright":"^1.59.1","playwright-core":"^1.58.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","jiti":"^2.6.1","tsup":"^8.0.0","husky":"^9.1.7","jsdom":"^29.0.0","eslint":"^8.57.0","vitest":"^4.1.0","prettier":"^3.8.1","@types/ws":"^8.18.1","typescript":"^5.0.0","@types/node":"^20.0.0","lint-staged":"^16.4.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","@typescript-eslint/parser":"^7.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/xpage_1.0.3_1778076378747_0.05703725120665215","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@dyyz1993/xpage","version":"1.0.4","keywords":["playwright","browser","automation","cdp","recording","playback","engine"],"author":{"name":"dyyz1993"},"license":"MIT","_id":"@dyyz1993/xpage@1.0.4","maintainers":[{"name":"dyyz1993","email":"dyyz1993@qq.com"}],"dist":{"shasum":"782628b13cd1811865577d95485d714c8a06eff2","tarball":"https://registry.npmjs.org/@dyyz1993/xpage/-/xpage-1.0.4.tgz","fileCount":5,"integrity":"sha512-PgUzKXL3NW5qHee8yw7yU3+4H2AnH8ML0GyfIp84vlWnW4W+CuXsbDakpmBKx5yLakFPLIuHvwV43ouSAamxBA==","signatures":[{"sig":"MEQCIEPOehEUu0BBFnrarItzyhsh6W+Pwq+miG0HGXaP9SeqAiBE0/OXyeJZCxzxUQA3EXLI4Wbf0rthe5hECuy/nmSAZA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":368808},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"92a9d89a2412bfed6169f46c2fbd7073821abc49","private":false,"scripts":{"lint":"eslint . --ext .ts,.tsx","test":"vitest run","build":"pnpm run build:root && pnpm run build:packages","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","prepare":"husky","docs:dev":"cd website && npm run docs:dev","lint:fix":"eslint . --ext .ts,.tsx --fix","test:all":"vitest run && pnpm run test:core","validate":"npm run typecheck && npm run lint && npm run build && npm run test","test:core":"cd packages/core && vitest run","typecheck":"tsc --noEmit","build:root":"tsup","docs:build":"cd website && npm run docs:build","docs:preview":"cd website && npm run docs:preview","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","lint:packages":"pnpm -r --filter './packages/*' --stream run lint","build:packages":"pnpm -r --filter './packages/*' --sort --workspace-concurrency=1 run build","prepublishOnly":"npm run build","typecheck:packages":"pnpm -r --filter './packages/*' --stream run typecheck"},"_npmUser":{"name":"dyyz1993","email":"dyyz1993@qq.com"},"repository":{"url":"","type":"git"},"_npmVersion":"11.6.2","description":"Browser automation engine library based on Playwright","directories":{},"lint-staged":{"*.ts":["prettier --write","eslint --fix"]},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.20.0","zod":"^3.24.0","yaml":"^2.8.2","playwright":"^1.59.1","playwright-core":"^1.58.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","jiti":"^2.6.1","tsup":"^8.0.0","husky":"^9.1.7","jsdom":"^29.0.0","eslint":"^8.57.0","vitest":"^4.1.0","prettier":"^3.8.1","@types/ws":"^8.18.1","typescript":"^5.0.0","@types/node":"^20.0.0","lint-staged":"^16.4.0","@dyyz1993/xcli-core":"^0.6.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","@typescript-eslint/parser":"^7.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/xpage_1.0.4_1778564904869_0.5139158558922192","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@dyyz1993/xpage","version":"1.0.5","keywords":["playwright","browser","automation","cdp","recording","playback","engine"],"author":{"name":"dyyz1993"},"license":"MIT","_id":"@dyyz1993/xpage@1.0.5","maintainers":[{"name":"dyyz1993","email":"dyyz1993@qq.com"}],"dist":{"shasum":"b0726bdcd6a12540ba0dd71b4688be71cc5d3de3","tarball":"https://registry.npmjs.org/@dyyz1993/xpage/-/xpage-1.0.5.tgz","fileCount":5,"integrity":"sha512-owQiThHAmnhaHK/p33B7usFysi4XeHt4ffFVz1tJyAA8HAFNR5VjVVMLUnCF2yJ1oqH2AUbGzyz+0ZFxtrEWjw==","signatures":[{"sig":"MEUCIArHu1afplyNxz1XWdWS4DQVCP75ZykF7zbuKu7n7XqpAiEAvHKxC56YfHGcyxT5Ev96tDCsgnaSEN2YBzigVxWBZt4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":366938},"main":"dist/src/index.js","pnpm":{"overrides":{"playwright":"^1.59.1","playwright-core":"^1.58.2"}},"type":"module","types":"dist/src/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"e23e20860a8a64f6d699fbaa91090ca381fd4f0e","private":false,"scripts":{"lint":"eslint . --ext .ts,.tsx","test":"vitest run","build":"pnpm run build:root && pnpm run build:packages","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","prepare":"husky","docs:dev":"cd website && npm run docs:dev","lint:fix":"eslint . --ext .ts,.tsx --fix","test:all":"vitest run && pnpm run test:core","validate":"npm run typecheck && npm run lint && npm run build && npm run test","test:core":"cd packages/core && vitest run","typecheck":"tsc --noEmit","build:root":"tsup","docs:build":"cd website && npm run docs:build","docs:preview":"cd website && npm run docs:preview","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","lint:packages":"pnpm -r --filter './packages/*' --stream run lint","build:packages":"pnpm -r --filter './packages/*' --sort --workspace-concurrency=1 run build","prepublishOnly":"npm run build","typecheck:packages":"pnpm -r --filter './packages/*' --stream run typecheck"},"_npmUser":{"name":"dyyz1993","email":"dyyz1993@qq.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.2","description":"Browser automation engine library based on Playwright","directories":{},"lint-staged":{"*.ts":["prettier --write","eslint --fix"]},"_nodeVersion":"20.20.2","dependencies":{"ws":"^8.20.0","zod":"^3.24.0","yaml":"^2.8.2","playwright":"^1.59.1","playwright-core":"^1.58.2"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","jiti":"^2.6.1","tsup":"^8.0.0","husky":"^9.1.7","jsdom":"^29.0.0","eslint":"^8.57.0","vitest":"^4.1.0","prettier":"^3.8.1","@types/ws":"^8.18.1","typescript":"^5.0.0","@types/node":"^20.0.0","lint-staged":"^16.4.0","@dyyz1993/xcli-core":"workspace:*","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","@typescript-eslint/parser":"^7.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/xpage_1.0.5_1778636107880_0.7869094767706644","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@dyyz1993/xpage","version":"1.0.6","description":"Browser automation engine library based on Playwright","private":false,"type":"module","main":"dist/src/index.js","types":"dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"scripts":{"build:root":"tsup","build:packages":"pnpm -r --filter './packages/*' --sort --workspace-concurrency=1 run build","build":"pnpm run build:root && pnpm run build:packages","lint":"eslint . --ext .ts,.tsx","lint:packages":"pnpm -r --filter './packages/*' --stream run lint","lint:fix":"eslint . --ext .ts,.tsx --fix","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","typecheck":"tsc --noEmit","typecheck:packages":"pnpm -r --filter './packages/*' --stream run typecheck","test":"vitest run","test:core":"cd packages/core && vitest run","test:all":"vitest run && pnpm run test:core","prepublishOnly":"npm run build","prepare":"husky","validate":"npm run typecheck && npm run lint && npm run build && npm run test","docs:dev":"cd website && npm run docs:dev","docs:build":"cd website && npm run docs:build","docs:preview":"cd website && npm run docs:preview"},"lint-staged":{"*.ts":["prettier --write","eslint --fix"]},"dependencies":{"playwright":"^1.59.1","playwright-core":"^1.58.2","ws":"^8.20.0","yaml":"^2.8.2","zod":"^3.24.0"},"devDependencies":{"@dyyz1993/xcli-core":"workspace:*","@types/node":"^20.0.0","@types/ws":"^8.18.1","@typescript-eslint/eslint-plugin":"^7.0.0","@typescript-eslint/parser":"^7.0.0","eslint":"^8.57.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","husky":"^9.1.7","jiti":"^2.6.1","jsdom":"^29.0.0","lint-staged":"^16.4.0","prettier":"^3.8.1","tsup":"^8.0.0","tsx":"^4.0.0","typescript":"^5.0.0","vitest":"^4.1.0"},"keywords":["playwright","browser","automation","cdp","recording","playback","engine"],"author":{"name":"dyyz1993"},"license":"MIT","repository":{"type":"git","url":""},"pnpm":{"overrides":{"playwright":"^1.59.1","playwright-core":"^1.58.2"}},"engines":{"node":">=18.0.0"},"gitHead":"68b305702e4479ba41edda4bd2794d6e910b8a3c","_id":"@dyyz1993/xpage@1.0.6","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-5rnObUIcV2kLQ0957MLIILnldbSXB6VIne1tt/YOB0NaIOaSckIixZ31z/wNI/LfcK7IiuL16P7ukc11u8uQSA==","shasum":"fe5435cf96d590bbc38b5c1e3d2a57d902dd3333","tarball":"https://registry.npmjs.org/@dyyz1993/xpage/-/xpage-1.0.6.tgz","fileCount":5,"unpackedSize":408432,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDCAsgpwUNufHXTF/lYKg+bdbBPeXO0fxIgZKNhc+Q+OAiAHJLBF5Powl/6dnV/daKzDHGfg47LN4jZp3yvYgBgKfw=="}]},"_npmUser":{"name":"dyyz1993","email":"dyyz1993@qq.com"},"directories":{},"maintainers":[{"name":"dyyz1993","email":"dyyz1993@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/xpage_1.0.6_1780149045547_0.44483315755958364"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-15T06:34:22.664Z","modified":"2026-05-30T13:50:45.823Z","1.0.0":"2026-03-15T06:34:22.936Z","1.0.2":"2026-05-02T14:34:32.637Z","1.0.3":"2026-05-06T14:06:19.010Z","1.0.4":"2026-05-12T05:48:25.004Z","1.0.5":"2026-05-13T01:35:08.022Z","1.0.6":"2026-05-30T13:50:45.704Z"},"author":{"name":"dyyz1993"},"license":"MIT","keywords":["playwright","browser","automation","cdp","recording","playback","engine"],"repository":{"type":"git","url":""},"description":"Browser automation engine library based on Playwright","maintainers":[{"name":"dyyz1993","email":"dyyz1993@qq.com"}],"readme":"[![Documentation](https://img.shields.io/badge/docs-xcli-blue?style=for-the-badge&logo=vite)](https://dyyz1993.github.io/mpage/)\n[![CI](https://img.shields.io/github/actions/workflow/status/dyyz1993/mpage/ci.yml?branch=master&style=for-the-badge&logo=github)](https://github.com/dyyz1993/mpage/actions)\n\n[![npm xpage](https://img.shields.io/npm/v/@dyyz1993/xpage?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@dyyz1993/xpage) [![npm xcli-core](https://img.shields.io/npm/v/@dyyz1993/xcli-core?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@dyyz1993/xcli-core) [![npm create-xcli](https://img.shields.io/npm/v/create-xcli?style=for-the-badge&logo=npm&label=create-xcli)](https://www.npmjs.com/package/create-xcli)\n\n[![Coverage](https://img.shields.io/codecov/c/github/dyyz1993/mpage/master?style=for-the-badge&logo=codecov)](https://codecov.io/gh/dyyz1993/mpage)\n[![License](https://img.shields.io/npm/l/@dyyz1993/xpage?style=for-the-badge)](https://github.com/dyyz1993/mpage/blob/master/LICENSE)\n\n# mpage\n\n**插件化 CLI 框架 + 浏览器自动化引擎**，5 分钟创建你的领域 CLI 工具。\n\n## 它能做什么？\n\n- **浏览器自动化** — 35+ 页面命令、录制/回放、页面结构提取\n- **插件系统** — TypeScript 运行时加载，命令覆盖/增强\n- **脚手架** — 一条命令生成项目，5 种模板覆盖常见场景\n- **通用框架** — 领域无关的核心设计，不绑定浏览器/数据库/API\n\n## 快速开始\n\n### 1. 创建项目\n\n```bash\nnpx create-xcli my-tool\n```\n\n交互式选择模板：`base` / `browser` / `database` / `api` / `plugin`。\n\n### 2. 浏览器自动化（@dyyz1993/xpage）\n\n```typescript\nimport { executePageCommand, RecorderController, PlaybackEngine } from '@dyyz1993/xpage';\nimport { chromium } from 'playwright-core';\n\nconst browser = await chromium.launch();\nconst page = await browser.newPage();\n\n// 导航 + 获取标题\nawait executePageCommand(page, 'goto', { url: 'https://example.com' });\nconst { title } = await executePageCommand(page, 'title', {});\nconsole.log(title); // \"Example Domain\"\n\n// 页面结构提取\nconst { structure } = await executePageCommand(page, 'structure', { selector: 'body' });\n\n// 录制用户操作\nconst recorder = new RecorderController(page);\nawait recorder.start({ url: 'https://example.com', name: 'demo' });\n// ... 用户在浏览器中操作 ...\nconst { path } = await recorder.stop('./recordings/demo.yaml');\n\n// 回放录制\nconst player = await PlaybackEngine.fromFile(page, './recordings/demo.yaml');\nawait player.play({ slowMo: 1 });\n\nawait browser.close();\n```\n\n### 3. 创建 CLI 工具（@dyyz1993/xcli-core）\n\n```typescript\nimport { Core, ok, fail } from '@dyyz1993/xcli-core';\nimport { z } from 'zod';\n\nconst app = new Core({\n  name: 'my-tool',\n  version: '0.1.0',\n  description: '我的 CLI 工具',\n  configDirName: '.my-tool',\n  envPrefix: 'MY_TOOL',\n  pluginDirs: ['./plugins'],\n});\n\nconst site = app.loader.getAPI().createSite({\n  name: 'builtin',\n  url: 'https://example.com',\n});\n\nsite.command('hello', {\n  description: '打个招呼',\n  parameters: z.object({ name: z.string().default('World') }),\n  handler: async (params, ctx) => {\n    return ok({ message: `Hello, ${params.name}!` }, [`向 ${params.name} 打了招呼`]);\n  },\n});\n\nawait app.run(process.argv.slice(2));\n```\n\n### 4. 开发插件\n\n```typescript\nimport type { XCLIAPI } from '@dyyz1993/xcli-core';\nimport { ok } from '@dyyz1993/xcli-core';\nimport { z } from 'zod';\n\nexport default function (xcli: XCLIAPI): void {\n  const site = xcli.createSite({\n    name: 'my-plugin',\n    url: 'https://example.com',\n  });\n\n  site.command('greet', {\n    description: '问候命令',\n    parameters: z.object({\n      name: z.string().describe('被问候者'),\n      lang: z.enum(['zh', 'en']).default('zh').describe('语言'),\n    }),\n    handler: async (params, ctx) => {\n      const greeting = params.lang === 'zh' ? `你好, ${params.name}!` : `Hello, ${params.name}!`;\n      return ok({ greeting }, [greeting]);\n    },\n  });\n}\n```\n\n## 包结构\n\n本项目是 monorepo，包含以下包：\n\n| 包 | 用途 |\n|---|---|\n| [`@dyyz1993/xcli-core`](https://www.npmjs.com/package/@dyyz1993/xcli-core) | CLI 框架核心 — 插件加载、命令路由、Session 管理、脚手架引擎 |\n| [`@xcli/browser-app`](https://www.npmjs.com/package/@xcli/browser-app) | 浏览器自动化 — 35+ 页面命令、录制/回放、结构提取 |\n| [`create-xcli`](https://www.npmjs.com/package/create-xcli) | 脚手架工具 — 一条命令生成项目 |\n\n## 文档\n\n完整文档：[https://dyyz1993.github.io/mpage/](https://dyyz1993.github.io/mpage/)\n\n- [快速开始](https://dyyz1993.github.io/mpage/guide/installation) — 安装与创建项目\n- [插件开发](https://dyyz1993.github.io/mpage/plugins/overview) — 开发自定义插件\n- [API 参考](https://dyyz1993.github.io/mpage/api/xpage/overview) — 完整 API 文档\n- [录制与回放](https://dyyz1993.github.io/mpage/guide/recording) — 录制和回放用户操作\n- [页面结构提取](https://dyyz1993.github.io/mpage/guide/structure) — 提取语义布局\n\n## 开发\n\n```bash\npnpm install\npnpm run build\npnpm run test\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}