Skip to content

CLI

The labelwriter CLI provides a terminal interface for all LabelWriter operations.

Install

bash
npm install -g @thermal-label/labelwriter-cli

Commands

labelwriter list

Lists all connected USB LabelWriter printers.

bash
labelwriter list

Output:

Found 1 printer(s):

  LabelWriter 450  [1:2]  SN: AB1234

labelwriter status

Queries the printer status and reports whether it is ready to print.

bash
labelwriter status
labelwriter status --host 192.168.1.100
labelwriter status --serial AB1234

Flags:

FlagDescription
--host <ip>Use TCP transport instead of USB
--serial <sn>Target a specific printer by serial number

labelwriter print text <text>

Renders text and prints it as a label.

bash
labelwriter print text "Hello, world!"
labelwriter print text "Fragile" --density high --copies 3
labelwriter print text "Return" --invert --scale-x 1.5

Flags:

FlagTypeDescription
--invertbooleanInvert black and white
--scale-x <n>numberHorizontal scale factor
--scale-y <n>numberVertical scale factor
--density <level>light|medium|normal|highPrint density
--mode <mode>text|graphicsPrint mode
--roll <n>0|1Roll select (Twin Turbo only)
--copies <n>numberNumber of copies
--host <ip>stringUse TCP transport
--serial <sn>stringTarget by serial number

labelwriter print image <file>

Loads an image file and prints it as a label. Requires @napi-rs/canvas to be installed.

bash
labelwriter print image ./barcode.png
labelwriter print image ./logo.png --threshold 128 --rotate 90

Flags:

FlagTypeDescription
--threshold <n>0–255Binarization threshold (default 128)
--ditherbooleanApply Floyd-Steinberg dithering
--invertbooleanInvert black and white
--rotate <deg>0|90|180|270Rotate image before printing
--density <level>light|medium|normal|highPrint density
--mode <mode>text|graphicsPrint mode
--copies <n>numberNumber of copies
--host <ip>stringUse TCP transport
--serial <sn>stringTarget by serial number

labelwriter recover

Sends the error recovery sequence to the printer, then reads and reports status. Use this when the printer is stuck after a fault.

bash
labelwriter recover
labelwriter recover --host 192.168.1.100

Flags:

FlagDescription
--host <ip>Use TCP transport
--serial <sn>Target by serial number