@henryqw/pi-rtk-test
Route direct Pi pnpm test calls through RTK.
Package details
Install @henryqw/pi-rtk-test from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@henryqw/pi-rtk-test- Package
@henryqw/pi-rtk-test- Version
0.2.4- Published
- Oct 2, 2026
- Downloads
- 632/mo · 511/wk
- Author
- henrywang
- License
- MIT
- Types
- extension
- Size
- 5.2 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions/rtk-test.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@henryqw/pi-rtk-test
Keep noisy pnpm test output out of Pi's model context. This extension rewrites supported direct Bash calls through RTK, which reports failures and a compact result instead of the full test log.
Install
pi install npm:@henryqw/pi-rtk-test
Install Rust Token Killer (rtk) on Pi's PATH. This extension does not install or update RTK.
brew install rtk
rtk --version
rtk init -g --agent pi
Use
The rewrite is transparent. Pi changes these direct pnpm test Bash calls before Bash runs them:
| Pi command | Bash command |
|---|---|
pnpm test |
rtk test pnpm test |
pnpm test -- marker |
rtk test pnpm test -- marker |
Leading and trailing whitespace is removed. All other command text stays unchanged.
Flow
When the extension loads, it runs rtk test --help once with a two-second timeout. If RTK responds successfully, supported Bash calls are rewritten as shown above. RTK runs the tests and owns their output and exit status; this extension does not run tests, capture output, or inspect test results.
Limits and recovery
Only direct bare pnpm test commands with optional test arguments are rewritten. These forms are left unchanged:
pnpm run testandpnpm run-script test- Global or workspace options, such as
pnpm --filter pkg test - Quoted or indirect programs, such as
"pnpm" testorenv pnpm test pnpm test:watchand unrelated commands- Newlines, carriage returns,
;,|,&,<,>, backticks, and$( - Every command that begins with
rtk
For an unsupported form, use rtk test ... explicitly. For example, run rtk test pnpm run test.
If the startup probe throws, exits nonzero, is killed, or times out, supported pnpm test calls are blocked with a message to install RTK and verify rtk test --help. Other calls stay unchanged. The package does not warn at startup. After fixing RTK, reload the extension or restart Pi so the probe runs again.