pi-powershell
v1.0.3
Published
PowerShell extension for pi - replaces bash with PowerShell on Windows and auto-translates bash commands
Downloads
481
Maintainers
Readme
pi-powershell
PowerShell extension for pi - the terminal coding harness.
Features
- Replaces bash with PowerShell on Windows
- Auto-translates bash commands to PowerShell equivalents
- Preserves native PowerShell cmdlets
Auto-Translation Support
| Bash | PowerShell |
|------|------------|
| ls, ll, la | Get-ChildItem |
| pwd | Get-Location |
| cat file | Get-Content file |
| echo "text" | Write-Output "text" |
| mkdir dir | New-Item -ItemType Directory |
| touch file | New-Item -ItemType File |
| rm -rf dir | Remove-Item -Recurse -Force |
| grep pattern file | Select-String -Pattern |
| ps | Get-Process |
| which cmd | Get-Command \| Select-Object -ExpandProperty Source |
| ls \| grep pattern | Get-ChildItem \| Where-Object |
| ls \| wc -l | Get-ChildItem \| Measure-Object -Line |
| ls \| head -n | Get-ChildItem \| Select-Object -First |
| $HOME, $PATH | $env:HOME, $env:PATH |
| export VAR=value | $env:VAR=value |
Native PowerShell cmdlets pass through unchanged:
!Get-Process | Select-Object -First 5
!Get-Service | Where-Object {$_.Status -eq 'Running'}Installation
npm install -g pi-powershellOr in pi:
pi install pi-powershellRequirements
- Windows (PowerShell 7+ or Windows PowerShell)
- Node.js 18+
Scripts (Windows)
| Command | Description |
|---------|-------------|
| npm run serve | Start static server (foreground) |
| npm run serve:bg | Start server in new window |
| npm run dev:bg | Start dev server in new window |
| npm run http | Simple HTTP server (port 8080) |
| npm run http:bg | HTTP server in new window |
| npm run run -- "cmd" | Run any command in background |
| npm run kill | Kill all node processes |
Examples
# Start server in new window
npm run serve:bg
# Run any command in background
npm run run -- "npm run dev"
npm run run -- "node server.js --port 3000"
npm run run -- "npx next dev"
# Stop all node processes
npm run killLicense
MIT
