Send clipboard screenshots to remote SSH hosts. Perfect for pasting images into AI coding tools like Claude Code or OpenCode running over SSH.
When using Claude Code, OpenCode (or similar tools) over SSH, you can't paste images from your local clipboard. The remote terminal has no access to your local display server.
clipssh extracts the screenshot from your local clipboard, uploads it to the remote server, and copies the file path to your clipboard. Just paste the path into Claude Code, OpenCode, or any terminal tool and it auto-attaches the image.
# macOS (requires Homebrew)
brew install pngpaste
curl -fsSL https://raw.githubusercontent.com/samuellawrentz/clipssh/main/install.sh | bash
# Or clone and install
git clone https://github.com/samuellawrentz/clipssh.git
cd clipssh
./install.sh# 1. Take a screenshot to the clipboard
# macOS: Cmd+Shift+Ctrl+4 (select area, copies to clipboard)
# 2. Run the clipssh command to move the clipboard file to the SSH machine
clipssh user@myserver
# 3. Cmd/Ctrl + V in SSH Machine
# The image will auto-attachSpecify a custom SSH port directly in the host target using the user@host:port format:
clipssh user@myserver.com:2222This syntax is also fully supported in aliases and default host environment variables:
# Save an alias with a custom port
clipssh alias add myserver user@myserver.com:2222
# Or configure it as default
export CLIPSSH_HOST=user@myserver.com:2222Since clipssh delegates connections directly to your system's standard ssh client, it seamlessly obeys any configurations defined in your local ~/.ssh/config file. This is often the cleanest way to manage custom ports, private keys, or proxy jumps.
Example config block:
Host myserver
HostName myserver.example.com
User user
Port 2222
Once defined in your SSH config, you can simply run:
clipssh myserverSave hosts under short names so you don't have to type user@host every time.
# Save an alias
clipssh alias add myserver user@myserver.com
# List saved aliases
clipssh alias list
# Remove an alias
clipssh alias remove myserver
# Use an alias directly
clipssh myserverAliases are stored in ~/.clipssh/aliases, one name=user@host per line.
# Add to ~/.zshrc or ~/.bashrc
export CLIPSSH_HOST=user@myserver
# Now just run:
clipsshCLIPSSH_HOST also accepts an alias name.
Uploads land in /tmp by default. Override with CLIPSSH_REMOTE_DIR:
export CLIPSSH_REMOTE_DIR=~/.cache/clipssh # must already exist on the remoteFiles are written with umask 077 so they're created as 0600 (owner-readable only) — important on shared hosts where /tmp is world-readable by default.
macOS:
pngpaste- Install withbrew install pngpaste- SSH access to remote host
Linux:
xclip(X11) orwl-clipboard(Wayland)- SSH access to remote host
- Extracts PNG image from your local clipboard
- Uploads to
$CLIPSSH_REMOTE_DIR/clipboard-<timestamp>.png(default/tmp) on remote host via SSH, withumask 077so the file is0600 - Copies the remote path to your clipboard
- You paste the path into Claude Code, OpenCode, or any tool, which reads and displays the image
MIT