Universal clipboard write CLI for AI agents. Cross-platform: Linux Wayland/X11, macOS, Windows, WSL.
Project description
cbcopy
Universal clipboard write CLI for AI agents. Cross-platform: Linux Wayland/X11, macOS, Windows, WSL.
Zero Python dependencies (stdlib only). Delegates to system clipboard tools with correct detection order and encoding.
Setup (local development)
uv sync
Usage
# Copy text from argument
cbcopy "hello world"
# Pipe from stdin
echo "hello" | cbcopy
# Copy file contents
cbcopy --file notes.txt
# Show detected platform and available tools
cbcopy --diagnostics
Silent on success (exit 0). Clear error on stderr (exit 1).
Install globally
uv tool install .
After install, run directly:
cbcopy "hello world"
Platform support
| Platform | Detection | Tool | Encoding |
|---|---|---|---|
| Windows | sys.platform == "win32" |
clip.exe | UTF-16LE |
| WSL | WSL_DISTRO_NAME env |
clip.exe | UTF-16LE |
| Linux Wayland | WAYLAND_DISPLAY env |
wl-copy | UTF-8 |
| Linux X11 | DISPLAY env |
xclip / xsel | UTF-8 |
| macOS | sys.platform == "darwin" |
pbcopy | UTF-8 |
Detection order matters: WSL is checked before Wayland because WSLg sets WAYLAND_DISPLAY.
Tests
uv run pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cbcopy-0.1.1.tar.gz.
File metadata
- Download URL: cbcopy-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac47d50764947c4da8cb87c83c7f04c4936edf0d67578de37ba1a07e3c9fe2dd
|
|
| MD5 |
3b4b394a42f616e58296617809be8161
|
|
| BLAKE2b-256 |
d4e01e47309e6cf709348eb7a8cd37b930bf94320623655594bf7c13720a8015
|
File details
Details for the file cbcopy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cbcopy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1a6af5e30b56ea6a843e1d75adde4a66f435de5f58a94e62823de57e4ab0e02
|
|
| MD5 |
56caf5317b3f1d8f89e504532ffce289
|
|
| BLAKE2b-256 |
df860f87bfe88a3b8e3ac0de5ed0e69db3ef18d22e6864090415b24e4c18180d
|