pi-bash-to-ps
v0.1.0
Published
pi extension that transpiles LLM-generated bash commands to PowerShell on Windows
Maintainers
Readme
pi-bash-to-ps
A pi extension that lets AI coding agents write bash commands on Windows — they get transpiled to PowerShell and run natively. No Git Bash or WSL required.
LLM generates: ls -la src/ | grep TODO | wc -l
↓ transpiled
Executes: Get-ChildItem ... | Select-String ... | Measure-Object -LineThe extension overrides pi's built-in bash tool transparently — the LLM never knows anything is different. Same tool name, same schema, same output format.
Install
# Clone anywhere
git clone https://github.com/Paul-Yuchao-Dong/pi-bash-to-ps
cd pi-bash-to-ps
npm install
# Test with
pi -e ./index.tsOr install globally as a pi package:
pi install github.com/Paul-Yuchao-Dong/pi-bash-to-psHow it works
On bash tool calls, the extension:
- Transpiles the bash command to PowerShell via joyi-ai/bash-to-powershell
- Spawns
pwsh.exe(PS 7) orpowershell.exe(PS 5.1) with the transpiled command - Falls back to the original bash command via the system shell if transpilation fails
- No-ops on macOS and Linux — the built-in bash tool is untouched
Native tools (rg, fd, curl.exe, jq) are auto-detected and preferred over PowerShell cmdlet fallbacks.
Platform support
| OS | Behavior | |----|----------| | Windows | Bash → transpile → PowerShell | | macOS / Linux | No-op (built-in bash tool unchanged) |
Architecture decisions
See docs/adr/0001-override-bash-tool.md for why we chose to override the tool rather than intercept events.
Attribution
bash-to-powershell — the transpiler that powers this extension.
- GitHub: joyi-ai/bash-to-powershell
- License: MIT
- Vendored at
bash-to-powershell/withLICENSE
License
MIT
