mitao-su/dsh-playwright-cli

DeepSeek Harness(DSH)宿主插件,封装了 Playwright CLI:安装浏览器、运行测试、在代理循环中打开 HTML 报告。

Project Overview项目介绍

This is a native DSH host plugin that wraps the official Playwright CLI into a collection of tools that DeepSeek Harness agents can invoke directly without manual command input. It ships with a DSH bundle manifest and is installed directly via the DSH plugin command: you can run dsh plugin --profile web add github:mitao-su/dsh-playwright-cli to add it to your web profile. Because all build artifacts are committed directly to the Git repository, no build scripts are triggered during installation, and you do not need to configure allowBuilds for it to work properly. It requires DSH version 0.1.0-rc.6 or newer, and that your target profile already has the shell executor mounted, which is standard for default DSH web and headless profiles.

This plugin is built for developers who want to integrate Playwright end-to-end testing into their DSH agent workflow. A typical agent session starts with running playwright_version to confirm that Playwright CLI is available in the current session working directory. Next, the agent runs playwright_test with specified options to run the target test suite and generate an HTML report. Finally, the agent calls playwright_show_report to get a URL or file path to the report, which the user can then open directly in their browser. All commands run in the session working directory by default, and non-zero exits are reported not treated as errors, leaving the agent to decide next steps.

This plugin is released under the open source MIT license, and has several key constraints users should note before installation and use. All commands go through the DSH shell executor sandbox, so operations like downloading browser binaries or forking worker processes may be blocked by file sandbox rules. If a command is blocked, the plugin will prompt the user to approve wider permissions and retry with the narrowest possible access that works. It also notes that you should point your working directory to a project that has a local installation of @playwright/test to avoid duplicate copy conflicts. Other caveats include avoiding paths with single quotes and that test commands cannot run concurrently.

这是一个专为DeepSeek Harness(DSH)打造的原生主机插件,将Playwright CLI封装成DSH代理可一键调用的工具集,支持探测版本、安装浏览器、运行测试、打开HTML报告,全程无需手动输入npx playwright ...命令。它仅在主机侧运行,无客户端包和Web依赖,复用DSH官方shell执行器,继承了其沙箱策略、环境变量和超时处理机制。

该插件面向需要在DSH代理工作流中集成Playwright测试的开发者,典型工作流程为:先调用playwright_version确认当前工作区Playwright CLI可用,再调用playwright_test运行指定测试用例并生成HTML报告,最后调用playwright_show_report获取报告地址,用户即可直接在浏览器打开查看。所有命令默认在会话工作区执行,非零退出仅报告结果不报错,由模型自行判断下一步操作。

该插件使用MIT许可证,要求DSH版本不低于0.1.0-rc.6,且目标配置文件已挂载shell执行器,安装可通过dsh plugin --profile web add github:mitao-su/dsh-playwright-cli命令完成,无需构建脚本,零交互安装。使用时需注意沙箱权限、双副本冲突、路径引号和并发限制等问题,符合约束即可正常调用所有工具。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:mitao-su/dsh-playwright-cli

把 mitao-su/dsh-playwright-cli 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

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: 前缀

使用示例

Agent 侧一次典型会话:

  1. playwright_version(workdir 默认会话工作区)→ 确认 CLI 就绪;
  2. playwright_test(files: ["tests/login.spec.ts"],reporter: "html")→ 跑测试,得到 reportDir;
  3. playwright_show_report → 拿到 url,用户直接在浏览器打开报告。

配置(profile cordis.patch.yml 按 id: playwright-cli 整段覆盖):

- insert:
    - id: playwright-cli
      name: dsh-playwright-cli
      config:
        timeoutMs: 600000          # 每次 CLI 调用的默认超时
        reportDir: playwright-report
        reportRoute: /playwright-report
        autoInstallPackage: true   # CLI 缺失时自动 npm install -D @playwright/test

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-dev-sandbox 下一个 Next dsh-plugin-wechat-bridge →