Clipboards are local. Terminal sessions often are not.
Clipport is an open-source macOS and iTerm2 utility for that gap. I work in remote shells often, but the context I want to paste is usually on my Mac: text, screenshots, browser errors, visual bugs. Text can pass through the terminal as-is. A screenshot needs to become something a remote shell can name, so Clipport uploads it over SSH and pastes a path like /tmp/clipport/arihant/clipboard-20260428-132708.241851.png.
The user model is simple: use the same paste shortcut everywhere. Local shells get native paste. Remote shells get copied text. Remote shells with a copied screenshot get a file path to the uploaded image.
That makes sharing a screenshot over SSH feel like paste, not file transfer.
Composition
Clipport is mostly composition. iTerm owns the shortcut. The Mac owns the clipboard. SSH owns remote access. The remote machine owns the file. Clipport sits between them and decides what paste should mean for the active terminal.
iTerm runs clipctl paste, which talks to clipportd over a local Unix socket. The daemon reads the macOS clipboard, resolves the active iTerm session, and uploads image bytes when needed. Uploads use plain OpenSSH, so SSH aliases, keys, jump hosts, host checks, and connection reuse keep working. Clipport decides what to paste; SSH decides how to reach the machine.
The main constraint is stdout. iTerm inserts clipctl paste stdout into the terminal, so stdout is the paste payload, not logging. That constraint draws the daemon boundary: the hotkey command stays a narrow adapter from daemon response to terminal bytes, while the daemon holds the mutable pieces: session bindings, clipboard classification, route cache, network refreshes, upload retries, and recent transfer state.
Session and route identity
The non-obvious part is identity. The active terminal has to map to a machine, and that machine has to stay separate from the route used to reach it. Terminal titles are useful but not trustworthy, so Clipport treats them as a fallback. The stronger path is OpenSSH session registration: when SSH opens, a hook records which iTerm session maps to which configured machine. If a remote-looking session cannot be matched, Clipport asks for confirmation instead of guessing where to paste.
Routes are separate from machines. A machine is the remote filesystem; a route is one SSH path to it. Clipport can switch between a LAN alias, public alias, or jump host without changing the pasted path. When the network changes, the daemon refreshes route state instead of making the paste command rediscover everything on the critical path.
That is most of the system: compose the pieces that already work, keep their boundaries visible, and put the mutable state behind a small paste command.
Clipport is open-source on GitHub; feedback and contributions are welcome.