WarpClip creates a seamless bridge between your remote SSH sessions and your local macOS clipboard. It enables you to pipe content from remote servers directly to your local clipboard with a simple command, similar to pbcopy on macOS or iTerm2's built-in clipboard integration.
# On a remote server
cat remote_file.txt | warpclipInstantly, the content of remote_file.txt appears in your local clipboard, ready to paste anywhere on your macOS machine.
- π Seamless Clipboard Integration: Copy text from remote servers directly to your local clipboard
- π Secure Transmission: All data is transmitted over your existing SSH connection
- π οΈ Automatic Setup: SSH forwarding is configured automatically
- β‘ Near-Zero Latency: Copies happen almost instantly, even over slow connections
- π Status Monitoring: Check service status and view copy history
- π Persistent Service: Runs in the background and auto-restarts if needed
- π§© Portable: Go-based remote client works on almost any Linux/Unix system without dependencies
- βοΈ Robust: Signal handling and error recovery for reliable operation
- macOS (uses
pbcopyfor clipboard operations) - SSH client with port forwarding capabilities
- Go 1.18+ (only if building from source)
Note: As of version 2.1.3, the remote client is written in Go and no longer requires netcat!
# Install via Homebrew
brew install mquinnv/tap/warpclip
# This will automatically set up all components# Clone the repository
git clone https://github.com/mquinnv/warpclip.git
cd warpclip
# Build the Go binaries
go build -o bin/warpclip cmd/warpclip/main.go
go build -o bin/warpclipd cmd/warpclipd/main.go
# Run the installer
./install.shIf you prefer to install components manually:
-
Create necessary directories:
mkdir -p ~/bin mkdir -p ~/Library/LaunchAgents
-
Install the local server component:
cp src/warpclip-server.sh ~/bin/ chmod +x ~/bin/warpclip-server.sh
-
Set up the LaunchAgent:
# Copy the plist file (make sure to replace /Users/michael with your home directory) cp etc/com.user.warpclip.plist ~/Library/LaunchAgents/ # Edit the file to replace the home directory path sed -i '' "s|/Users/michael|$HOME|g" ~/Library/LaunchAgents/com.user.warpclip.plist # Load the agent launchctl load ~/Library/LaunchAgents/com.user.warpclip.plist
-
Update your SSH config:
Add to your
~/.ssh/config:Host * RemoteForward 9999 localhost:8888 -
Copy the remote client for future use:
cp bin/warpclip ~/bin/
Note: The client is now a compiled Go binary instead of a shell script.
Before you can use WarpClip on a remote server, you need to copy the warpclip binary to that server:
# Copy the binary to your remote server
scp ~/bin/warpclip user@remote-server:~/bin/
# Make it executable (if needed)
ssh user@remote-server "chmod +x ~/bin/warpclip"Once the script is on your remote server, you can use it to copy content:
# Pipe content to warpclip
cat file.txt | warpclip
# Or redirect input
warpclip < file.txt
# Copy command output directly
grep "important" large-log.txt | warpclip
# Copy multiline output
find . -name "*.js" | warpclipThe content will be instantly available in your local clipboard!
WarpClip consists of three main components:
- Local Server: A persistent Go service (
warpclipd) that runs on your Mac and listens on port 8888 - SSH Tunnel: Automatically set up when you connect to a remote server, forwarding port 9999 on the remote to port 8888 on your local machine
- Remote Client: The
warpclipGo binary that sends data to the forwarded port
When you pipe content to warpclip on a remote server, it securely transmits the data through the SSH tunnel to your local WarpClip server, which then copies it to your clipboard using pbcopy.
Version 2.1.3 Update: The remote client has been completely rewritten in Go, eliminating the need for netcat and providing improved error handling, signal management, and reliability.
~/bin/warpclip-server.sh statusThis will tell you if the service is running and when the last clipboard operation occurred.
# View main log
cat ~/.warpclip.log
# View debug log for more details
cat ~/.warpclip.debug.logIf the service isn't responding correctly:
launchctl unload ~/Library/LaunchAgents/com.user.warpclip.plist
launchctl load ~/Library/LaunchAgents/com.user.warpclip.plistConnection Refused
Error: SSH tunnel not detected on port 9999.
This usually means the SSH port forwarding isn't set up correctly. Check your SSH config and try reconnecting to the server.
No Data Copied
If data isn't appearing in your clipboard, check:
- Is the WarpClip service running? (
~/bin/warpclip-server.sh statusorwarpclipd status) - Did you connect to the server with SSH port forwarding enabled?
- Is the connection timing out? Check for firewall issues or network connectivity problems.
WarpClip uses SSH's secure tunneling for all data transfer, which means:
- All clipboard data is encrypted during transmission
- No new network ports are exposed to the internet
- Data is transmitted through your existing SSH session
When using WarpClip, be aware of these clipboard-related security considerations:
- Content copied to your clipboard persists until replaced, potentially leading to unintentional sharing
- The clipboard is a system-wide resource accessible to all applications on your computer
- Consider using a clipboard manager with auto-clear functionality for sensitive data
The default configuration uses automatic port forwarding for all SSH connections, which has some implications:
- Anyone with access to a remote server could potentially send data to your clipboard
- The
warpclipclient doesn't encrypt data before sending it (relies on SSH encryption) - Clipboard tunneling works even from jump hosts or nested SSH sessions
For enhanced security:
-
Limit port forwarding to specific hosts:
# Instead of using the wildcard Host * Host trusted-server-1 trusted-server-2 RemoteForward 9999 localhost:8888 -
Use non-standard ports to reduce collision risks:
Host production-server RemoteForward 12345 localhost:8888 -
Add authentication to the local clipboard service (consider submitting a PR!)
- The local service listens only on
localhostinterface, not exposing network ports externally - SSH tunnels are established only when you initiate an SSH connection
- Check corporate security policies regarding automatic port forwarding
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -am 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Submit a pull request
- Follow Go best practices and idioms for Go code
- Use standard Go formatting (
go fmt) - Include comprehensive error handling
- Add comments for complex operations
- Write tests for critical components
- Update documentation when adding features
This project is licensed under the MIT License - see the LICENSE file for details.
