zpl_toolchain_cli-0.1.6 is not a library.
zpl — ZPL Toolchain CLI
Command-line interface for parsing, validating, formatting, and printing ZPL II label code.
Part of the zpl-toolchain project.
Installation
# From crates.io (all transports: TCP, USB, serial/Bluetooth)
# Or use cargo-binstall for a pre-built binary (no compile wait):
Pre-built binaries with all transports are available from GitHub Releases.
For a minimal TCP-only build:
cargo install zpl_toolchain_cli --no-default-features --features tcp.
Commands
# Parse and inspect ZPL
# Validate ZPL (with optional printer profile)
# Check syntax only
# Format ZPL
# Print ZPL to a network printer
# Print with validation and status query
# Print via USB
# Print via serial/Bluetooth
# Explain a diagnostic code
Global Options
| Flag | Description |
|---|---|
--output pretty|json |
Output format (default: auto-detect TTY) |
Print Command Flags
| Flag | Description |
|---|---|
-p, --printer <ADDR> |
Printer address: IP, hostname, usb, usb:VID:PID, or serial path |
--profile <PATH> |
Printer profile JSON for pre-print validation |
--no-lint |
Skip validation before printing |
--strict |
Treat warnings as errors during validation |
--dry-run |
Validate and resolve address without sending |
--status |
Query ~HS host status after printing |
--info |
Query ~HI printer info after printing |
--wait |
Wait for printer to finish all labels |
--wait-timeout <SECS> |
Timeout for --wait polling (default: 120s; requires --wait) |
--timeout <SECS> |
Connection timeout in seconds, minimum 1 (default: 5). Also sets write timeout to 6× and read timeout to 2× this value |
--serial |
Use serial/Bluetooth SPP transport |
--baud <RATE> |
Baud rate for serial connections (default: 9600) |
Printer Address Formats
| Format | Transport | Example |
|---|---|---|
| IP or hostname | TCP (port 9100) | 192.168.1.55, printer.local |
| IP:port | TCP (custom port) | 192.168.1.55:6101 |
usb |
USB (auto-discover Zebra) | usb |
usb:VID:PID |
USB (specific device) | usb:0A5F:0100 |
| Serial path | Serial/BT SPP (with --serial) |
/dev/ttyUSB0, COM3 |
Note: Serial/Bluetooth addresses require the
--serialflag. Without it, the CLI assumes TCP.
Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
USB device not found |
Printer not connected or powered off | Check cable/power; on Linux, add udev rules |
failed to open device: Access denied |
Insufficient USB permissions | Linux: add udev rule or run with sudo; macOS: grant USB access |
serial port error: Permission denied |
Insufficient serial port permissions | Add user to dialout group (sudo usermod -aG dialout $USER) or chmod 666 the device |
| DNS error on a serial path | Missing --serial flag |
Add --serial: zpl print label.zpl -p /dev/ttyUSB0 --serial |
no parser tables available |
Binary built without embedded tables | Use cargo install zpl_toolchain_cli or download from Releases |
See the full Print Client Guide for detailed transport setup and troubleshooting.
License
Dual-licensed under MIT or Apache-2.0.