A Unix-inspired CLI for printing content on thermal receipt printers.
A global installation is recommended, e.g. with uv:
uv tool install receipt-print
Print piped text:
echo "hello" | receipt-print
cat file.txt | receipt-print
Print text:
receipt-print echo "hello" "world"
receipt-print echo -l "line 1" "line 2" # use newlines instead of spaces
Print file content:
receipt-print cat file1.txt file2.txt
Count how many lines would be printed:
receipt-print count file.txt
man ls | receipt-print count
Run command(s) and print captured output:
receipt-print shell "ls -l" "git status"
receipt-print shell "hostname -I | awk '{print $1}'"
Configure using environment variables (see python-escpos documentation):
RP_VENDOR
: USB vendor ID (default: 04b8)RP_PRODUCT
: USB product ID (default: 0e2a)RP_PROFILE
: Printer profile (default: TM-T20II)RP_HOST
: Network printer IP address (optional, fallback if USB fails)RP_CHAR_WIDTH
: Character width per line (default: 72)RP_MAX_LINES
: Maximum lines allowed without confirmation (default: 40)