Wayland clipboard "manager" with fast persistent history and multi-media support
  • Rust 97.1%
  • Nix 2.9%
Find a file
NotAShelf 7ebe514e3a
stash: deduplicate error reporting
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964f0f3f13190dde392fc859718716b56a8
2025-08-12 17:34:42 +03:00
.github/workflows ci: publish tagged releases 2025-08-12 17:34:40 +03:00
nix nix: clean up packaging 2025-08-12 15:01:31 +03:00
src stash: deduplicate error reporting 2025-08-12 17:34:42 +03:00
vendor vendor systemd service 2025-08-12 15:01:29 +03:00
.envrc initial commit 2025-08-12 15:01:13 +03:00
.gitignore initial commit 2025-08-12 15:01:13 +03:00
Cargo.lock treewide: improve logging; custom error types with thiserror 2025-08-12 17:34:41 +03:00
Cargo.toml treewide: improve logging; custom error types with thiserror 2025-08-12 17:34:41 +03:00
flake.lock initial commit 2025-08-12 15:01:13 +03:00
flake.nix nix: clean up packaging 2025-08-12 15:01:31 +03:00
README.md docs: document basic usage 2025-08-12 15:01:30 +03:00

Stash

Wayland clipboard "manager" with fast persistent history and multi-media support. Stores and previews clipboard entries (text, images) on the command line.

Features

  • Stores clipboard entries with automatic MIME detection
  • Fast persistent storage using sled
  • List, search, decode, delete, and wipe clipboard history
  • Backwards compatible with Cliphist TSV format
    • Import clipboard history from TSV (e.g., from cliphist list)
  • Image preview (shows dimensions and format)
  • Deduplication and entry limit control
  • Text previews with customizable width

Usage

Command interface is only slightly different from Cliphist. In most cases, it will be as simple as replacing cliphist with stash in your commands, aliases or scripts.

Store an entry

echo "some clipboard text" | stash store

List entries

stash list

Decode an entry by ID

stash decode --input "1234"

Delete entries matching a query

stash delete-query --query "some text"

Delete multiple entries by ID (from a file or stdin)

stash delete < ids.txt

Wipe all entries

stash wipe

Options

Some commands take additional flags to modify Stash's behavior. See each commands --help text for more details. The following are generally standard:

  • --db-path <path>: Custom database path
  • --max-items <N>: Maximum number of entries to keep (oldest trimmed)
  • --max-dedupe-search <N>: Deduplication window size
  • --preview-width <N>: Text preview max width for list

Tips & Tricks

Migrating from Cliphist

Stash is designed to be backwards compatible with Cliphist. Though for brevity, I have elected to skip automatic database migration. Which means you must handle the migration yourself, with one simple command.

$ cliphist list --db ~/.cache/cliphist/db | stash --import-tsv
# > Imported 750 records from TSV into sled database.

Alternatively, you may first export from Cliphist and then import the database.

$ cliphist list --db ~/.cache/cliphist/db > cliphist.tsv
$ stash --import-tsv < cliphist.tsv
# > Imported 750 records from TSV into sled database.