Clipboard

SlackadaysGPL-3.0更新放缓

跨平台命令行剪贴板管理器,支持在终端里复制、粘贴、查看和管理剪贴板历史,还能在多台设备间同步内容。

😎🏖️🐬 Your new, 𝙧𝙞𝙙𝙤𝙣𝙠𝙪𝙡𝙞𝙘𝙞𝙤𝙪𝙨𝙡𝙮 smart clipboard manager

0.10.0发布于 2024-11-17 16:49 UTC5,945star +2 / 7 天179fork同步于 2026-11-10 11:35 UTC

怎么上手

由 README 提炼,执行前请确认
curl -sSL https://github.com/Slackadays/Clipboard/raw/main/install.sh | sh
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

命令行剪贴板管理器,支持多剪贴板与历史记录,让复制粘贴更灵活

跨平台命令行剪贴板管理器,支持在终端里复制、粘贴、查看和管理剪贴板历史,还能在多台设备间同步内容。

核心能力

  • 复制粘贴文本、文件、目录和二进制数据
  • 支持无限数量的剪贴板,每个都有独立历史
  • 与系统现有剪贴板系统无缝集成
  • 提供可脚本化的 API 自动化工作流
  • 支持多语言界面

容易踩的坑

手动编译需要 CMake、C++20 支持和 OpenSSL,Linux 上还需 ALSA;Flatpak 和 Snap 安装后需设置 alias 才能直接用 cb 命令;项目作者表示缺少 C++ 开发者,开发可能无法继续

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本0.10.0
  1. 0.10.0最新正式版2024-11-17 · 2024-11-17 16:49 UTC

    :warning: Important Notice :warning:

    There is a critical bug with Wayland support in CB. If you know C++, we would love your help over at this issue!

    :sparkles: New

    • Added Script action: You can now assign a custom script to any clipboard with cb script command or cb script filename! See the new docs for the complete details
    • Added more potential editors to Edit
    • Added approximate entries remaining to Info
    • Remove excess whitespace when displaying a preview of text content
    • Added fully custom RGB theming: use CLIPBOARD_THEME=help=r;g;b,info=r;g;b,error=r;g;b,success=r;g;b,progress=r;g;b
    • Added versioning to the underlying storage system that CB uses
    • Optimized directory size calculations
    • Show the size of each entry in History
    • Added range support to Clear: use cb clear 42-69 to clear entries 42 through 69 inclusive
    • Added ability to see the compiled git branch in Help
    • Added ability to see if ignore secrets are present or not in Info

    :screwdriver: Fixed

    • Fixed a subtle bug in History where dates would show absurd values
    • Fixed the case where copying data from a GUI system doesn't update if the new content is only a subset of the current content
    • Fixed the case where the default clipboard is duplicated if it's made persistent
    • Fixed Cut on Windows/macOS not deleting old content

    :pinching_hand: Changed

    • Bumped minimum CMake version to 3.20
    • Changed formatting of enums to fill multiple lines
  2. 0.9.12024-10-06 · 2024-10-06 17:18 UTC
    查看更新说明

    :scroll: Summary

    The Clipboard Project is an advanced clipboard manager for the terminal. No other one exists with features like an unlimited history, unlimited clipboards, and user friendliness all while being in the command line!

    0.9.1 includes various fixes and improvements, plus a new "secret ignore" feature that lets you securely ignore secrets like passwords without storing them directly.

    :sparkles: New

    • Added "secret ignore". Securely ignore secrets by doing cb ignore --secret my_secret1, and CB will save my_secret1's hash and compare all future copied content to it. If it matches, CB will not save what you copied. Clear the secret ignore rules with cb ignore --secret "", but be warned that this is irreversible!

    :screwdriver: Fixed

    • Fixed unicode escaping in JSON
    • Don't remove cut files if you have cancelled pasting them
    • Handle the case where argv[0] doesn't exist (this happens on OpenBSD)
    • Handle more cases where the clipboard lock file needs to be deleted

    :control_knobs: Changed

    • OpenSSL added as a required library

    :crystal_ball: Looking ahead

    The next release is likely 0.10.0 which will include the new script action where you can run a script whenever you access a clipboard. I'm releasing 0.9.1 now just to get these improvements out the door while you wait for 0.10.0.

    :warning: Note

    There are no Windows arm64 builds for this release because I can't figure out how to get CMake to see the OpenSSL arm64 installation. If you can figure this out, that would be awesome!

  3. 0.9.0.10.9.02023-12-17 · 2023-12-17 15:43 UTC
    查看更新说明

    CBBannerRelease9 0

    The Clipboard Project is an advanced clipboard manager for the terminal. No other one exists with features like an unlimited history, unlimited clipboards, and user friendliness all while being in the command line!

    Summary

    Fixed a nasty bug on Linux, improved UX, and added a way to see your CB configuration!

    New

    • Faster building on systems with large core counts
    • Added es_DO (Dominican Spanish) locale. This is currently identical to es_CO (Colombian Spanish)
    • Added Config action
    • Added SPDX license identifiers to clearly state what license CB uses

    Fixed

    • Fixed string length check in color formatting
    • Fixed background process detection on Linux
    • Fix a potential case where the output doesn't resize correctly

    Changed

    • :rotating_light: Breaking: :rotating_light: Adhere to XDG specifications for persistent clipboards

    This changes the default location of all persistent clipboards from $HOME/.clipboard to $HOME/.local/state/clipboard. To move your existing persistent clipboards to this new location, all you need to do is copy everything from the .clipboard directory to the .local/state/clipboard one. For example, on Linux or macOS, do cp -R ~/.clipboard ~/.local/state/clipboard. For Windows, the PowerShell command should be similar.

    This does not affect you if you've set a custom persistent clipboard location using CLIPBOARD_PERSISTDIR, or if you don't use persistent clipboards.

    • Changed the C++ version to 23 in CMake

    New Contributors

  4. 0.8.32023-10-02 · 2023-10-02 18:01 UTC
    查看更新说明

    Summary

    Just a hotfix for macOS Sonoma and a couple UX improvements.

    New

    • Control characters such as newlines and feed returns now show up as their string representations in a dark font

    Fixed

    • Fixed macOS Sonoma not finding the <algorithm> header
    • Fixed async clipboard not updating to match new entries (todo: make this faster because this will be super slow for large clipboards)
  5. 0.8.22023-10-01 · 2023-10-01 16:04 UTC
    查看更新说明

    CBBannerRelease8 2

    About

    The Clipboard Project is an advanced clipboard manager for the terminal. No other clipboard manager exists with features like an unlimited history, unlimited clipboards, and user friendliness all while being in the terminal!

    Summary

    These are some nice optimizations and fixes to keep CB high quality. :)

    New

    • Added async X11/Wayland clipboard compat! This allows you to copy multiple items without running CB each time. This feature works by creating a CB daemon that checks the X11/Wayland clipboard every two seconds and updates the internal clipboard if it detects a change.
    • Optimized file reading
    • Optimized color replacement to be 3x faster!
    • Complain about a missing action if the chosen combination isn't available
    • Added NO_ALSA compile option for CMake
    • Optimized History action by performing tasks while waiting for threads to complete
    • Optimized MIME and file extension inference
    • Optimized History action AGAIN by caching color formatting
    • Check that the clipboard name is compatible with the host filesystem
    • Added zsh completions
    • Added ansi theme that uses the ANSI 3-bit color system (#159)
    • Added Antony Santos to bachata feature

    Fixed

    • Fixed typo in manpage
    • Fixed the Load action not working in piped situations
    • Fixed silent confirmations not working for many messages
    • Fixed memory issue on Clang ARM causing broken colors
    • Fixed typo in help message
    • Fixed displaying history on Windows
    • Fixed segmentation fault if giving an empty argument that expects a string
    • Fixed JSON escaping for Info and History actions
    • Fixed JSON escaping not working for Unicode characters
    • Fixed "last changed" in Info reporting changes for unrelated files when pasting
    • Fixed not releasing a clipboard lock in the Status action

    Changed

    • Changed "All of your clipboard with content" to "All your clipboards with content"
    • Changed Info JSON's "lastChanged" key to "contentLastChanged"
    • Only show progress messages if an action takes 500ms or longer
    • Updated CMake C++ version to C++23

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    The Clipboard Project cannot continue development unless I receive help from someone who knows C++.

    If you are this person, please email me at [email protected]

    Warp, the intelligent terminal for developers

    Available for MacOS, Linux, & Windows

    The Clipboard Project

    The Clipboard Project is a fast and lightweight, feature packed, and user friendly tool that lets you do more on the computer in style. Seriously.

    Say hello to one of the most cutting-edge clipboard managers ever. Save time and effort easier and more powerfully than ever before.

    Don't just take my word for it!

    • Copy and paste text, files, directories, binary data, your goat, anything
    • Infinite numbers of clipboards with unlimited capacity and history each,
    • Seriously kickASS performance 🥾🤯 because I'm sick of slow software,
    • Seamless integration with your existing clipboard systems,
    • Support for your favorite languages like español, português, Türkçe, and Français,
    • A superbly scriptable API to automate your workflows in a cinch,
    • Gorgeous and ear candy for your viewing and listening pleasure,
    • Documentation you'll actually want to read (all in this readme)
    • And oodles more!

    I believe Clipboard is the best tool for clipboard interaction. As a matter of fact, as of today you have 2713 stars on github, kudos! Keep up the good work.

    - pidario on GitHub.com

    Thanks for your work! This is by-far one of my favourite projects on GitHub!

    - MaddyGuthridge on GitHub.com

    ...I've just discovered CB & it's suiting my needs very well!

    - all64bits on Discord.com

    I started using this because I just wanted an easy "cb copy && cb paste" VS trying to remember the correct input AND output flags when Im using xclip with different file types. I write a lot of shell scripts that copy certain stuff like images and text and this makes it a lot easier.

    - SweetBabyAlaska on Reddit.com

    As a sysadmin and hourly terminal user, I found it so useful. Making stuffs some easier.

    - Simpleboy_ir on Reddit.com

    Thank you for this app, so simple yet effective! Hats off 🎩 👌

    - GlassGruber on GitHub.com

    BTW, really LOVE this project. Its [sic] so unbelievable it isn't already in Linux.

    - AtomicRobotMan0101 on GitHub.com

    ...Thank you again for this great application!

    - kohane27 on GitHub.com

    CB Demo Video

    Quick Installation

    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
    
    yay -S clipboard-bin
    
    yay -S clipboard-git
    

    Conda-forge (Use any Conda package manager such as conda, mamba, or pixi)

    conda install -c conda-forge cb-clipboard
    
    mamba install -c conda-forge cb-clipboard
    
    micromamba install -c conda-forge cb-clipboard
    
    pixi global install cb-clipboard
    

    Flatpak Flathub (You can also get our nightly Flatpak builds under GitHub Downloads)

    flatpak install app.getclipboard.Clipboard
    # After installing, do "alias cb='flatpak run app.getclipboard.Clipboard'" to use CB easily.
    # Then, add that command to your terminal profile (like .bashrc) to make it work every time.
    

    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
    

    Snap (You can also get our nightly Snap builds under GitHub Downloads)

    sudo snap install clipboard
    # After installing, do "alias cb='snap run clipboard'" to use CB easily.
    # Then, add that command to your terminal profile (like .bashrc) to make it work every time.
    

    Void Linux

    sudo xbps-install -S Clipboard
    

    Winget

    winget install -e --id Slackadays.Clipboard
    

    GitHub Downloads

    First, get the latest revision of the Clipboard Project from GitHub Actions or the latest release from GitHub Releases.

    Then, unpack what you just downloaded to a nice place anywhere on your system.

    If you downloaded the Flatpak, now do flatpak install what-you-downloaded.flatpak. Or if you downloaded the Snap, now do sudo snap install --dangerous what_you_downloaded.snap.

    Finally, add CB to your PATH (so that you can run it anywhere) by doing one of the following:

    # For all platforms except Windows, Flatpak, and Snap
    $ export PATH=$PATH:/where/you/unpacked/cb
    # Add this to your terminal startup file like .bashrc or the equivalent so that it works every time.
    # To get the current path (in case you don't know it), do the "pwd" command.
    
    # For Flatpak
    $ alias cb='flatpak run app.getclipboard.Clipboard'
    # Add this to your terminal startup file like .bashrc or the equivalent so that it works every time.
    
    # For Snap
    $ alias cb='snap run clipboard'
    # Add this to your terminal startup file like .bashrc or the equivalent so that it works every time.
    
    # For Windows PowerShell
    > $Env:PATH += ";C:\where\you\unpacked\cb"
    # Add this to your PowerShell profile (which is located in $profile) so that this works every time.
    # To get the current path (in case you don't know it), do the "Get-Location" command.
    

    You'll need CMake, C++20 support, and OpenSSL, and if you want X11 or Wayland support, you'll also need libx11 or libwayland plus Wayland Protocols respectively. If you're on Linux, you'll need ALSA.

    Get the latest release instead of the latest commit by adding --branch 0.9.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=Release ..
    $ 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.

    How To Use

    # Let's start by copying a file.
    $ cb copy NuclearLaunchCodes.pdf
    
    # Now, let's paste this file.
    $ cb paste
    
    # Not bad, right?
    
    # Let's make a note for this clipboard.
    $ cb note "Keep this a secret"
    
    # What if you wanted to pipe the note in?
    $ echo "Keep this a secret OR ELSE" | cb note
    
    # Now let's cut a directory to a different clipboard.
    $ cb cut69 MyDirectory
    
    # We put the 69 right after "cut" to tell CB to put MyDirectory in clipboard 69.
    
    # Let's add a file to this same clipboard.
    $ cb add69 SomeFile
    
    # To remove a file, enter its name to remove just that file.
    $ cb remove69 SomeFile
    
    # Alternatively, you can put in a regex pattern instead to generalize the removal.
    $ cb remove69 "So.*le"
    
    # Finally, let's paste what we have in clipboard 69.
    $ cb paste69
    
    # You can copy multiple files at the same time. 
    # Let's try the "_420" persistent clipboard for this one.
    $ cb copy_420 foo.bar NotAVirus.bar.mp3.exe
    
    # Like before, we can remove anything with a regex patttern.
    $ cb remove_420 "*.mp3\.exe"
    
    # Notes work exactly the same way for every clipboard.
    $ cb note_420 "Some kosher content here"
    
    # Let's look at everything we've stored in clipboard _420.
    $ cb show_420
    
    # Now let's see our original note and then clear that clipboard. 
    $ cb note
    $ cb clear
    
    # This is the same as "cb note" but for clipboard "_420" again.
    $ cb note_420
    
    # Let's shake things up. Say you have some kind of content you want to ignore.
    # This content could be anything from a password to raw binary data.
    # To ignore certain kinds of content, use a regex pattern of your choice.
    
    # Let's try this with a classic example.
    $ cb ignore "H.*2"
    
    # This pattern will ignore anything starting with "H" and ending with "2."
    
    # Now, this next command will fail because CB will ignore the content in it through the pattern.
    $ cb copy "Hunter2"
    
    # Let's get some more detailed information about our clipboards.
    $ cb info
    $ cb info69
    $ cb info_420
    
    # To wrap things up, let's get a bird's eye view of everything so far.
    $ cb
    # Doing "cb" is the exact same as "cb status."
    $ cb status
    
    # These are just a handful of examples. 
    # Check the documentation below for tons more examples of all the commands!
    

    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.

    Copy a file.

    $ cb copy FooFile
    $ cb --copy FooFile
    $ cb cp FooFile 
    $ cb --cp FooFile
    # These are the same!
    

    Copy a file and a directory.

    $ cb copy FooFile BarDir
    # These are also the same!
    

    Copy piped in data.

    $ 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"
    

    Copy text directly.

    $ cb copy "Aventura was the best bachata band"
    

    Note: This happens instead of copying a file/directory if there is only one item present and that item doesn't exist as a file/directory.

    Copy a file to the clipboard named "4"

    $ cb copy4 FooFile
    

    Copy piped in data to the persistent clipboard named "hello"

    $ echo "Foobar" | cb copy_hello
    

    Copy text to the clipboard named "hey"

    $ cb --clipboard hey copy "Aventura was the best bachata band"
    $ cb -c hey copy "Aventura was the best bachata band" 
    # These are the same!
    

    Copy a file with spaces and many directories to clipboard "50" using the abbreviated action name.

    $ cb cp50 "Aventura/God's Project/04 Un Chi Chi.flac" BarDir BazDir
    

    Cut a file.

    $ cb cut FooFile
    $ cb --cut FooFile
    $ cb ct FooFile 
    $ cb --ct FooFile
    # These are the same!
    

    Cut a file and a directory.

    $ cb cut FooFile BarDir
    # These are also the same!
    

    Cut piped in data.

    $ echo "Foobar" | cb cut
    

    Note: Cutting piped in data is the same as copying, except that CB will delete all content after you paste it somewhere.

    Cut text directly.

    $ cb cut "Hunter2"
    

    Note: This happens instead of cutting a file/directory if there is only one item present and that item doesn't exist as a file/directory.

    Cut a file to the clipboard named "4"

    $ cb cut4 FooFile
    

    Cut piped in data to the persistent clipboard named "hello"

    $ echo "Foobar" | cb cut_hello
    

    Cut text to the clipboard named "hey"

    $ cb --clipboard hey cut "Aventura was the best bachata band"
    $ cb -c hey cut "Aventura was the best bachata band"
    # These are the same!
    

    Cut a file with spaces and many directories to clipboard "50" using the abbreviated action name.

    $ cb ct50 "Aventura/God's Project/04 Un Chi Chi.flac" BarDir BazDir
    

    Start by copying or cutting something.

    $ cb copy FooFile WhyAventuraIsTheBest.pdf
    

    Paste in the current working directory.

    $ cb paste
    $ cb --paste
    $ cb p
    $ cb --p
    # These are the same!
    

    Note: If you paste after cutting, then CB will delete the original files that you cut.

    Paste anything containing "Aventura."

    $ cb p ".*Aventura.*"
    

    Now, let's copy some raw data.

    $ echo "Bananas!" | cb
    

    Paste the raw data file in the current working directory.

    $ cb paste
    # Also the same
    

    Pipe everything out to some file.

    $ cb paste > SomeFile
    

    Pipe everything from clipboard "42" out to some file.

    $ cb paste42 > SomeFile
    $ cb p42 > SomeFile
    $ cb -c 42 > SomeFile 
    # These three versions all work great!
    

    Pipe everything out to some program.

    $ cb | cat
    # These three versions also all work great.
    $ cb | Write-Output 
    # The version for PowerShell
    

    Pipe everything from persistent clipboard "2" out to some program.

    $ 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
    

    Note: If you paste after cutting, then CB will delete the raw data afterwards, effectively only letting you paste once.

    Start by copying something.

    $ cb copy FooFile
    

    Add a file.

    $ cb add SomeOtherFile
    $ cb --add SomeOtherFile
    $ cb ad SomeOtherFile 
    $ cb --ad SomeOtherFile
    # CB now holds FooFile and SomeOtherFile
    

    Add a directory.

    $ cb add "We Broke The Rules"
    

    Now let's copy some raw data.

    $ cb copy "'Let me find that'"
    

    Add raw data to the end of what's stored.

    $ cb add " is one of Romeo Santos' catchphrases."
    # The content is now: 'Let me find that' is one of Romeo Santos' catchphrases.
    

    Add raw data by piping it in.

    $ echo " What's yours?" | cb add 
    # The content is now: 'Let me find that' is one of Romeo Santos' catchphrases. What's yours?
    

    Start by copying something.

    $ cb copy FooFile BarDir BazDir
    

    Remove everything starting with "B"

    $ cb remove "B.*"
    $ cb --remove "B.*"
    $ cb rm "B.*"
    $ cb --rm "B.*"
    # CB will match this against "BarDir" and "BazDir" and remove them
    

    Remove everything matching a specific name

    $ cb remove "BarDir"
    # CB will match this against "BarDir" only and remove it
    

    Now let's copy some raw data.

    $ cb copy "A bachatero is someone who makes bachata music."
    

    Remove anything with a space beforehand and that ends with "-ero"

    $ cb remove "(?<= ).*ero"
    # The content is now: A  is someone who makes bachata music.
    

    Remove anything matching "music" by piping the pattern in.

    $ echo "music" | cb remove
    # The content is now: A  is someone who makes bachata .
    

    Start by copying something.

    $ cb copy FooFile BarDir BazDir
    

    List all the items in the clipboard.

    $ cb show
    $ cb --show
    $ cb sh 
    $ cb --sh
    # These all work great!
    

    Now let's copy some raw data.

    $ cb copy "Those who are tired of bachata are tired of life"
    

    Show the contents of the clipboard.

    $ cb show
    

    Show the raw filepaths of everything in the clipboard.

    $ cb sh | cat
    

    Show raw filepaths to a program.

    $ 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.
    

    Start by copying something.

    $ cb copy FooFile BarDir BazDir
    

    Clear the clipboard of all data.

    $ cb clear
    $ cb --clear
    $ cb clr 
    $ cb --clr
    # These all work great!
    

    Clear a certain range of history entries.

    $ cb clear 69-420
    # Clears entries 69 through 420 inclusive
    $ cb clr 0-100
    # Clears entries 0 through 100 inclusive
    # Note: Entry 0 is always the most recent one
    

    Just clear everything.

    $ cb clear -a
    # Note: This will really clear everything in all clipboards!
    

    Start by copying some text.

    $ cb copy "Hello Clipboard! This is just some example content."
    

    Edit the clipboard content.

    $ cb edit
    $ cb --edit
    $ cb ed
    $ cb --ed
    # These all work great!
    

    Use a custom editor to edit with.

    cb edit nano
    cb ed vim
    cb ed code
    

    Start simple.

    $ cb script pwd # Note: The exact output of "pwd" will vary depending on your system.
    $ cb
    /run/user/1000/Clipboard/0/data/0
    # The output of CB will be here
    /run/user/1000/Clipboard/0/data/0
    

    Use a script file instead.

    $ cat myscript.sh
    echo "Hello Clipboard!"
    echo "Here's what's in the directory:"
    ls
    $ cb script myscript.sh
    $ cb
    Hello Clipboard!
    Here's what's in the directory:
    rawdata.clipboard
    # The output of CB will be here
    Hello Clipboard!
    Here's what's in the directory:
    rawdata.clipboard
    

    Customize during what action the script runs.

    $ cb script ls --actions search,history
    $ cb
    $ cb history
    rawdata.clipboard
    # The output of CB will be here
    rawdata.clipboard
    $ cb search
    rawdata.clipboard
    # The output of CB will be here
    rawdata.clipboard
    $ cb copy
    $
    

    Customize if the script runs before, after, or both.

    $ cb script ls --timings before
    $ cb
    rawdata.clipboard
    # The output of CB will be here
    $ cb script ls --timings after
    $ cb
    # The output of CB will be here
    rawdata.clipboard
    $ cb script ls --timings before,after
    rawdata.clipboard
    # The output of CB will be here
    rawdata.clipboard
    

    Customize both during what action the script runs and if the script runs before, after, or both.

    $ cb script ls --actions copy --timings before
    $ cb
    $ cb copy
    rawdata.clipboard
    # The output of CB will be here
    

    View the current script.

    $ cb script
    # Script content shows here
    

    Start by copying something.

    $ cb copy "Yo dawg! I heard you liked bachata music."
    

    Load the contents of the clipboard into other clipboards.

    $ 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!
    

    Note: If you don't provide a destination clipboard, then the Load action will load the contents into the default clipboard.

    Load the contents of some clipboard into the default.

    $ cb load_foo
    

    Note: This is useful if you want to load content into GUI clipboard systems, as they only connect to the default clipboard.

    Start by copying something to two clipboards.

    $ 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."
    

    Swap the contents of two clipboards.

    $ 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.
    

    Note: If you don't provide a destination clipboard, then the Swap action will swap the contents into the default clipboard.

    Start by exporting a clipboard.

    $ 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
    

    Import all clipboards from a folder.

    $ cb import
    $ cb --import
    $ cb imp
    $ cb --imp
    # These all work great!
    

    Note: Currently, CB imports from a folder called Exported_Clipboards.

    Choose what folder to import from.

    $ cb import MySavedClipboards
    

    Start by copying something.

    $ cb copy "Aventura's music is some of the most erotic you'll find anywhere."
    

    Export all clipboards to a folder.

    $ cb export
    $ cb --export
    $ cb ex
    $ cb --ex
    # These all work great!
    

    Note: Currently, CB exports to a folder called Exported_Clipboards.

    Choose what clipboards to export.

    $ cb export 1 2 3
    

    Start by copying several things.

    $ cb copy "There are at least two \"Anthony Santos\" who are known for bachata music: the \"regular\" Anthony Santos and Anthony \"Romeo\" Santos."
    $ cb copy "blah blah blah"
    $ cb copy "Clipboard Project is the best clipboard manager around"
    

    Show the history.

    $ cb history
    $ cb --history
    $ cb hs
    $ cb --hs
    # These all work great!
    

    Start by copying several things.

    $ cb copy "There are at least two \"Anthony Santos\" who are known for bachata music: the \"regular\" Anthony Santos and Anthony \"Romeo\" Santos."
    $ cb copy "blah blah blah"
    $ cb copy "Clipboard Project is the best clipboard manager around"
    

    Bring an older entry (or entries) to the front.

    $ cb history 1
    $ cb --history 2
    $ cb hs 1
    $ cb --hs 1 2
    # These all work great!
    

    Add a personal note to a clipboard.

    $ 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!
    

    Add a personal note to a clipboard by piping it in.

    $ echo "For my Aventura music collection" | cb note
    

    Remove a note from a clipboard.

    $ cb note ""
    

    Start by adding a note to a clipboard.

    $ cb note "For my Aventura music collection"
    

    Show the note you added.

    $ cb note
    $ cb --note
    $ cb nt
    $ cb --nt
    

    Set some kinds of content to always ignore.

    $ 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.
    

    Set an ignore regex rule by piping it in.

    $ echo "[abc]{10}" | cb ignore
    

    Remove all ignore regex rules from a clipboard.

    $ cb ignore ""
    

    Start by adding some ignore regex rules to a clipboard.

    $ cb ignore "Foo" "Bar" "Baz"
    

    Show the rules you just added.

    $ cb ignore
    $ cb --ignore
    $ cb ig
    $ cb --ig
    

    Show helpful details for a clipboard.

    $ cb info
    $ cb --info
    $ cb in
    $ cb --in
    # All are the same!
    

    Output these helpful details in JSON format.

    $ cb info | cat
    $ cb info | jq
    

    Start by copying several things.

    $ cb copy Foo Bar Baz
    $ cb copy "Some example content"
    $ cb copy2 "Blah bleh bluh bloh"
    

    Search a clipboard's contents.

    $ cb search Foo
    $ cb --search Blah
    $ cb sr Bar
    $ cb --sr Baz
    # All are the same!
    

    Show the help message.

    $ cb help
    $ cb --help
    $ cb -h 
    # These three versions all work great!
    

    Check the status of all clipboards that have content.

    $ cb status
    $ cb --status
    $ cb st
    $ cb --st
    $ cb 
    # These all work great!
    

    Get the status of all clipboards in JSON format.

    $ cb status | cat
    

    Check your configuration of CB.

    $ cb config
    $ cb --config
    $ cb cfg
    $ cb --cfg
    # These all work great!
    

    Need to paste a funky symbol somewhere a lot? Copy it to a persistent clipboard.

    $ cb cp_theta θ
    $ cb -c amog cp ඞ
    

    Paste whatever's in the clipboard straight into your favorite text editor.

    # Vim
    :r !cb
    # Nano
    [Ctrl-T] cb
    # VSCode
    cb | code -
    

    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
    

    Yank anything sitting in your terminal without ever touching the mouse.

    $ env | yank -d = -- cb
    

    Instantly copy to the main clipboard using your favorite dmenu tool.

    $ cb cp "$(cb st | jq -r '.[] | if type=="array" then .[].path else if type=="object" then .path else . end end' | dmenu)"
    # For copying the latest entry from any of your clipboards
    $ cb cp "$(cb hs | jq -r '.[].content | if type=="array" then .[].path else if type=="object" then .path else . end end' | dmenu)"
    # For copying any entry from a specific clipboard
    

    Need to share or pore over log files? Copy them in one step!

    $ 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"
    

    Simple Configuration

    Start from a blank slate.

    $ cb --all clear
    

    WARNING! This will get rid of everything you've stored with CB, so be very careful when clearing with this option.

    Choose a non-default clipboard.

    $ cb -c 5 copy Foobar
    $ cb --clipboard 10 copy BarBaz
    

    Copy to a temporary clipboard that doesn't start with a number.

    $ cb -c SomeCB copy "A really really long sentence, and I mean really really super DUPER long!"
    

    Note: Although copying to a temporary clipboard that doesn't start with a number is impossible using the conventional method of adding it to the end of the action, this alternative method is completely supported and works great.

    Choose a persistent clipboard.

    $ cb -c _ copy "Generation Next"/*
    

    Choose a non-default history entry.

    $ cb -e 5 copy Foobar
    $ cb --entry 10 copy BarBaz
    

    Note: To copy to a non-default entry, that entry must exist already.

    Copy a lot of files in much less time than before.

    $ cb --fast-copy copy /usr/bin/*
    

    Save GUI clipboard content of a specific MIME type to the main clipboard.

    $ cb --mime text/html | cb
    

    Reduce distractions after showing some text content.

    $ cb -nc sh | cat
    

    Reduce distractions while doing a search that takes a while.

    $ fzf | cb -np
    

    Ignore a password.

    $ cb ignore --secret MyVerySecurePassword
    $ cb ignore --secret # This will show the SHA512 hash of MyVerySecurePassword
    $ cb ignore --secret MyVerySecurePassword2 "someOTHER secret1 banana"
    $ cb ignore --secret # Now it will show the SHA512 hashes of MyVerySecurePassword2 and someOTHER secret1 banana
    

    Clear all your passwords.

    $ cb ignore --secret ""
    # WARNING: Once you clear all secrets, there is no going back.
    

    Make your life less boring.

    $ cb --bachata
    

    Use CB in a CI script.

    ...
    cb cp Temp/*
    ...
    cb p
    ...
    

    Start with a script.

    $ cb script ls
    $ cb history
    # Now, whatever script CB runs will have access to the CLIPBOARD_ACTION environment variable, here with value "history"
    

    Set a custom editor to use.

    $ export CLIPBOARD_EDITOR=nano
    

    Note: The environment variables EDITOR and VISUAL by default take precedence if CLIPBOARD_EDITOR isn't set.

    CLIPBOARD_HISTORY supports up to 2^32 - 1 as a value. So, go ahead. Crank that b*tch up to a billion.

    $ export CLIPBOARD_HISTORY=1000000000
    $ cb copy "Oh yeah!"
    

    Only keep a certain amount of data.

    $ export CLIPBOARD_HISTORY=100tb
    $ cb copy Yo_Mama.tar.gz
    

    Note: You can choose between tb, gb, mb, kb, and b to specify amounts for terabytes, gigabytes, megabytes, kilobytes, and bytes respectively.

    Only keep a certain time length.

    $ export CLIPBOARD_HISTORY=52w
    

    Note: You can choose between y, m, w, d, and h to specify amounts for years, months, weeks, days, and hours respectively.

    Change the locale to match what you're more comfortable with.

    $ export CLIPBOARD_LOCALE=es_DO.UTF-8
    $ cb cp "Amo a Aventura"
    
    > $Env:CLIPBOARD_LOCALE=es_DO.UTF-8
    # Powershell version
    

    Override the locale case-by-case.

    $ export CLIPBOARD_LOCALE=fr_CA.UTF-8
    ...
    $ CLIPBOARD_LOCALE="" cb cp Foobar
    

    Start with a script.

    $ cb script ls
    $ cb history
    # Now, whatever script CB runs will have access to the CLIPBOARD_SCRIPT_TIMING environment variable, here with value "before"
    # (output of "cb history")
    # Now, CLIPBOARD_SCRIPT_TIMING will have value "after"
    

    Choose a special place to put your temporary clipboards this one time.

    $ CLIPBOARD_TMPDIR=/home/jackson/SomeDirectory cb copy *
    

    Choose a special place to put your temporary clipboards every time.

    $ export CLIPBOARD_TMPDIR=/home/jackson/SomeDirectory
    $ cb copy *
    > $Env:CLIPBOARD_TMPDIR = /home/jackson/SomeDirectory
    # Powershell
    

    Note: By default, CB uses the C++ filesystem library function fs::temp_directory_path() to generate the temporary directory, prioritizing CLIPBOARD_TMPDIR and then XDG_RUNTIME_DIR respectively first if CB can get a value from them.

    Choose a special place to put your persistent clipboards this one time.

    $ CLIPBOARD_PERSISTDIR=/home/jackson/SomeDirectory cb copy *
    

    Choose a special place to put your persistent clipboards every time.

    $ export CLIPBOARD_PERSISTDIR=/home/jackson/SomeDirectory
    $ cb copy *
    > $Env:CLIPBOARD_PERSISTDIR = /home/jackson/SomeDirectory
    # Powershell
    

    Note: By default, CB uses the user's home directory to generate the persistent directory, prioritizing CLIPBOARD_PERSISTDIR and then XDG_STATE_HOME first respectively if CB can get a value from them.

    Make everything you copy persistent.

    $ export CLIPBOARD_CUSTOMPERSIST=".*"
    $ cb copy Foo Bar Baz
    # This puts everything in the persistent directory but still with the clipboard name "0"
    

    Make some clipboards persistent.

    $ export CLIPBOARD_CUSTOMPERSIST=5
    $ cb copy5 Foo Bar Baz
    

    Turn off those sound effects.

    $ export CLIPBOARD_NOAUDIO=1
    $ cb ffksdjfdj 
    # No more error sounds after doing a nonexistent command
    

    Debug a flaky GUI system by disabling its integration with CB.

    $ CLIPBOARD_NOGUI=1 cb show
    $ export CLIPBOARD_NOGUI=1
    $ cb show
    

    Reduce distractions while doing a search that takes a while.

    $ fzf | CLIPBOARD_NOPROGRESS=1 cb
    

    Disable progress messages from CB entirely.

    $ export CLIPBOARD_NOPROGRESS=1
    $ fzf | cb
    

    Disable all clipboard content transfers through the terminal.

    $ export CLIPBOARD_NOREMOTE=1
    

    Rest in peace by seeing nothing that isn't an error.

    $ export CLIPBOARD_SILENT=1
    $ cb cp "I'm running out of Aventura references"
    

    Remind yourself of the terminals of the past.

    $ 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"
    

    Make CB more accessible.

    $ export CLIPBOARD_THEME=darkhighcontrast
    $ cb show
    

    Fully customize your style.

    $ export CLIPBOARD_THEME=help=r;g;b,info=r;g;b,error=r;g;b,success=r;g;b,progress=r;g;b
    # Note: You must put in a number within range 0-255 for each r, g, and b
    

    Override somebody else's choice to disable colors.

    $ export NO_COLOR=1
    ...
    $ FORCE_COLOR=1 cb copy "There are almost no bachateros where I live right now"
    

    Note: CB also supports CLICOLOR_FORCE.

    Override somebody else's choice to disable colors, but in a different way.

    $ export CLICOLOR=0
    ...
    $ CLICOLOR_FORCE=1 cb copy "There are almost no bachateros where I live right now"
    

    Make CB look boring.

    $ export NO_COLOR=1
    $ cb cp "From the 1960s until the 1990s, bachata was perceived as boring music for poor Dominicans."
    

    Note: CB also supports CLICOLOR.

    Make CB look boring, but in a different way.

    $ export CLICOLOR=0
    $ cb cp "In the 1990s, though, several innovative musicians reinvigorated bachata by using electric guitars with fancy effects."
    

    Need Help?

    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!

    Thank You!

    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.

    Special thanks to MacStadium for sponsoring the Clipboard Project by providing a Mac Mini for macOS development!

    And if you're feeling generous, feel free to give us a :star:! We appreciate every single one - including yours.