Standard terminal clipboards (pbcopy, xclip) are great for text, but they choke on files and folders.
Sometimes you just need to grab a few files from deep inside one project, navigate to an entirely different part of your system, and drop them there. You don't want to construct a long cp command with complex absolute paths.
I couldn't find a simple tool that acted like a "holding area" for files across terminal sessions.
With git, you have the git stash command, which holds onto files so you can do something else, and with shelf it's almost the same.
Think of shelf as a global, persistent git stash for your file system.
It uses a temporary directory on your disk as a buffer. Because it uses the disk, it persists even if you close your terminal window or restart your computer, and it handles large files easily.
Currently, the best way to install it is via Rust's cargo.
git clone https://github.com/YOUR_USERNAME/shelf.git
cd shelf
cargo install --path .Make sure your Cargo bin path (usually ~/.cargo/bin) is in your shell's PATH.
The workflow is simple: put things onto the shelf, move somewhere else, and take them off.
This command clears whatever is currently on the shelf and copies the new items onto it.
# Copy specific files
shelf copy file1.tsx utils.ts
# Copy folders
shelf copy ./src/components ./assets/imagesThis command adds new items to the existing shelf without clearing it first.
# Add files to the current shelf
shelf add extra-file.txtLook at what is currently stored on the shelf.
shelf peakCopies everything currently on the shelf to the specified destination. The shelf remains intact.
# Navigate somewhere else
cd ~/work/another-project
# Paste into the current directory
shelf paste
# OR paste into a specific folder
shelf paste ./src/legacy-codeCopies everything currently on the shelf to the specified destination, and then clears the shelf.
# Pop into the current directory
shelf pop
# OR pop into a specific folder
shelf pop ./src/legacy-codeRemoves a specific file or folder from the shelf.
shelf drop file1.tsxRemoves all items currently stored on the shelf.
shelf clearThe tool comes with built-in help thanks to Clap.
shelf --help
# or specific command help
shelf copy --helpPrints some inforamtion or sum
shelf aboutBuilt with 🦀 Rust.
