# ssh-tools SSH mode for Pi; toggles one remote target and exposes remote read/write/edit/bash tools. ## Install / load Loaded through the root [pi-ext package](../../README.md). ## Commands - `/ssh` — pick a target from `~/.ssh/config`; includes `off` when SSH mode is active. - `/ssh status` — show current target, or `SSH off`. - `/ssh off` — disable SSH mode and remove SSH tools from active tools. - `/ssh [:/path]` — enable SSH mode for a host string. Exact profile names from `~/.ssh/config` win over `host:path` parsing. ## Tools - `ssh_read` — read remote files. - `ssh_write` — write remote files and create remote dirs. - `ssh_edit` — edit remote files. - `ssh_bash` — run bash on the active SSH host. ## Settings None. ## Hooks - `session_start` — clears target, disables SSH tools, clears `ssh-tools` status. - `before_agent_start` — when SSH mode is active, appends target/cwd and remote-tool hint to the system prompt. ## Behavior - Reads `~/.ssh/config` for non-wildcard `Host` aliases; uses them for completions and picker choices. - Caches parsed SSH config until file mtime changes. - Uses local `ssh` executable for all remote operations. - Enabling SSH mode runs `pwd` on the remote and uses that output as cwd. - `host:path` is accepted, but activation still uses remote `pwd` as cwd. - SSH tools are registered at load, then added to active tools only while SSH mode is on. - Direct remote-tool calls while SSH mode is off fail with `SSH mode off. Use /ssh first.` - Remote file tools use active cwd as tool root. - `ssh_read` uses `cat`; access check uses `test -r`. - `ssh_write` uses `cat >`; mkdir uses `mkdir -p`. - `ssh_edit` requires both remote read and write access. - `ssh_bash` runs scripts through remote bash with stdin prefixed by `cd `. - Remote image MIME detection recognizes `.jpg`, `.jpeg`, `.png`, `.gif`, `.webp` extensions case-insensitively.