8 releases

0.1.5 Oct 4, 2024
0.1.4 Jan 28, 2024
0.1.2 Apr 21, 2023
0.1.1 Nov 16, 2022
0.0.1 Apr 13, 2022

#363 in Command line utilities

Download history 96/week @ 2024-08-10 1/week @ 2024-08-17 4/week @ 2024-08-24 10/week @ 2024-08-31 2/week @ 2024-09-07 53/week @ 2024-09-14 33/week @ 2024-09-21 104/week @ 2024-09-28 69/week @ 2024-10-05 18/week @ 2024-10-12 3/week @ 2024-10-19 18/week @ 2024-11-02 36/week @ 2024-11-09 10/week @ 2024-11-16 2/week @ 2024-11-23

66 downloads per month

GPL-3.0-or-later

21KB
139 lines

bp

bp ("better paste") is a cross-platform clipboard tool written in Rust, based on cb. It can automatically detect whether to copy or paste, and is optimised to work in pipes. Its behaviour is based on the tee command.

Installation

bp is on crates.io, so you can install it by running:

cargo install bp

Usage

Copy

# copy some text
echo "some text" | bp

# copy the HTML from `example.com`
curl https://example.com | bp

# copy the contents of `file.txt`
bp file.txt

# you can also pipe in a file
bp <file.txt

Paste

# paste to standard output
bp

# paste to a pipe
bp | jq | less

# paste to `out.txt`
bp >out.txt

Chaining

# remove formatting from copied text
bp | bp

# prettify, copy and view `example.json`
cat example.json | jq | bp | less

# edit your current clipboard
bp | vipe | bp

# hex-encode contents of the clipboard
bp | xxd | bp

Strip Whitespace

# copy some text with whitespace stripped
echo " some text " | bp -s

# paste to standard output with whitespace stripped
bp -s
some text%

Licence

bp is available under the GPL-3.0-or-later.

Dependencies

~68–275KB