File | Date | Author | Commit |
---|---|---|---|
.github | 2023-05-12 |
![]() |
[386902] Move install scripts back |
build | 2023-02-22 |
![]() |
[4ab404] Restore .gitignore in build |
documentation | 2023-05-09 |
![]() |
[8782bc] Change font [skip ci] |
src | 2023-05-12 |
![]() |
[60f220] Improve GUI history entry making |
.gitignore | 2023-03-27 |
![]() |
[966567] Remove juice |
CMakeLists.txt | 2023-05-10 |
![]() |
[81a195] Bump to 0.7.1 |
LICENSE | 2022-11-20 |
![]() |
[42f9fa] Initial commit |
README.md | 2023-05-12 |
![]() |
[60e6e6] Revert [skip ci] |
install.ps1 | 2023-05-12 |
![]() |
[386902] Move install scripts back |
install.sh | 2023-05-12 |
![]() |
[386902] Move install scripts back |
The Clipboard Project (CB for short) is the full-featured yet oh-so-easy-to-use clipboard manager for everyone.
It's super duper fast and lightweight, packed with functionality, and tastefully stylish. You'll be able to remember anything, anytime, anywhere at the literal press of a button, like having a second brain.
I originally made the Clipboard Project to address some severe deficiencies in other similar tools. But now, it's the world's first (and currently only) complete, honest-to-goodness clipboard manager for the terminal.
curl -sSL https://github.com/Slackadays/Clipboard/raw/main/install.sh | sh
(Invoke-WebRequest -UseBasicParsing https://github.com/Slackadays/Clipboard/raw/main/install.ps1).Content | powershell
Alpine Linux (you'll need to enable the Community packages first)
apk add clipboard
AUR (Use your favorite AUR helper such as yay
. You can also get clipboard-bin
and clipboard-git
)
yay -S clipboard
Gentoo GURU and LiGurOS (For Gentoo, enable the GURU repo first)
emerge -av app-misc/clipboard
Homebrew
brew install clipboard
Nix
nix-env -iA nixpkgs.clipboard-jh
Pacstall
pacstall -I clipboard-bin
Scoop
scoop install clipboard
Void Linux
sudo xbps-install -S clipboard
You can also get the latest revision of the Clipboard Project from GitHub Actions or the latest release from GitHub Releases.
You'll need CMake and C++20 support, and if you want X11 and/or Wayland compatibility, you'll also need libx11 and/or libwayland plus Wayland Protocols.
Get the latest release instead of the latest commit by adding --branch 0.7.1
right after git clone...
.
Change the system installation prefix by adding -DCMAKE_INSTALL_PREFIX=/custom/prefix
to cmake ..
, or the library install location by adding -DCMAKE_INSTALL_LIBDIR=/custom/dir
.
# First, let's download the code and go a nice place to build everything.
$ git clone https://github.com/Slackadays/Clipboard
$ cd Clipboard/build
# Now let's set up CMake and build CB.
$ cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..
$ cmake --build . -j 12
# Finally, let's install it onto our system.
$ cmake --install .
Remove everything listed in install_manifest.txt
. If you're not using Windows, you can also do xargs rm < install_manifest.txt
.
# Let's start by copying a file, adding a note to it, changing the note, then pasting the file.
$ cb copy NuclearLaunchCodes.pdf
$ cb note "Keep this a secret"
$ echo "Keep this a secret OR ELSE" | cb note
$ cb paste
# What if we cut a directory, added a file, and then removed that file? That's what we're doing here, all in the "69" clipboard.
$ cb cut69 MyDirectory
$ cb add69 SomeFile
$ cb remove69 SomeFile
$ cb paste69
# You can copy multiple files at the same time. We're using the "_420" persistent clipboard this time.
$ cb cp_420 foo.bar NotAVirus.bar.mp3.exe
$ cb remove_420 "*.mp3\.exe"
$ cb note_420 "Some kosher content here"
$ cb sh_420
# Now let's see our original note and then clear that clipboard.
$ cb note
$ cb clr
# This is the same as "cb note" but for clipboard "_420" again.
$ cb note_420
# Get a bird's eye view of everything so far.
$ cb
Add a number to the end of your action to choose which temporary clipboard you want to use (the default is 0). Or, add _
to use a persistent clipboard instead.
cb [--](copy|cp)[(num)|_(id)] (file) [files]
or (something) | cb [[--](copy|cp)][(num)|_(id)]
$ cb copy FooFile
$ cb --copy FooFile
$ cb cp FooFile
$ cb --cp FooFile
# These are the same!
$ cb copy FooFile BarDir
# These are also the same!
$ echo "Foobar" | cb
$ echo "Foobar" | cb copy
# The "copy" action is optional here since the only possible action here in the first place is "copy"
$ cb copy "Aventura was the best bachata band"
$ cb copy4 FooFile
$ echo "Foobar" | cb copy_hello
$ cb --clipboard hey copy "Aventura was the best bachata band"
$ cb -c hey copy "Aventura was the best bachata band"
# These are the same!
$ cb cp50 "Aventura/God's Project/04 Un Chi Chi.flac" BarDir BazDir
cb [--](cut|ct)[(num)|_(id)] (file) [files]
or (something) | cb [[--](cut|ct)][(num)|_(id)]
$ cb cut FooFile
$ cb --cut FooFile
$ cb ct FooFile
$ cb --ct FooFile
# These are the same!
$ cb cut FooFile BarDir
# These are also the same!
$ echo "Foobar" | cb cut
$ cb cut "Hunter2"
$ cb cut4 FooFile
$ echo "Foobar" | cb cut_hello
$ cb --clipboard hey cut "Aventura was the best bachata band"
$ cb -c hey cut "Aventura was the best bachata band"
# These are the same!
$ cb ct50 "Aventura/God's Project/04 Un Chi Chi.flac" BarDir BazDir
cb [--](paste|p)[(num)|_(id)] [regex] [regexes]
or cb [[--](paste|p][(num)|_(id)] | (something)
or cb [[--](paste|p)][(num)|_(id)] > (some file)
$ cb copy FooFile WhyAventuraIsTheBest.pdf
$ cb paste
$ cb --paste
$ cb p
$ cb --p
# These are the same!
$ cb p ".*Aventura.*"
$ echo "Bananas!" | cb
$ cb paste
# Also the same
$ cb paste > SomeFile
$ cb paste42 > SomeFile
$ cb p42 > SomeFile
$ cb -c 42 > SomeFile
# These three versions all work great!
$ cb | cat
# These three versions also all work great.
$ cb | Write-Output
# The version for PowerShell
$ cb paste_2 | cat
$ cb p_2 | cat
$ cb -c _2 | cat
# These three versions also all work great.
$ cb -c _2 | Write-Output
# The version for PowerShell
cb [--](add|ad)[(num)|_(id)] (file|text) [files]
or (something) | cb [[--](add|ad)][(num)|_(id)]
$ cb copy FooFile
$ cb add SomeOtherFile
$ cb --add SomeOtherFile
$ cb ad SomeOtherFile
$ cb --ad SomeOtherFile
# CB now holds FooFile and SomeOtherFile
$ cb add "We Broke The Rules"
$ cb copy "'Let me find that'"
$ cb add " is one of Romeo Santos' catchphrases."
# The content is now: 'Let me find that' is one of Romeo Santos' catchphrases.
$ echo " What's yours?" | cb add
# The content is now: 'Let me find that' is one of Romeo Santos' catchphrases. What's yours?
cb [--](remove|rm)[(num)|_(id)] (regex) [regexes]
or (some regex) | cb [[--](remove|rm)][(num)|_(id)]
$ cb copy FooFile BarDir BazDir
$ cb remove "B.*"
$ cb --remove "B.*"
$ cb rm "B.*"
$ cb --rm "B.*"
# CB will match this against "BarDir" and "BazDir" and remove them
$ cb remove "BarDir"
# CB will match this against "BarDir" only and remove it
$ cb copy "A bachatero is someone who makes bachata music."
$ cb remove "(?<= ).*ero"
# The content is now: A is someone who makes bachata music.
$ echo "music" | cb remove
# The content is now: A is someone who makes bachata .
cb [--](show|sh)[(num)|_(id)] [regex] [regexes]
or cb [--](show|sh)[(num)|_(id)] [regex] [regexes] | (something)
$ cb copy FooFile BarDir BazDir
$ cb show
$ cb --show
$ cb sh
$ cb --sh
# These all work great!
$ cb copy "Those who are tired of bachata are tired of life"
$ cb show
$ cb sh | cat
$ cb copy "02 I Believe.flac"
$ eval vlc $(cb sh)
# Use the eval command here to process the raw filepath (which in this case looks like "/tmp/Clipboard/0/02 I Believe.flac") as if it were entered in a shell
# Otherwise, you'll likely get errors complaining about being unable to process quote characters.
cb [--](clear|clr)[(num)|_(id)]
$ cb copy FooFile BarDir BazDir
$ cb clear
$ cb --clear
$ cb clr
$ cb --clr
# These all work great!
cb [--](load|ld)[(num)|_(id)] [clipboard] [clipboards]
$ cb copy "Yo dawg! I heard you liked bachata music."
$ cb load 1 2 3 _foo
$ cb --load 1 2 3 _foo
$ cb ld 1 2 3 _foo
$ cb --ld 1 2 3 _foo
# All work great!
$ cb load_foo
cb [--](swap|sw)[(num)|_(id)] [clipboard]
$ cb copy "After breaking up from Aventura, Romeo Santos' music just wasn't up to snuff."
$ cb copy2 "I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux."
$ cb swap 2
$ cb --swap 2
$ cb sw 2
$ cb --sw 2
# All work great!
$ cb swap2
$ cb --swap2
$ cb sw2
$ cb --sw2
# Since swapping is commutative, the target can be freely swapped with the destination.
cb [--](import|imp) [source folder]
$ cb copy "The reason Aventura was so popular was because the music was so well-written as well as the luscious guitar chorus effect."
$ cb export
$ cb import
$ cb --import
$ cb imp
$ cb --imp
# These all work great!
$ cb import MySavedClipboards
cb [--](export|ex) [clipboard] [clipboards]
$ cb copy "Aventura's music is some of the most erotic you'll find anywhere."
$ cb export
$ cb --export
$ cb ex
$ cb --ex
# These all work great!
$ cb export 1 2 3
cb [--](note|nt)[(num)|_(id)] (text)
or (something) | cb [[--](note|nt)][(num)|_(id)]
$ cb note "For my Aventura music collection"
$ cb --note "For my Aventura music collection"
$ cb nt "For my Aventura music collection"
$ cb --nt "For my Aventura music collection"
# All work great!
$ echo "For my Aventura music collection" | cb note
$ cb note ""
cb [--](note|nt)[(num)|_(id)]
$ cb note "For my Aventura music collection"
$ cb note
$ cb --note
$ cb nt
$ cb --nt
cb [--](ignore|ig)[(num)|_(id)] (regex) [regexes]
or (regex) | cb [[--](ignore|ig)][(num)|_(id)]
$ cb ignore "(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])"
$ cb --ignore "(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])"
$ cb ig "(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])"
$ cb --ig "(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])"
# All work great!
# "(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])" is the regex for an AWS SK secret.
$ echo "[abc]{10}" | cb ignore
$ cb ignore ""
cb [--](ignore|ig)[(num)|_(id)]
$ cb ignore "Foo" "Bar" "Baz"
$ cb ignore
$ cb --ignore
$ cb ig
$ cb --ig
cb [--](info|in)[(num)|_(id)]
or cb [--](info|in)[(num)|_(id)] | (something)
$ cb info
$ cb --info
$ cb in
$ cb --in
# All are the same!
$ cb info | cat
$ cb info | jq
cb (-h|[--]help)
$ cb help
$ cb --help
$ cb -h
# These three versions all work great!
cb [[--]status|st]
or cb [--](status|st) | (something)
$ cb status
$ cb --status
$ cb st
$ cb --st
$ cb
# These all work great!
$ cb status | cat
Need to paste a funky symbol somewhere a lot? Just copy it to a persistent clipboard.
$ cb cp_theta θ
Copy a password securely by deleting it once you've pasted it.
$ cb cut "AVeryStrongPassword!"
$ cb | some-program
# Now gone
On a slow system? Cache certain things so you don't have to do them again.
$ neofetch | cb cp_neo
$ cb | cat
Need to share or pore over log files? Just copy them!
$ journalctl | cb
# For systemd
$ sudo dmesg | cb
# For Linux; note that you're not running "sudo cb" here
$ cb copy logs/latest.log
# For Minecraft servers
Want CB to look different? Change up the color scheme.
# This one looks like The Matrix
$ export CLIPBOARD_THEME=green
$ cb
# This one is for light backgrounds
$ export CLIPBOARD_THEME=light
$ cb
# Check out the other themes too!
Here's what some of these themes might look like.
Make your own scripts that can fully automate your workflows.
#!/bin/sh
# This script does nothing except serve as an example of automating CB.
link="https://SomeWebsiteWithLotsOfContent"
wget link
cb copy *.jpg *.png
cb remove "AZ.*\.png"
cb | tar -cf foobar.tar
cb -c footar < foobar.tar
cb note "Latest files from website ABCXYZ"
--all
, -a
Add this when clearing to clear all clipboards at once.$ cb --all clear
--clipboard (clipboard)
, -c (clipboard)
Add this to choose which clipboard you want to use. $ cb -c 5 copy Foobar
$ cb --clipboard 10 copy BarBaz
$ cb -c SomeCB copy "A really really long sentence, and I mean really realy super DUPER long!"
$ cb -c _ copy "Generation Next"/*
--fast-copy
, -fc
Add this to use links when copying, cutting, or pasting. If you modify the items that you used with this flag, then the items you paste will have the same changes.$ cb --fast-copy copy /usr/bin/*
--mime
, -m
Add this to request a specific content MIME type from GUI clipboard systems.$ cb --mime text/html | cb
--no-confirmation
, -nc
Add this to disable confirmation messages from CB. $ cb -nc sh | cat
--no-progress
, -np
Add this to disable progress messages from CB. $ fzf | cb -np
CI
Set this to anything to make CB overwrite existing items without a user prompt when pasting. This variable is intended for Continuous Integration scripts where a live human is not present to make decisions....
cb cp Temp/*
...
cb p
...
CLIPBOARD_LOCALE
Set this to the locale that only CB will use for its commands and output, like en_US.UTF-8
or es_DO.UTF-8
. $ export CLIPBOARD_LOCALE=es_DO.UTF-8
$ cb cp "Amo a Aventura"
> $Env:CLIPBOARD_LOCALE=es_DO.UTF-8
# Powershell version
$ export CLIPBOARD_LOCALE=fr_CA.UTF-8
...
$ CLIPBOARD_LOCALE="" cb cp Foobar
CLIPBOARD_TMPDIR
Set this to the directory that only CB will use to hold the items you cut or copy into a temporary directory.$ CLIPBOARD_TMPDIR=/home/jackson/SomeDirectory cb copy *
$ export CLIPBOARD_TMPDIR=/home/jackson/SomeDirectory
$ cb copy *
> $Env:CLIPBOARD_TMPDIR = /home/jackson/SomeDirectory
# Powershell
CLIPBOARD_PERSISTDIR
Set this to the directory that only CB will use to hold the items you cut or copy into a persistent directory.$ CLIPBOARD_PERSISTDIR=/home/jackson/SomeDirectory cb copy *
$ export CLIPBOARD_PERSISTDIR=/home/jackson/SomeDirectory
$ cb copy *
> $Env:CLIPBOARD_PERSISTDIR = /home/jackson/SomeDirectory
# Powershell
CLIPBOARD_ALWAYS_PERSIST
Set this to anything to make CB always use persistent clipboards.$ export CLIPBOARD_ALWAYS_PERSIST=1
$ cb copy Foo Bar Baz
# This puts everything in the persistent directory but still with the clipboard name "0"
CLIPBOARD_NOEMOJI
Set this to anything to strip emojis from CB's messages.$ export CLIPBOARD_NOEMOJI=1
$ cb cp "You won't be annoyed 😒 by these things ever again! 😏😋🥵"
CLIPBOARD_NOGUI
Set this to anything to disable integration with GUI clipboards.$ CLIPBOARD_NOGUI=1 cb show
$ export CLIPBOARD_NOGUI=1
$ cb show
CLIPBOARD_NOPROGRESS
Set this to anything to disable only progress messages from CB.$ fzf | CLIPBOARD_NOPROGRESS=1 cb
$ export CLIPBOARD_NOPROGRESS=1
$ fzf | cb
CLIPBOARD_SILENT
Set this to anything to disable progress and confirmation messages from CB.$ export CLIPBOARD_SILENT=1
$ cb cp "I'm running out of Aventura references"
CLIPBOARD_THEME
Set this to the color theme that CB will use. Choose between light
, darkhighcontrast
, lighthighcontrast
, amber
, and green
(the default is dark
).$ export CLIPBOARD_THEME=green
$ cb cp "I'm in the Matrix now"
$ export CLIPBOARD_THEME=amber
$ cb cp "Yellow terminals feel just like sitting in front of a nice campfire"
$ export CLIPBOARD_THEME=darkhighcontrast
$ cb show
FORCE_COLOR
Set this to anything to make CB always show color regardless of what you set NO_COLOR
to.$ export NO_COLOR=1
...
$ FORCE_COLOR=1 cb copy "There are almost no bachateros where I live right now"
$ export CLICOLOR=0
...
$ CLICOLOR_FORCE=1 cb copy "There are almost no bachateros where I live right now"
NO_COLOR
Set this to anything to make CB not show any colors.$ export NO_COLOR=1
$ cb cp "From the 1960s until the 1990s, bachata was perceived as boring music for poor Dominicans."
$ export CLICOLOR=0
$ cb cp "In the 1990s, though, several innovative musicians reinvigorated bachata by using electric guitars with fancy effects."
We're here for you! Check out the Clipboard Project Wiki for even more information, ask all your burning questions in GitHub Discussions, or join the awesome Discord group!
Say thank you to all our beautiful contributors who have helped make the Clipboard Project incredible.
Want to join the club? We're always accepting new contributions too.
And if you're feeling generous, feel free to give us a ⭐! We appreciate every single one - including yours.
cb copy haters && cb > /dev/null