cliphist
Manage clipboard history entries
TLDR
List clipboard history entries
Select and copy a previous clipboard entry (using fzf)
Delete all stored clipboard entries
Delete a specific clipboard entry by ID
Save the current clipboard content manually
SYNOPSIS
cliphist [OPTIONS] COMMAND [<ARGS>]
cliphist store
cliphist list [-c | -n
cliphist print <INDEX>
cliphist delete [<INDEX>]
cliphist wipe
cliphist broot
cliphist listen
cliphist version
cliphist help
PARAMETERS
COMMAND
Specifies the operation to perform. Common commands include store, list, print, delete, and wipe.
-c, --clipboard
When used with list, also prints the current clipboard content in addition to history.
-n <NUMBER>, --num <NUMBER>
Limits the number of history entries displayed by list.
-j, --json
Outputs clipboard history in JSON format, useful for scripting.
-z, --zero
Separates output entries with null bytes, commonly used with xargs -0.
-t <TAB_INDEX>, --tab <TAB_INDEX>
Switches to a specified tab index for listing or other operations (if tab feature is enabled/used).
-d <PATH>, --dir <PATH>
Specifies an alternative directory for storing the clipboard history database.
-h, --help
Displays the help message for cliphist or a specific subcommand.
-v, --version
Shows the version information of the cliphist utility.
DESCRIPTION
cliphist is a lightweight clipboard history manager designed specifically for Wayland compositors. It addresses the common need for users to access previous clipboard entries, a feature often missing in native Wayland environments. The command works by storing all text copied to the Wayland clipboard (via wl-copy) into a local database. Users can then retrieve these past entries, print them, or select them interactively using external tools like dmenu or wofi. This makes cliphist an essential utility for enhancing productivity on Wayland, allowing for quick recall and reuse of previously copied text snippets without needing to re-copy them. It supports various operations like listing, searching, deleting, and printing specific entries from the history.
CAVEATS
cliphist is designed exclusively for Wayland compositors and relies on wl-copy and wl-paste for clipboard interaction. It will not function in X11 environments. Interactive selection of clipboard history entries typically requires an external dmenu-compatible program like dmenu, wofi, or rofi, which must be installed and configured separately.
INTERACTIVE SELECTION
To make cliphist interactive, users commonly pipe its list output to a dmenu-compatible tool. For example, cliphist list | wofi --dmenu | cliphist print allows selecting an entry visually and pasting it.
DATA STORAGE
By default, cliphist stores its history database in ~/.local/share/cliphist/db. This allows for persistent storage of clipboard entries across sessions.
LISTEN MODE
The cliphist listen command starts a daemon that continuously monitors the Wayland clipboard for new entries, automatically storing them as they are copied.
HISTORY
cliphist emerged as a solution to fill a functional gap in the Wayland ecosystem. While X11 had various clipboard tools and managers, Wayland initially lacked a widely adopted, simple, and effective command-line utility for managing clipboard history. Developed by a community member, it quickly gained popularity as a go-to tool for Wayland users seeking to replicate the convenience of a persistent clipboard history. Its design focuses on simplicity and integration with existing Wayland tools and command-line workflows, leveraging wl-copy and wl-paste for its core operations.


