A lightweight, cross-platform clipboard utility written in Rust.
cpst provides two simple commands for interacting with the system clipboard:
cpy— Copy standard input to the clipboard.pst— Paste clipboard contents to standard output.
Supports UTF-8 text and PNG/JPEG image input. Images are pasted as PNG.
cargo install --git https://github.com/yutadev31/cpstnix profile install github:yutadev31/cpstecho "Hello, world!" | cpycpy < file.txtpstpst > file.txtcpy < image.pngcpy < image.jpgCopy a screenshot using shot:
shot | cpypst > image.pngImages are written as PNG only when standard output is redirected to a file or pipe. Binary image data is never written directly to a terminal.
When the clipboard provides both text and an image, pst prefers text.
cpst uses arboard for clipboard access.
It supports Windows, macOS, and Unix-like systems with a supported graphical clipboard backend, including X11 and Wayland.
Note: macOS support is currently untested due to a lack of access to macOS hardware.
A Nix development environment is available:
nix developRun checks with Cargo:
cargo fmt --all --check
cargo clippy --all-targets --all-features -- -D warnings
cargo testBuild the release binary:
cargo build --releaseLicensed under the MIT License.