This is my new little project to build something I've been needing but haven't been able to find, a clipboard system for the terminal. If you ever need to copy or move some file but don't know where exactly, that's exactly what Clipboard excels at. I can't believe this hasn't been done before.
Most operating systems have existing features which offer this capability already. I typically alias these to 'xc' (copy) and 'xp' (paste) within my shell.
For Linux, 'xclip -c' (copy) and 'xclip -p' (paste) respectively.
For MacOS, 'pbcopy' (copy) and 'pbpaste' (paste), respectively.
For Android, using Termux, 'termux-clipboard-set' (copy) and 'termux-clipboard-get' (paste) respectively. There are also keyboard mnemonics: Ctrl-Alt-C will copy, Ctrl-Alt-V will paste.
I believe there's also a feature on Windows via Cygwin, though it's been a couple of decades since I've had to use it.
Each of the above can read from stdin/stdout or file redirection.
E.g.:
cmd | xc # copy *from* command
xp | cmd # paste *to* command
xc <file # copy *from* file
xp >file # past *to* file
The problem here is that all of these tools are really unintuitive to use because you can't just discover them on your own, or I wouldn't have thought to make Clipboard. You also have to use stdin/stdout/redirection which is a huge pain if you just want to specify some random file. I also can't figure out how to use xclip. If even I on Hacker News can't figure it out, new users to the terminal never will. Also, none of these tools offer cutting.
And, no criticism at creating your own implementation, but it's very, very far from the first CLI-clipboard integration.
If it makes you feel any better, I've coded up my own solutions to several problems, only to discover existing, and better, solutions myself. Multiple times.
The other problem here is that if an average user can't easily discover those other options, then they might as well not exist. In comparison, "Clipboard" is exactly what you'd search for and is exactly what you think it is.
For Linux, 'xclip -c' (copy) and 'xclip -p' (paste) respectively.
For MacOS, 'pbcopy' (copy) and 'pbpaste' (paste), respectively.
For Android, using Termux, 'termux-clipboard-set' (copy) and 'termux-clipboard-get' (paste) respectively. There are also keyboard mnemonics: Ctrl-Alt-C will copy, Ctrl-Alt-V will paste.
I believe there's also a feature on Windows via Cygwin, though it's been a couple of decades since I've had to use it.
Each of the above can read from stdin/stdout or file redirection.
E.g.: