@gtheys/pi-test-runner
extensionmaintainedPi extension — non-blocking run_tests tool that discovers and runs JS/TS tests via an isolated subagent
by — · v0.1.1 · published 2w ago
$ pi install npm:@gtheys/pi-test-runnerdownloads/mo
0
stars
4
last push
5d ago
open issues
0
Signals
license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0
Download trend
270 downloads · last 12 weeks (weekly)
README
pi-test-runner
⚠️ Experimental / Work in Progress — behaviour may change.
Pi extension that discovers and runs JS/TS test scripts from the nearest package.json, spawning an isolated subagent to execute them. Results are injected back into the session automatically when done — the tool is non-blocking.
How it works
- Scans up from the current directory to find the nearest
package.json. - Extracts scripts matching test patterns (
test,test:*,jest,vitest,playwright,mocha,cypress,e2e,spec). - If multiple scripts exist and no
scriptparam is given, shows a picker. - Detects the package manager from lockfiles (
yarn.lock,pnpm-lock.yaml, fallback tonpm). - Spawns an isolated pi subprocess as the subagent.
- Returns immediately — session is unlocked while tests run.
- Subagent sends
contact_supervisorprogress updates via pi-intercom. - When done,
pi.sendMessage({ triggerTurn: true })re-engages the LLM with structured pass/fail results.
Tool parameters
| Parameter | Type | Description |
|---|---|---|
script | string? | Script key from package.json (e.g. test:unit). Auto-detected if omitted. |
cwd | string? | Working directory to search. Defaults to current project directory. |
model | string? | Model ID for the subagent. Overrides the configured default. |
Commands
/run-tests — run tests, truly non-blocking
/run-tests test:unit — run a specific script
/test-runner — show current config and active runs
/test-runner model <id> — set default subagent model
/test-runner model — show current default model
/test-runner reset — clear all config
/test-runner back — return to the previous session
/run-tests vs run_tests tool
/run-tests command | run_tests tool | |
|---|---|---|
| Triggered by | You (directly) | LLM |
| LLM turn while running | None | One turn for "started", one for results |
| Session stays idle? | ✓ Always | ✗ LLM responds twice |
| When to use | Normal test runs | LLM-driven workflows |
Configuration
Global config: ~/.pi/agent/test-runner/config.json
| Option | Type | Default | Description |
|---|---|---|---|
defaultModel | string | (pi default) | Model ID for the test-runner subagent |
{
"$schema": "./.pi/agent/test-runner/config.schema.json",
"defaultModel": "claude-haiku-4-5"
}