⚡ Supercharge your terminal with GUI-style copy, cut, and paste operations!
file_clipper is a blazingly fast command-line utility written in Rust 🦀 that brings intuitive file management to your terminal. Experience the familiar "copy," "cut," and "paste" workflow you love from graphical interfaces, now with the speed and efficiency of the command line. Features an interactive TUI for clipboard management and operation history tracking.
- 📄 Copy Files: Copy one or more files to a temporary clipboard.
clp copy <path>...- Aliases:
cp,c,y
- ✂️ Cut/Move Files: Move one or more files to a temporary clipboard.
clp cut <path>...- Aliases:
mv,x,d
- 🔗 Link Files: Copy one or more files as symbolic links.
clp link <path>...- Aliases:
ln,s
- 📌 Paste Files: Paste files from the clipboard to a specified destination.
clp paste [destination_path]- Aliases:
p,v - If
destination_pathis omitted, files are pasted into the current directory.
- 📋 List Clipboard: View the contents of the current clipboard.
clp list- Alias:
l
- 📜 View History: Browse a history of all past copy/cut/paste operations.
clp history- Alias:
h
- 🧹 Clear: Clear the clipboard and history.
clp clear
- 🖥️ Interactive TUI: The
listandhistorycommands launch an interactive terminal interface, allowing you to select specific files for pasting and manage entries with ease. - 🌟 Glob Pattern Support: Supports glob patterns for selecting multiple files (e.g.,
*.txt,src/**/*.rs).
When files are cut or copied, they are placed into a temporary clipboard. Upon a successful paste operation, these files are automatically removed from the clipboard and recorded in the history, providing a persistent log of all file operations.
To install file_clipper, you need to have Rust and Cargo installed on your system.
cargo install file_clipperFor Arch Linux users, file_clipper is available on the AUR:
pacman -S file_clipperFor Nix users with flakes enabled, you can run file_clipper directly:
# Run directly
nix run github:ruiiiijiiiiang/file_clipper
# Or add to your flake inputs
{
inputs.file_clipper.url = "github:ruiiiijiiiiang/file_clipper";
}
# Then include in your packages
environment.systemPackages = [
inputs.file_clipper.packages.${system}.default
];Here are some basic examples of how to use clp:
# Copy a single file
clp copy my_document.txt
# Copy multiple files using a glob pattern
clp cp 'images/*.png'
# Cut a directory
clp cut my_folder/
# Copy a file as a symlink
clp ln .dotfile
# Paste files to the current directory
clp paste
# Paste files to a specific destination
clp p /home/user/documents/
# List current clipboard contents (launches TUI)
clp list
# View operation history (launches TUI)
clp history
# Remove all clipboard and history entries
clp clearWhen the TUI is launched (e.g., with clp list or clp history):
- Navigation: Use
jork(or arrow keys) to move up and down. UseCtrl+dandCtrl+uto scroll half a page, andCtrl+fandCtrl+bto scroll a full page. Pressgto go to the top andGto go to the bottom. - Selection: Press
spaceto select/unselect individual entries. Pressato select/unselect all entries. - Actions:
porEnter: Paste the selected filesxord: Remove the selected entry from the clipboard (only available in clipboard mode).qorCtrl+c: Exit the TUI.
file_clipper stores record files at $HOME/.local/state/file_clipper. You should run clp clear prior to uninstalling to remove these files.
After clearing the records, you can uninstall the application using your package manager (e.g., cargo uninstall file_clipper, pacman -R file_clipper, or nix profile remove).
Contributions are welcome! Please feel free to open issues or submit pull requests.
This project is licensed under the MIT License.
