tabby-paste-image
v0.2.0
Published
Paste a clipboard image into an SSH terminal: uploads it via SFTP and types the remote path.
Readme
tabby-paste-image
Paste screenshots straight into terminal AI tools. Copy an image, hit paste, and a CLI like Claude Code or kiro-cli chat can immediately read it — no saving files, no scp, no X11 forwarding, no fiddling with paths.
A Tabby plugin that makes paste image-aware. When the clipboard holds an image, it saves the image and types its file path into the input line (single-quoted, ready to pass to any tool); with text on the clipboard, paste works as usual. It just works across sessions:
- SSH tab → uploads the image to the remote host over SFTP and types the remote path. Because it reads the local clipboard, it never touches remote X11 — no more
Could not connect to the X server. - Local shell / any other tab → writes the image to a local temp file and types that path.
How it works
Tabby's built-in paste only handles clipboard text. This plugin wraps every tab's paste() and, when it finds an image instead, takes over:
- Image? No → fall through to normal text paste.
- Save it as PNG. SSH tab → upload via SFTP to the remote host; otherwise → write to a local temp file.
- Type the path into the input line, ready to use.
"Image" means actual image data on the clipboard (a screenshot, or a copied image), regardless of its original format — it's always saved as PNG. Copying an image file in a file manager doesn't count: that puts a file reference on the clipboard, not image data, so paste falls through to text.
Install
In Tabby, open Settings → Plugins, search for paste-image, click Install, and restart Tabby. That's it.
Install into Tabby's plugins directory, then restart Tabby:
cd "$HOME/Library/Application Support/tabby/plugins" # macOS
npm install tabby-paste-imagePlugins directory on other platforms — Linux: ~/.config/tabby/plugins · Windows: %APPDATA%\tabby\plugins
Build (from source)
npm install # Angular 15 / tabby-* peers resolve cleanly, no flags needed
npm run build # production bundle -> dist/index.jsDuring development, use npm run watch to rebuild automatically.
Local install from source (macOS)
Tabby loads plugins from the node_modules folder inside its plugins directory. Place this project there (a symlink is recommended — after npm run build, just restart Tabby):
# Plugins directory (macOS)
PLUGINS_DIR="$HOME/Library/Application Support/tabby/plugins/node_modules"
mkdir -p "$PLUGINS_DIR"
ln -sfn "$HOME/tabby-paste-image" "$PLUGINS_DIR/tabby-paste-image"Plugins directory on other platforms:
- Linux:
~/.config/tabby/plugins/node_modules - Windows:
%APPDATA%\tabby\plugins\node_modules
Then fully quit and restart Tabby. Once loaded, the plugin wraps the paste action on all terminal tabs.
Tip:
npm linkalso works, but Tabby only scans thenode_modulesunder its plugins directory, so the symlink approach above is the most direct.
Usage
- Take a screenshot to the clipboard locally (macOS:
Ctrl+Cmd+Shift+4— note theCtrlis what copies to the clipboard). - Paste in any tab — SSH or local (right-click / middle-click / hotkey all work).
- The plugin saves the image and the path appears in the input line, e.g.:
The path is wrapped in single quotes so it stays safe when passed to a shell/CLI. In an SSH tab this is the remote path; in a local tab it's a local file.'/tmp/paste-img/lm4k2p9.png' - Hand that path to the tool, e.g. in
kiro-cli chat: "take a look at this image ".
Tabby shows a notification in the bottom-right corner (Uploading pasted image… / Image uploaded: … for SSH, Image saved: … for local).
Images land in paste-img/ under /tmp (macOS/Linux) or %TEMP% (Windows), named by timestamp.
Project structure
tabby-paste-image/
├── package.json # keywords includes "tabby-plugin", main: dist/index.js
├── tsconfig.json
├── webpack.config.js # target:node, umd; externals include tabby-*/@angular/rxjs/electron
└── src/
├── index.ts # @NgModule, registers the TerminalDecorator provider
├── decorator.ts # ImagePasteDecorator: wraps paste(), SFTP upload (SSH) or local save + emits path
└── bufferUpload.ts # BufferFileUpload: adapts an in-memory PNG buffer to FileUploadLicense
MIT
