Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpbrd – Custom Clipboard Manager for macOS

This tool captures everything you copy on your Mac and saves it in a history file. You can view and reuse past clipboard entries via the terminal.

Features

  • Automatically logs clipboard contents with timestamps.
  • Stores clipboard history as JSON.
  • Simple CLI (cpbrd) to:
    • View clipboard history.
    • Copy any previous entry back to the clipboard by ID.
  • Runs in the background as a launchd daemon.

Installation

1. Clone or copy the files

mkdir -p ~/.clipboard
cd ~/.clipboard
# Copy the following files here:
# - clipboard_daemon.sh
# - cpbrd
# Make sure they're executable
chmod +x clipboard_daemon.sh cpbrd

2. Move the CLI tool to your PATH

sudo cp cpbrd /usr/local/bin/cpbrd

Now you can use cpbrd anywhere in your terminal

3. Set up the daemon to run at startup

create a launch agent

mkdir -p ~/Library/LaunchAgents
nano ~/Library/LaunchAgents/com.nimish.clipboard.plist

Paste this content

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.nimish.clipboard</string>

    <key>ProgramArguments</key>
    <array>
        <string>/Users/YOUR_USERNAME/.clipboard/clipboard_daemon.sh</string>
    </array>

    <key>RunAtLoad</key>
    <true/>

    <key>KeepAlive</key>
    <true/>

    <key>StandardOutPath</key>
    <string>/tmp/clipboard_daemon.log</string>

    <key>StandardErrorPath</key>
    <string>/tmp/clipboard_daemon.err</string>
</dict>
</plist>

Replace YOUR_USERNAME with your actual macOS username or user $(whoami).

Load the daemon

launchctl load ~/Library/LaunchAgents/com.nimish.clipboard.plist

Usage

cpbrd           # View history (ID + first line preview)
cpbrd 2         # Copy entry with ID 2 to clipboard

Uninstall

launchctl unload ~/Library/LaunchAgents/com.nimish.clipboard.plist
rm ~/Library/LaunchAgents/com.nimish.clipboard.plist
rm -rf ~/.clipboard
sudo rm /usr/local/bin/cpbrd

About

A Simple CLI Clipboard Manager tool.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages