A Smart Clipboard Manager for Ubuntu using TypeScript/Node.js that stores clipboard history in JSON files (no database needed), with hotkeys, search, and GitHub Gist sync.
- Setup Guide - START HERE! Complete step-by-step installation guide
- Quick Reference - Command cheat sheet
- Examples - Practical usage scenarios
- Contributing - Development guide
- Clipboard History: Automatically saves clipboard content to JSON files
- Search: Search through your clipboard history with powerful query options
- Hotkeys: Global keyboard shortcuts for quick access (Ctrl+Shift+V, Ctrl+Shift+F)
- GitHub Gist Sync: Backup and sync your clipboard history to GitHub Gist
- JSON Storage: All data stored in simple JSON files - no database required
- CLI Interface: Full command-line interface for all operations
- Privacy: All data stored locally, sync is optional
For detailed step-by-step instructions, see SETUP.md
- Node.js 18+ and npm
- Ubuntu/Linux (for clipboard and hotkey support)
- xclip (install with:
sudo apt-get install xclip)
# Clone the repository
git clone https://github.com/dev31sanghvi/Copybuffer.git
cd Copybuffer
# Install dependencies
npm install
# Build the project
npm run build
# Optional: Install globally
sudo npm link
# Verify installation
copybuffer --helpHaving trouble? Check the Setup Guide for troubleshooting steps.
Start the clipboard monitor to automatically save clipboard history:
copybuffer startThis will run in the foreground. Press Ctrl+C to stop.
Check if copybuffer is running:
copybuffer statusView your recent clipboard entries:
# Show last 10 entries (default)
copybuffer list
# Show last 20 entries
copybuffer list --limit 20Search for specific content:
copybuffer search "your search query"
# Limit results
copybuffer search "query" --limit 5Copy a previous clipboard entry back to your clipboard:
copybuffer copy <entry-id>Remove an entry from history:
copybuffer delete <entry-id>Clear all clipboard history:
# With confirmation
copybuffer clear --yesExport your clipboard history:
copybuffer export ~/clipboard-backup.jsonImport clipboard history:
copybuffer import ~/clipboard-backup.json-
Create a GitHub Personal Access Token:
- Go to GitHub Settings → Developer settings → Personal access tokens
- Generate new token with
gistscope
-
Configure Copybuffer:
# Enable gist sync
copybuffer config-set gist.enabled true
# Set your GitHub token
copybuffer config-set gist.token YOUR_GITHUB_TOKENUpload your clipboard history to GitHub Gist:
copybuffer sync-to-gistDownload and merge clipboard history from GitHub Gist:
copybuffer sync-from-gistView current configuration:
copybuffer configSet configuration values:
# Set max history size
copybuffer config-set maxHistorySize 2000
# Set data directory
copybuffer config-set dataDir /path/to/data
# Configure hotkeys (use simple keys like F9, F10)
copybuffer config-set hotkeys.toggleHistory "F11"Configuration is stored at ~/.copybuffer/config.json:
{
"dataDir": "~/.copybuffer",
"maxHistorySize": 1000,
"autoSave": true,
"hotkeys": {
"toggleHistory": "F9",
"search": "F10"
},
"gist": {
"enabled": false,
"token": "",
"gistId": ""
}
}All clipboard data is stored in JSON format at ~/.copybuffer/:
config.json- Configuration settingshistory.json- Clipboard history
{
"id": "unique-uuid",
"content": "clipboard content",
"timestamp": 1234567890123,
"type": "text",
"source": "optional-source",
"tags": ["optional", "tags"]
}Default hotkeys (configurable):
F9- Toggle clipboard historyF10- Search clipboard
Requirements:
- Hotkeys require an X11 display server (graphical environment)
- Works on Ubuntu/Linux with X11, Windows, and macOS
- Will be automatically disabled if running in a headless/non-graphical environment
Note: The current implementation uses simple key bindings (like F9, F10). Complex key combinations (like Ctrl+Shift+V) are not currently supported but may be added in future versions.
npm run buildnpm run watchnpm run lintnpm run formatYou can also use Copybuffer programmatically in your Node.js applications:
// After installing globally with npm link:
import { clipboardMonitor, searchManager, storageManager } from 'copybuffer';
// For local development, import from the built files:
// import { clipboardMonitor, searchManager, storageManager } from './dist/exports';
// Start monitoring
clipboardMonitor.start();
// Search clipboard
const results = searchManager.search({ query: 'test', limit: 10 });
// Get recent entries
const recent = searchManager.getRecent(20);
// Load history
const history = storageManager.loadHistory();See EXAMPLES.md for more detailed usage examples.
Ensure you have the required permissions for clipboard access:
# Install xclip if needed
sudo apt-get install xclipHotkeys require an X11 display server (graphical environment). Common issues:
- Running in headless mode: Hotkeys won't work without a graphical environment. The application will still work for all other features.
- Wayland instead of X11: If you're using Wayland, you may need to switch to an X11 session or use XWayland compatibility.
- Permission issues: Ensure your user has permission to capture global keyboard events.
If hotkeys are not essential to your workflow, you can use the CLI commands instead (e.g., copybuffer list, copybuffer search).
- Verify your GitHub token has the
gistscope - Check your internet connection
- Ensure the token is correctly set in config
- All clipboard data is stored locally by default
- GitHub Gist sync is optional and disabled by default
- Use private gists (default) to keep your data secure
- Your GitHub token is stored in plain text in the config file - keep it secure
- Consider using encryption for sensitive clipboard data
This project is for personal use, but feel free to fork and modify for your own needs!
MIT License - See LICENSE file for details
Created for personal use by Dev Sanghvi