{"id":49954223,"url":"https://github.com/pravnyadv/cpssh","last_synced_at":"2026-05-17T22:01:21.758Z","repository":{"id":358300997,"uuid":"1238139016","full_name":"pravnyadv/cpssh","owner":"pravnyadv","description":"Copy screenshots on your Mac. Paste them in Claude Code over SSH.","archived":false,"fork":false,"pushed_at":"2026-05-16T16:52:00.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-16T18:44:19.844Z","etag":null,"topics":["claude-code","cli","clipboard","developer-tools","go","macos","ssh"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pravnyadv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-13T21:11:17.000Z","updated_at":"2026-05-16T16:52:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pravnyadv/cpssh","commit_stats":null,"previous_names":["pravnyadv/cpssh"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pravnyadv/cpssh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pravnyadv%2Fcpssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pravnyadv%2Fcpssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pravnyadv%2Fcpssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pravnyadv%2Fcpssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pravnyadv","download_url":"https://codeload.github.com/pravnyadv/cpssh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pravnyadv%2Fcpssh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33157229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","cli","clipboard","developer-tools","go","macos","ssh"],"created_at":"2026-05-17T22:01:19.930Z","updated_at":"2026-05-17T22:01:21.753Z","avatar_url":"https://github.com/pravnyadv.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cpssh\n\nCopy a screenshot on your Mac. Paste it in Claude Code on your SSH server.\n\n---\n\nClaude Code running over SSH can't read your local clipboard. `cpssh` bridges the gap: it watches your Mac's clipboard for images, syncs them to your server over SSH, and puts a text reference in your clipboard so you can paste it straight into Claude Code.\n\n```\n[you copy a screenshot]\n     ↓\ncpssh syncs it → dev@myserver:~/.cpssh/img42.png\n     ↓\nclipboard now contains: [image:$HOME/.cpssh/img42.png]\n     ↓\npaste in Claude Code on SSH → Claude reads the file automatically\n```\n\n## Requirements\n\n- macOS as your local machine (where you take screenshots)\n- An SSH server reachable with a key (password auth not supported)\n- [Claude Code](https://claude.ai/code) on the server\n\n\u003e **Linux local machine:** The daemon runs on Linux but on Linux it only puts the text reference in your clipboard — the original PNG is not preserved simultaneously. Full dual-clipboard support for Linux is planned for a future release.\n\n## Install\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/pravnyadv/cpssh/main/install.sh | bash\n```\n\nThen run setup:\n\n```bash\ncpssh setup\n```\n\nSetup will ask for your SSH server, pick an SSH key from `~/.ssh`, and install a background daemon that starts automatically on login.\n\n**Using an AWS `.pem` key?** When setup shows the key picker, choose `[0] Enter path manually` and type the full path to your `.pem` file. Make sure the file has the right permissions first: `chmod 400 ~/path/to/key.pem`\n\n## How to use\n\n1. Take a screenshot with **Cmd+Shift+4** (saves to clipboard on macOS)\n2. Paste in Claude Code on your SSH session — the sync happens in the background and the text reference is ready almost instantly\n3. Claude reads the file and sees the image\n\nYou can attach multiple images to one prompt: each screenshot gets a unique filename (`img1.png`, `img2.png`, …). Copy → paste → copy → paste to stack them up.\n\nThe original PNG stays in your clipboard too, so pasting into Discord, Slack, or any image app still works normally.\n\n## Commands\n\n```\ncpssh setup          First-time setup: add server, install daemon\ncpssh status         Is the daemon running? Last sync time?\ncpssh add-server     Add another SSH server to sync to\ncpssh remove-server  Remove a server\ncpssh pause          Stop syncing temporarily (daemon keeps running)\ncpssh resume         Resume syncing\ncpssh restart        Restart the daemon\ncpssh logs           Tail the daemon log\ncpssh uninstall      Remove daemon and config\n```\n\n## How it works\n\n- A background daemon polls the clipboard every 300ms using the native macOS/Linux clipboard API\n- On a new image, it generates a short filename (`imgN.png`) and pipes the raw bytes to the server over a single SSH call (no rsync, no scp — just `cat \u003e file` via stdin)\n- SSH ControlMaster reuses connections — first sync after daemon start costs ~1s for the handshake; subsequent syncs are near-instant\n- After a successful sync, the daemon writes both the original PNG **and** a text reference `[image:$HOME/.cpssh/imgN.png]` to the clipboard simultaneously using NSPasteboard — terminal paste gets the text, image apps get the PNG\n- The 10 most recent images are kept on the server; older ones are purged automatically on each sync\n- Images larger than 500 KB are resampled before upload using `sips` (ships with macOS), keeping transfer fast\n\n## Configuration\n\nConfig lives at `~/.config/cpssh/config.json`. You can edit it directly:\n\n```json\n{\n  \"servers\": [\n    {\n      \"host\": \"your.server.com\",\n      \"user\": \"dev\",\n      \"ssh_key\": \"/Users/you/.ssh/id_ed25519\",\n      \"sync_path\": \"$HOME/.cpssh\"\n    }\n  ],\n  \"settings\": {\n    \"poll_interval_ms\": 300,\n    \"max_file_size_kb\": 2048,\n    \"compress_above_kb\": 500,\n    \"keep_last_n_files\": 10,\n    \"paused\": false\n  }\n}\n```\n\n## Build from source\n\nRequires Go and Xcode Command Line Tools on macOS (needed for the CGO clipboard write).\n\n```bash\ngit clone https://github.com/pravnyadv/cpssh\ncd cpssh\nSDKROOT=$(xcrun --sdk macosx --show-sdk-path) go build -o cpssh .\n```\n\nNote: `go install` will not work on macOS because CGO requires the SDK path to be set explicitly. Use the install script for a regular install, or the build command above when developing.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpravnyadv%2Fcpssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpravnyadv%2Fcpssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpravnyadv%2Fcpssh/lists"}