pi-ssh
pi extension for local-model plus remote SSH workspace tool execution
Package details
Install pi-ssh from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-ssh- Package
pi-ssh- Version
0.3.2- Published
- Apr 1, 2026
- Downloads
- 232/mo · 29/wk
- Author
- hjanuschka
- License
- MIT
- Types
- extension
- Size
- 39.3 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-ssh
Run pi locally, work on files remotely over SSH.
pi-ssh is a pi extension that gives you a Cursor-like remote SSH workflow:
- pi runs on your local machine
- model access, API keys, and billing stay local
read,write,edit, andbashrun on a remote host via SSH
Why
This is useful when:
- your code/checkouts live on a VM
- your model/tooling access is easier locally
- you want one local account to drive many remote workspaces
Features
--ssh user@hostor--ssh user@host:/remote/path- optional port:
--ssh-port 2222(alias:-p 2222, default:22) - Remote tool delegation for:
readwriteeditbash
- SSH connection multiplexing (
ControlMaster/ControlPersist) for faster repeated tool calls - Persistent remote shell session for bash commands
- uses your remote account's configured login shell (for example zsh)
- environment persists across commands (for example
export TEST=123) - Ctrl-C interrupts the current remote command but keeps the SSH session alive
- Remote execution for user
!commands - Status indicator in the pi UI when SSH mode is active
- System prompt cwd rewrite to reflect remote cwd
Requirements
- SSH client installed locally
- Passwordless SSH auth recommended (keys/agent)
- Remote host with:
- a standard login shell (for example
zshorbash) cat,test,mkdir,pwd- optional:
file(for image mime detection)
- a standard login shell (for example
Install
Option A: project-local extension
mkdir -p .pi/extensions
cp /path/to/pi-ssh/index.ts .pi/extensions/pi-ssh.ts
Then start pi in your project and pass --ssh.
Option B: global extension
mkdir -p ~/.pi/agent/extensions
cp /path/to/pi-ssh/index.ts ~/.pi/agent/extensions/pi-ssh.ts
Usage
Use remote host default cwd
pi --ssh user@my-vm
# same, explicit default
pi --ssh user@my-vm --ssh-port 22
Use explicit remote workspace path
pi --ssh user@my-vm:/home/user/chromium/src
# custom port
pi --ssh user@my-vm:/home/user/chromium/src -p 2222
You should see a status line similar to:
SSH user@my-vm:/home/user/chromium/src (port 22)
Typical workflow
- Start pi locally with
--ssh ... - Ask pi to inspect/edit files as usual
- All tool operations run remotely
- Keep local model switching, auth, and limits as usual
Notes
- Absolute paths are strongly recommended for the remote path.
- Paths under local
$HOMEare mapped to remote$HOMEin SSH mode (for example~/.config/...). - If
--sshis not set, extension falls back to local tool behavior. - Current version focuses on core coding tools (
read/write/edit/bash).
Troubleshooting
"pi-ssh failed to connect"
Check:
ssh user@host
ssh user@host 'pwd'
Commands work locally but not remotely
Verify remote shell tools exist:
ssh user@host 'which cat test mkdir pwd'
Slow tool calls
bash/! and most read/write/edit operations use a shared persistent SSH session.
Very large writes fall back to one-shot SSH streaming for reliability.
Development
- Spec:
extension-spec.md - Extension entry:
index.ts
License
MIT