News for hackers. Stuff that matters.

Show HN: Clippy – a better pbcopy for macOS that handles files properly

https://github.com/neilberkman/clippy

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

( 14 comments | 4 points | on HN )
Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by feraldidactic on Wednesday July 16, 2025 @04:44AM (#44580072)
A certain large software concern might take issue with the name. Mac users of a certain age might just run…
Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by winkelmann on Wednesday July 16, 2025 @07:04AM (#44580846)
> the name

Rust's linter is also called Clippy, and they don't seem to have any issues.

Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by moek on Wednesday July 16, 2025 @10:14AM (#44582632)
i like the name, it is easy to remember for this use case :)
Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by aae42 on Wednesday July 16, 2025 @02:30PM (#44585418)
they'd love my little clipboard/AI project name, then

https://github.com/aae42/clippy-clippy/

Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by donatj on Wednesday July 16, 2025 @09:11AM (#44581959)
Neat, 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?

Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by nberkman on Wednesday July 16, 2025 @09:14AM (#44581983)
Removed, thanks!
Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by nberkman on Wednesday July 16, 2025 @12:57PM (#44584463)
Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by jdmg94 on Wednesday July 16, 2025 @09:45AM (#44582328)
linux compat would've been nice
Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by wut42 on Wednesday July 16, 2025 @12:03PM (#44583802)
already exists, xsel and xclip does that, iirc.
Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by nberkman on Wednesday July 16, 2025 @01:13PM (#44584649)
clippy 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!

Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by SamInTheShell on Wednesday July 16, 2025 @02:24PM (#44585361)
Probably worth knowing, there’s already a popular clipboard manager in the wild for MacOS called Clipy.

https://github.com/Clipy/Clipy

Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by nocsi on Wednesday July 16, 2025 @02:39PM (#44585500)
So 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

Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by nberkman on Wednesday July 16, 2025 @04:51PM (#44586633)
Thanks. 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.
Re:Show HN: Clippy – a better pbcopy for macOS that handles ... by physPop on Wednesday July 16, 2025 @11:14PM (#44589339)
clippy is kind of taken (a very popular rust linter). Suggest considering a new name to differentiate yourself!