7 ms·
Show HN: Clippy – a better pbcopy for macOS that handles files properly
I made clippy because pbcopy can't do something I needed every day: copy files to paste into GUI apps. When you pbcopy < image.png, you get raw bytes instead of a file that Slack or email can use.
Clippy fixes this:
- clippy report.pdf → ⌘V into any app uploads the file
- curl image.png | clippy → pipes become pasteable files
- clippy *.jpg → multiple files at once
- Text files still work like pbcopy
Technical: Direct Objective-C bindings via CGo. Copies file references (like Finder), not contents. Auto-cleans temp files. No AppleScript hacks.
Install: brew install neilberkman/clippy/clippy
- feraldidactic 1y agoA certain large software concern might take issue with the name. Mac users of a certain age might just run…
- winkelmann 1y ago> the name Rust's linter is also called Clippy, and they don't seem to have any issues.
- moek 1y agoi like the name, it is easy to remember for this use case :)
- aae42 1y agothey'd love my little clipboard/AI project name, then https://github.com/aae42/clippy-clippy/ https://github.com/aae42/clippy-clippy/
- donatj 1y agoNeat, I was actually looking for something like this a few months ago to help automate part of a workflow. Be kind of nice if this also worked as a library rather than having all the workings in internal where they can't be called. Unrelated: Is yo.txt in the root just junk?
- jdmg94 1y agolinux compat would've been nice
- wut42 1y agoalready exists, xsel and xclip does that, iirc.
- nberkman 1y agoclippy is a bit different from these - rather than requiring manual flags for MIME types, it automatically detects the content type. The idea is to make the CLI's copy/paste feel as intuitive as the GUI's. I might tackle Linux (and Windows) at some point, but contributions are definitely welcome!
- SamInTheShell 1y agoProbably worth knowing, there’s already a popular clipboard manager in the wild for MacOS called Clipy. https://github.com/Clipy/Clipy https://github.com/Clipy/Clipy
- nocsi 1y agoSo technically the OS is supposed to be handling this, or at the least whatever app you're in is supposed to signal the MIME to the pasteboard. They even updated the APIs for it this year. I'm not complaining, just giving away loose headsup that they might rugpull you. Apple is particularly not a fan of oblique data transformations, especially since malware keeps going after the user's pasteboards. Something worth implementing is multiple layers to the pasteboard content, so you're at least maintaining the original raw bytes. That and I always wanted a pasteboard that let you append contents to it. Just some ideas to consider
- nberkman 1y agoThanks. I just released a new version with UTI based MIME type detection as the primary method with a fallback to the existing content-based detection.
- physPop 1y agoclippy is kind of taken (a very popular rust linter). Suggest considering a new name to differentiate yourself!