npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

oira666_pi-ssh-remote

v0.1.2

Published

Pi extension that transparently runs core tools on a selected SSH remote project.

Downloads

444

Readme

pi ssh remote

oira666_pi-ssh-remote is a pi extension that makes the built-in read, write, edit, and bash tools operate on a selected SSH project instead of the local filesystem.

The extension is intentionally inert unless pi is started with --ssh-remote.

Installation

pi install npm:oira666_pi-ssh-remote

Usage

Start pi in SSH remote mode:

pi --ssh-remote

Select a configured project explicitly:

pi --ssh-remote --ssh-remote-project "My project"

--ssh-remote-project accepts a project title, server name, project path, or 1-based index. In non-UI modes that are not inline/print mode, either configure exactly one project, pass --ssh-remote-project, or set PI_CODING_AGENT_SSH_REMOTE_PROJECT.

For subprocesses and subagents, the extension exports the selected project as:

PI_CODING_AGENT_SSH_REMOTE_PROJECT='server-name::/exact/remote/project/path'

This variable also selects and enables a project when starting pi yourself. The canonical format is server-name::project-path, where server-name is the top-level key in ssh-remote-config.json and project-path is the exact configured project path. JSON is also accepted for scripting, for example {"serverName":"server-name","projectPath":"/exact/path"}. For backwards compatibility, simple selectors such as project title, server name, path, label, or 1-based index are accepted too.

If pi is launched in inline/print mode (-p / --print), the extension ignores --ssh-remote by itself so inherited command-line arguments do not trigger an interactive picker or fail in non-interactive children. In print mode, remote mode is enabled only when PI_CODING_AGENT_SSH_REMOTE_PROJECT is set.

Configuration

Create ~/.pi/agent/ssh-remote-config.json:

{
  "artlin6-dance": {
    "hostName": "<your host>",
    "user": "<your user>",
    "port": <ssh port>,
    "identityFile": "<path to the ssh key file>",
    "identitiesOnly": true,
    "projects": [
      {
        "title": "Your project title",
        "path": "/remote/project/path"
      }
    ]
  }
}

Each top-level key is a server name. Server fields can use SSH config aliases or explicit settings:

  • host / Host / hostName / HostName
  • user / User
  • port / Port
  • identityFile / IdentityFile
  • password / Password (requires local sshpass; prefer passwordEnv)
  • passwordEnv / PasswordEnv (name of an environment variable containing the password; requires local sshpass)
  • identitiesOnly / IdentitiesOnly
  • sshOptions object for additional -o key=value options
  • projects: array of { "title": string, "path": string }

If host is omitted, the server name is used as the SSH target, which works well with entries in ~/.ssh/config.

Password authentication is supported when sshpass is installed locally. To avoid storing a password in the config file, use passwordEnv:

{
  "example": {
    "hostName": "example.com",
    "user": "deploy",
    "passwordEnv": "PI_CODING_AGENT_SSH_REPOTE_PASSWORD",
    "projects": [{ "title": "App", "path": "/var/www/app" }]
  }
}

Then start pi with PI_CODING_AGENT_SSH_REPOTE_PASSWORD='your password' pi --ssh-remote. Host-key verification still applies; connect once manually with ssh example.com if the host is not in known_hosts yet.

Behavior

When --ssh-remote is not set and PI_CODING_AGENT_SSH_REMOTE_PROJECT is not set, the extension only registers its flags and does not override any tools.

When enabled, pi prompts for a configured project in UI mode, checks the local SSH client and configured key/password prerequisites, probes the remote connection and project directory, exports PI_CODING_AGENT_SSH_REMOTE_PROJECT for child processes, registers remote-backed replacements for read, write, edit, and bash, routes user ! shell commands over SSH, and rewrites the system prompt working directory to the remote project path.

The extension fails closed: if config, authentication, host-key verification, network access, or the remote project path is invalid, pi displays a readable red error and does not let the agent continue as if it were connected.

Error handling

The extension classifies common SSH failures into actionable messages:

  • missing local ssh command
  • missing local sshpass command when password auth is configured
  • unset password environment variable
  • unreadable IdentityFile
  • authentication/public-key/password failure
  • host-key verification failure
  • DNS/host typo
  • connection refused or timeout
  • missing remote project path
  • missing required remote commands

Transient SSH operations are retried once. After repeated infrastructure failures, tools stop retrying and report that the remote appears unavailable instead of spamming raw SSH errors.

Remote hosts need bash, cat, mkdir, and test available.