mitao-su/dsh-playwright-cli ↗★ 2
dsh-playwright-cli
DeepSeek Harness host plugin that wraps the Playwright CLI: install browsers, run tests, and open the HTML report from the agent loop.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:mitao-su/dsh-playwright-cli说明文档
阅读完整 README ↗dsh-playwright-cli
DeepSeek Harness(DSH)host 插件:把 Playwright CLI 封装成 Agent 可一键调用的工具集 —— 探测版本、安装浏览器、跑测试、打开 HTML 报告,全程无需手敲 npx playwright ...。
- 运行面:host-only(无 client bundle,无 Web 依赖)。
- 执行缝:复用官方 shell 执行器(
ctx.shell,与bash/pwsh工具同源),因此 sandbox 策略、DSH_*环境变量、输出截断、超时/中止分类全部由组合提供。 - 分发:
lib/已提交进 Git,安装不触发任何构建脚本,零交互。
工具
| 工具 | 作用 | 底层命令 |
|---|---|---|
playwright_version | 探测目标项目里 CLI 是否可用并打印版本 | npx --no-install playwright --version |
playwright_install | 安装浏览器(默认 chromium);CLI 缺失且 autoInstallPackage 开启时先用 npm 脚手架 @playwright/test | npx --no-install playwright install [browsers...] |
playwright_test | 运行测试套件,支持 --config/--project/--grep/--workers/--reporter/--headed/--trace/--retries/--list 等常用选项 | npx --no-install playwright test ... |
playwright_show_report | 定位 HTML 报告:有 web server 时注册回环路由并返回 URL;否则返回文件绝对路径 | playwright-report/index.html 静态服务 |
所有命令默认在会话工作区(session cwd)中执行,非零退出报告而非报错,由模型自行判断下一步。
安装
要求:目标 profile 已挂载 shell 执行器(标准 web/headless 组合自带;DSH ≥ 0.1.0-rc.6)。
dsh plugin --profile web add github:mitao-su/dsh-playwright-cli
走 Git 分发:本仓库把构建产物
lib/提交进 Git,pnpm 不会执行任何 prepare 脚本,因此无需配置allowBuilds。安装成功后重启目标 profile(dsh plugin会自动把包加入dsh.profile.bundles)。
受限网络备选(github: 依赖需要本机 git 可访问 GitHub):也可直接用 GitHub tarball URL 安装,效果相同:
dsh plugin --profile web add https://github.com/mitao-su/dsh-playwright-cli/archive/refs/heads/main.tar.gz
本地路径/开发安装:
dsh plugin --profile web add ./dsh-playwright-cli # 或 file: 前缀