Add files to the clipboard from CLI as if they would be copied with Finder.
The built-in pbcopy command only works with text.
If you want to copy an image, PDF, or any other file type to the clipboard from the terminal, you're out of luck.
pbadd fills this gap by enabling you to copy any file to the clipboard, just like when you copy files in Finder.
You can then paste these files into any application that accepts them - paste images into documents, PDFs into emails, or any file into chat applications.
- macOS 11.0 or later (Big Sur or newer)
- Xcode Command Line Tools
- Make
brew install dsdolzhenko/tools/pbaddmake && sudo make installThis will build the pbadd executable and install it to /usr/local/bin.
To install to a different location:
make && make install PREFIX=/your/custom/path# Add files to the clipboard
pbadd /path/to/file another/file
# Display help
pbadd -h
pbadd --helpThe project is licensed under the MIT license.