Introduction¶
The DSH (DeepSeek Harness) plugin ecosystem emphasizes “everything is a plugin”: it hooks external CLI, testing, reporting, and other capabilities into the surface of tools callable by the agent.
dsh-playwright-cli is designed for DSH agent developers. It encapsulates several common Playwright CLI actions into a host plugin tool, allowing the agent to directly probe the CLI, install browsers, run tests, and open HTML reports within the session, rather than requiring the user to manually switch to the shell and assemble npx playwright commands.
Overview¶
- Plugin Name:
dsh-playwright-cli - Maintainer:
mitao-su - License: MIT
- Runtime Surface: Host-only execution, no client bundle, no web dependencies
- Distribution Method:
lib/is committed to Git; installation does not trigger build scripts; zero interaction - Execution Interface: Reuses DSH’s provided shell executor (
ctx.shell); sandbox strategy,DSH_*environment variables, output truncation, and timeout/abort classification are provided by the composition
Core Features¶
Tool List¶
| Tool | Purpose | Underlying / Corresponding Command |
|---|---|---|
playwright_version |
Probe if Playwright CLI is available in the target project and print the version | npx --no-install playwright --version |
playwright_install |
Install browsers (default: chromium); if the CLI is missing and autoInstallPackage is enabled, use the npm scaffolding @playwright/test first |
npx --no-install playwright install [browsers...] |
playwright_test |
Run Playwright test suites; supports options like --config/--project/--grep/--workers/--reporter/--headed/--trace/--retries/--list |
npx --no-install playwright test ... |
playwright_show_report |
Locate the HTML report: registers a loopback route and returns the URL when a web server is available; otherwise, returns the absolute path of the file | playwright-report/index.html static service |
All commands are executed by default in the session working directory (session cwd). A non-zero exit code is reported as a result to the agent instead of throwing an error directly, allowing the model to judge the next step itself.
How it Runs¶
dsh-playwright-cli is a host-only plugin. Commands are ultimately executed via ctx.shell, therefore:
- Uses the permissions and sandbox strategy possessed by the current DSH process/composition;
- Output will go through DSH’s output truncation, timeout/abort classification;
DSH_*environment variables are provided by the DSH composition.
Installation and Activation¶
Before installation, ensure the following:
- DSH version is not lower than
0.1.0-rc.6; - The target profile has the shell executor mounted; standard
web/headlesscombinations come with it.
Standard installation:
dsh plugin --profile web add github:mitao-su/dsh-playwright-cli
When using Git distribution, the repository commits lib/ to Git, and installation does not trigger build scripts. After successful installation, restart the target profile. The README states that dsh plugin automatically adds the package to dsh.profile.bundles.
In restricted network environments, the github: dependency requires local git to access GitHub; alternatively, you can use a GitHub tarball URL:
dsh plugin --profile web add https://github.com/mitao-su/dsh-playwright-cli/archive/refs/heads/main.tar.gz
Local path or development installation:
dsh plugin --profile web add ./dsh-playwright-cli
You can also use the file prefix form:
dsh plugin --profile web add file:./dsh-playwright-cli
peerDependencies requirements in package.json:
{
"@deepseek-ai/cordis": "^4.0.1",
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
"@deepseek-ai/dsh-sandbox": "0.1.0-rc.6",
"@deepseek-ai/dsh-shell": "0.1.0-rc.6",
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
"@deepseek-ai/schemastery": "3.18.1"
}
Typical Usage¶
A typical session can proceed with the following steps:
- Call
playwright_versionto confirm Playwright CLI is ready in the default session working directory; - Call
playwright_testwith example parameters:
{
"files": ["tests/login.spec.ts"],
"reporter": "html"
}
After running, reportDir is obtained;
- Call
playwright_show_reportto get theurland open the HTML report in a browser; if there is no web server, the absolute path of the file is returned.
The README provides a profile configuration example, overriding the entire block with id: playwright-cli:
- insert:
- id: playwright-cli
name: dsh-playwright-cli
config:
timeoutMs: 600000
reportDir: playwright-report
reportRoute: /playwright-report
autoInstallPackage: true
Where:
timeoutMs: 600000: Default timeout for each CLI call;reportDir: playwright-report: Report directory;reportRoute: /playwright-report: Report route prefix;autoInstallPackage: true: Automaticallynpm install -D @playwright/testwhen the CLI is missing.
Use Cases and Notes¶
Who is it for¶
Suitable for scenarios where Playwright tests need to be executed automatically in the DSH agent loop, report addresses need to be retrieved, and the target project already has or is prepared to install the local @playwright/test.
Permissions and Sandbox¶
The plugin runs with the permissions of the current DSH process, and commands enter the sandbox via the DSH shell executor. Browser binary downloads to the user directory, playwright test forking worker subprocesses, etc., may all be denied by the file sandbox. In such cases, the result will carry a [sandbox: file access denied ...] tag and an escalation prompt.
playwright_version, playwright_install, and playwright_test provide sandbox_permissions + justification parameters. After a sandbox denial, the same command should be retried using the narrowest mode that succeeds, such as danger-full-access. A user approval prompt will appear before execution, and it only takes effect for this specific call upon approval.
Before installation, you should check the source code, dependency scope, and MIT license.
Local Dependency Constraints¶
Tools are resolved using npx --no-install and only recognize the local @playwright/test in the workdir; they do not use the global CLI.
If the spec file require('@playwright/test') in the workdir resolves to a local copy, while the CLI command hits the global one, errors like test.describe() not expected here may occur. You should point workdir to a project directory containing the local @playwright/test, or scaffold it first using playwright_install.
Quoting¶
Parameters are automatically and safely quoted according to the dialect of the mounted shell (bash/pwsh); paths containing single quotes need to be renamed first.
Report Routing¶
Each call to playwright_show_report registers a /playwright-report/<nonce> loopback route, and the plugin releases it uniformly upon uninstallation. The same report can be called multiple times.
Concurrency Limits¶
playwright_test and playwright_install are declared as non-concurrent because they share the test-results / report directory.
Conclusion¶
dsh-playwright-cli connects Playwright’s “probe—install—test—report” actions into a tool surface callable by the DSH agent. The license is MIT, and the repository address is:
- GitHub: https://github.com/mitao-su/dsh-playwright-cli
- Plugin page link (from plugin hint, not verified against body text): https://www.skillhub.cn/plugins/mitao-su/dsh-playwright-cli