Skip to content

jmpaz/receipt-print

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

receipt-print

A Unix-inspired CLI for printing content on thermal receipt printers.

Installation

A global installation is recommended, e.g. with uv:

uv tool install receipt-print

Usage

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}'"

Configuration

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)

About

thermal printer CLI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages