Command line (clipd)
clipd is ClipTrail from a terminal: capture without the desktop app, search and script your history, and run or join a sync hub. It uses the same data folder as the app.
Install
cargo install --locked --git https://github.com/abhijitdalal26/cliptrail clipd-cli
Needs Rust 1.96 or newer; on Linux also libxcb1-dev (Debian/Ubuntu). Prebuilt archives (clipd-<version>-x86_64-pc-windows-msvc.zip, clipd-<version>-x86_64-unknown-linux-gnu.tar.gz) are attached to each release.
On Linux, the quickest install is the script — it downloads the latest release archive, verifies the SHA-256 checksum and installs clipd to ~/.local/bin:
curl -fsSL https://raw.githubusercontent.com/abhijitdalal26/cliptrail/main/install.sh | sh
sh -s -- --system installs to /usr/local/bin instead; set CLIPD_INSTALL_DIR to pick another directory. Works on any distro with curl, tar and sha256sum.
Content stays private in your terminal too. Only clipd show prints a clip in full. Everything else prints ids, kinds and a one-line preview, and watch and the sync commands never print clip content at all.
Global options
| Option | Meaning |
|---|---|
--data-dir <DIR> | Use this data folder. Default: $CLIPTRAIL_DATA_DIR, else the OS data folder. |
-h, --help | Help for any command, e.g. clipd sync host --help. |
-V, --version | Print the version. |
Wherever a command takes an <ID>, you can give the full id or any prefix that matches exactly one clip.
Kinds for --kind: link, code, text, contact, color, file, image, sensitive.
clipd watch
Watch the clipboard and store every copy until Ctrl C. Prints one line per event (time, outcome, kind, id), never the content, and removes expired sensitive clips every 5 minutes. Don't run it at the same time as the desktop app, which already captures.
$ clipd watch
watching clipboard → C:\Users\you\AppData\Roaming\ClipTrail (Ctrl+C to stop)
14:02:11 stored link/github.com 01JBX4Q8M7T2ZK9R3D5F6H0WNC
14:02:40 stored code/rust 01JBX4R4V1KQ8D2N6S0Y3C7FZB
14:03:05 bumped link/github.com 01JBX4Q8M7T2ZK9R3D5F6H0WNC
14:03:30 skipped (excluded source app)
clipd list
Recent clips, newest first.
| Flag | Meaning |
|---|---|
--kind <KIND> | Only this kind. |
--pinned | Only pinned clips. |
-n, --limit <N> | Maximum rows (default 25). |
--json | Print JSON instead of a table. |
Each row shows the id, date, kind (with language or site), flags (P pinned, + copied more than once) and a one-line preview.
clipd list --kind link -n 10
clipd list --pinned --json
clipd search
Substring search over clip text, file paths and source app.
| Argument / flag | Meaning |
|---|---|
<QUERY> | Text to find (quote it if it has spaces). |
--kind <KIND> | Only this kind. |
-n, --limit <N> | Maximum rows (default 25). |
--json | Print JSON. |
clipd search "deploy"
clipd search kubectl --kind code --json
clipd show
One clip in full: id, kind, created and last-seen times, copy count, source app, device, size, image paths, then the content.
| Argument / flag | Meaning |
|---|---|
<ID> | Clip id or unique prefix. |
--json | Print JSON. |
--reveal | Also print the body of a masked (sensitive) clip. Without it, sensitive clips show ••••••. |
clipd show 01JBX4R4
clipd stats
Data folder, database size, total and pinned clips, counts by kind, top source apps and clips per day for the last 7 days.
clipd pin / unpin
clipd pin <ID> keeps a clip forever (never removed by retention); clipd unpin <ID> undoes it.
clipd delete
clipd delete <ID> deletes a clip and its image files. If sync is set up, the delete syncs to your other devices.
clipd prune
Removes expired clips (sensitive clips past their lifetime) right away instead of waiting for the next automatic pass.
clipd ingest-text / ingest-image
Store a clip without touching the clipboard, for scripts and testing. It goes through the same pipeline (classification, dedup, exclusions) as a real copy.
| Command | Meaning |
|---|---|
clipd ingest-text <TEXT> | Store text. Use - to read from standard input. |
clipd ingest-image <PATH> | Store an image from a PNG file. |
--app <EXE> | Pretend the copy came from this app, e.g. to test an exclusion. |
git log -1 --format=%H | clipd ingest-text -
clipd ingest-text "hunter2" --app keepassxc.exe # skipped: excluded app
clipd ingest-image ./screenshot.png
clipd sync
Run a hub, pair with one, and manage devices from the terminal. These commands print device names, ids and event metadata only. Close the desktop app before using them on the same data folder.
clipd sync host
Run this data folder as the sync hub and print a pairing QR code in the terminal (press Enter for a new code, Ctrl C to stop).
| Flag | Meaning |
|---|---|
--port <PORT> | TCP port to listen on (default 47821). |
--advertise <HOST> | Address to put in the QR instead of this computer's LAN addresses. Repeatable. E.g. 127.0.0.1 for a test on one machine. |
--loopback | Listen on 127.0.0.1 only. |
--name <NAME> | Name shown on paired devices. |
--no-pair | Don't print a pairing QR at start. |
clipd sync pair
clipd sync pair <URI> [--name <NAME>] pairs this data folder as a client of a hub, using the cliptrail://pair?… link from the hub. It prints the hub's name, the check code to compare, and how many existing clips were queued to share. Fails if this folder is already a hub or paired; run clipd sync reset first.
clipd sync run
Run the client loop until Ctrl C, printing connects, disconnects and event metadata. --no-images syncs thumbnails only and skips full image downloads.
devices, revoke, status, reset
| Command | Meaning |
|---|---|
clipd sync devices [--json] | Paired devices with id, name, platform and last seen. |
clipd sync revoke <DEVICE_ID> | Hub only. The device's token stops working at once. |
clipd sync status [--json] | Role (hub or client), device, hub address, log position, outbox, pending images, where keys are kept, the last problem, and devices. |
clipd sync reset | Forget sync for this data folder: keys, sync progress and device list. Clips are kept. |
# Try sync on one machine with two data folders
clipd --data-dir ./hub sync host --loopback --advertise 127.0.0.1
# in a second terminal, with the link it printed:
clipd --data-dir ./phone sync pair "cliptrail://pair?v=1&h=127.0.0.1:47821&…"
clipd --data-dir ./phone sync run
Environment variables
| Variable | Effect |
|---|---|
CLIPTRAIL_DATA_DIR | Data folder to use (same as --data-dir), for the app and the CLI. |
CLIPTRAIL_KEYSTORE=file | Keep sync keys in a file in the data folder instead of the OS keychain. |
RUST_LOG | Log level, e.g. RUST_LOG=debug. Logs go to stderr and never contain clip content. |