Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
pbring
Secure macOS clipboard history daemon. Encrypted, headless, pipe-first. Like cliphist, but for macOS.
pasteboard + ring -- stores copy history in an encrypted ring buffer, like Emacs kill-ring.
Features
- AES-256-GCM per-entry encryption with key stored in macOS Keychain
- Automatic filtering of passwords (1Password, Keychain, etc.) via NSPasteboard markers
- Loop prevention via
org.nspasteboard.source - TTL-based auto-expiry (default: 24h)
- Memory safety with
zeroize-- plaintext is wiped on drop - No UI -- pure CLI, composable with any picker via pipes
Install
Quick Start
# Start the daemon (foreground)
# Or register with launchd for auto-start
# Pick from history and copy to clipboard
| |
Commands
pbringd
Daemon binary. Polls NSPasteboard.general.changeCount every 500ms, encrypts and stores clipboard content in SQLite.
- PID file:
~/.local/state/pbring/pbringd.pid - Handles
SIGTERM/SIGINTfor clean shutdown
pbring list
<id>\t<timestamp>\t<type>\t<preview>
| Option | Description |
|---|---|
--limit N |
Max entries to show (default: 100) |
--type text|image|file |
Filter by media type |
pbring get
Reads one line from stdin (<id>\t...), retrieves and decrypts the entry, and writes raw bytes to stdout. Useful for piping to other tools.
| |
pbring copy
Reads one line from stdin (<id>\t...), retrieves and decrypts the entry, and writes it to the system pasteboard with the correct UTI. Works with text, images, and files.
| |
pbring delete
Reads one line from stdin and deletes the entry.
|
pbring clear
Deletes all entries. DB file remains.
pbring wipe
Deletes all entries, zero-fills the DB file, then removes it.
Security
Pasteboard Marker Filtering
The daemon inspects NSPasteboard.general.types and skips entries with these markers:
| Marker | Source |
|---|---|
org.nspasteboard.ConcealedType |
Passwords (1Password, LastPass, Keychain) |
org.nspasteboard.TransientType |
Temporary content (TextExpander) |
org.nspasteboard.AutoGeneratedType |
Auto-generated content (Keyboard Maestro) |
com.agilebits.onepassword |
1Password specific |
PasswordPboardType |
Legacy password marker |
Encryption
- Algorithm: AES-256-GCM with random 96-bit nonce per entry
- Key: 256-bit, generated on first run, stored in macOS Keychain (
com.pbring.encryption-key) - Keychain access via
securityCLI
Memory Safety
- Decrypted data held in
Zeroizing<Vec<u8>>-- wiped on drop - Encryption key held in
Zeroizing<[u8; 32]>
Configuration
~/.config/pbring/config.toml
= 500 # Polling interval (ms)
= 1000 # Max stored entries
= 86400 # Entry TTL (0 = no expiry)
= 10_485_760 # Max entry size (10MB)
= ["text", "image", "file"]
= [] # Additional NSPasteboardType strings to ignore
= [] # Bundle IDs to ignore
= 100 # Preview truncation length
All fields are optional; defaults are shown above.
File Locations
| File | Path |
|---|---|
| Database | ~/.local/share/pbring/history.db |
| Config | ~/.config/pbring/config.toml |
| PID file | ~/.local/state/pbring/pbringd.pid |
| launchd plist | ~/Library/LaunchAgents/com.pbring.daemon.plist |
Requirements
- macOS 14 (Sonoma) or later
- Rust 1.75+
License
MIT