An advanced clipboard manager and transformer for developers with cross-platform support, history tracking, text transformations, and custom scripting hooks.
- π₯οΈ Cross-platform: Works on Linux, macOS, and Windows
- π Clipboard Operations: Read from and write to system clipboard
- π History Tracking: Automatically tracks clipboard history (up to 100 entries)
- π Text Transformations: Built-in transformations for common tasks
- Format/minify JSON
- Trim whitespace
- Case conversions (upper, lower, title)
- Base64 encode/decode
- URL encode/decode
- Reverse text
- π§ Custom Hooks: Execute custom scripts on clipboard content
- β¨οΈ Clean CLI: Simple and intuitive command-line interface
Linux: Install xclip or xsel
# Ubuntu/Debian
sudo apt-get install xclip
# Fedora
sudo dnf install xclip
# Arch Linux
sudo pacman -S xclipmacOS: No additional dependencies (uses built-in pbcopy/pbpaste)
Windows: No additional dependencies (uses PowerShell)
git clone https://github.com/BaseMax/go-clipboard-plus.git
cd go-clipboard-plus
go build -o clipctl ./cmd/clipctlThen move the clipctl binary to a directory in your PATH:
sudo mv clipctl /usr/local/bin/# Copy text directly
clipctl copy "Hello World"
# Copy from stdin
echo "Hello World" | clipctl copy
cat file.txt | clipctl copy# Paste to stdout
clipctl paste
# Pipe to other commands
clipctl paste | grep "pattern"# Show last 10 entries (default)
clipctl history
# Show last N entries
clipctl history -n 5
# Show all entries
clipctl history -a
# Copy a specific history entry to clipboard
clipctl history -g 2clipctl clearApply transformations to clipboard content:
# Format JSON
clipctl transform json
# Minify JSON
clipctl transform json-minify
# Trim whitespace
clipctl transform trim
# Convert to uppercase
clipctl transform upper
# Convert to lowercase
clipctl transform lower
# Title case
clipctl transform title
# Base64 encode
clipctl transform base64
# Base64 decode
clipctl transform base64d
# URL encode
clipctl transform url
# URL decode
clipctl transform urld
# Reverse text
clipctl transform reverseCreate custom script hooks to process clipboard content:
# Show hooks directory
clipctl hook --dir
# List available hooks
clipctl hook --list
# Execute a hook
clipctl hook my-script- Create an executable script in the hooks directory:
mkdir -p ~/.config/go-clipboard-plus/hooks- Create a script (e.g.,
uppercase.sh):
#!/bin/bash
tr '[:lower:]' '[:upper:]'- Make it executable:
chmod +x ~/.config/go-clipboard-plus/hooks/uppercase.sh- Use it:
clipctl hook uppercase.shHooks receive clipboard content via stdin and should output the processed content to stdout.
# Copy file contents and format as JSON
cat data.json | clipctl copy
clipctl transform json
# Chain operations with paste
clipctl paste | jq . | clipctl copy
# Get history entry and encode to base64
clipctl history -g 0
clipctl transform base64
# Process clipboard with custom hook
clipctl paste | clipctl hook my-processorgo-clipboard-plus/
βββ cmd/
β βββ clipctl/ # CLI application
β βββ main.go
βββ pkg/
β βββ clipboard/ # Cross-platform clipboard access
β β βββ clipboard.go # Interface
β β βββ linux.go # Linux implementation
β β βββ darwin.go # macOS implementation
β β βββ windows.go # Windows implementation
β βββ history/ # History tracking
β β βββ history.go
β βββ transform/ # Text transformations
β β βββ transform.go
β βββ hooks/ # Custom script hooks
β βββ hooks.go
βββ README.md
Configuration files are stored in:
- Linux/macOS:
~/.config/go-clipboard-plus/ - Windows:
%USERPROFILE%\.config\go-clipboard-plus\
history.json: Clipboard history storagehooks/: Directory for custom hook scripts
# Run all tests
go test ./...
# Run tests for specific package
go test ./pkg/transform -v
go test ./pkg/history -v
# Run tests with coverage
go test -cover ./...# Build for current platform
go build -o clipctl ./cmd/clipctl
# Build for specific platform
GOOS=linux GOARCH=amd64 go build -o clipctl-linux ./cmd/clipctl
GOOS=darwin GOARCH=amd64 go build -o clipctl-mac ./cmd/clipctl
GOOS=windows GOARCH=amd64 go build -o clipctl.exe ./cmd/clipctlContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
Max Base
- GitHub: @BaseMax
- Uses OS-specific clipboard utilities for reliable clipboard access
- Inspired by various clipboard manager tools