| name | printer |
| description | Manage printers via CUPS on macOS (discover, add, print, queue, status, wake). |
| metadata | {"clawdbot":{"emoji":"🖨️","os":["darwin"],"requires":{"bins":["lp","lpstat","lpadmin"]}}} |
Printer (CUPS)
Control printers on macOS using built-in CUPS commands. No external CLI needed.
Discover printers
dns-sd -B _ipp._tcp . 2>/dev/null & sleep 3; kill $! 2>/dev/null
dns-sd -L "Printer Name" _ipp._tcp . 2>/dev/null & sleep 3; kill $! 2>/dev/null
lpstat -e
lpinfo --include-schemes dnssd -v
ippfind --timeout 5
Add a printer (driverless IPP Everywhere)
lpadmin -p MyPrinter -E -v "ipp://printer.local:631/ipp/print" -m everywhere
lpadmin -d MyPrinter
sudo lpadmin -p MyPrinter -o cupsSNMPSupplies=true
Print files
lp filename.pdf
lp -d MyPrinter filename.pdf
lp -d MyPrinter -n 2 file.pdf
lp -d MyPrinter -o sides=two-sided-long-edge file.pdf
lp -d MyPrinter -o media=letter file.pdf
lp -d MyPrinter -o ColorModel=Gray file.pdf
echo "Hello World" | lp -d MyPrinter
Queue management
lpstat -p MyPrinter
lpstat -o MyPrinter
lpstat -t
lpq -P MyPrinter
cancel JOB_ID
cancel -a MyPrinter
cupsenable MyPrinter
cupsdisable MyPrinter
cupsaccept MyPrinter
cupsreject MyPrinter
Printer options
lpoptions -p MyPrinter -l
lpoptions -p MyPrinter -o sides=two-sided-long-edge
sudo lpadmin -p MyPrinter -o sides-default=two-sided-long-edge
Status and diagnostics
ipptool -t ipp://PRINTER_IP/ipp/print get-printer-attributes.test
ipptool -t ipp://PRINTER_IP/ipp/print get-printer-attributes.test \
| grep -iE 'printer-state|marker|supply|media|error'
Wake printer from sleep
ipptool -q -T 5 ipp://PRINTER_IP/ipp/print get-printer-attributes.test
curl -s -m 5 http://PRINTER_IP/ >/dev/null
nc -zw2 PRINTER_IP 631
Keep-alive (prevent deep sleep)
ipptool -q -T 3 -i 300 ipp://PRINTER_IP/ipp/print get-printer-attributes.test
For persistent keep-alive, create a launchd agent.
Toner levels via SNMP
Requires brew install net-snmp:
snmpwalk -v2c -c public PRINTER_IP 1.3.6.1.2.1.43.11.1.1
Note: SNMP may be disabled on the printer. Check Remote UI settings.
Remote UI (web interface)
Most network printers expose a web UI at http://PRINTER_IP/ for:
- Sleep/timer settings (Settings > Timer Settings > Auto Sleep Time)
- Network protocol config (enable/disable IPP, SNMP, raw 9100)
- Consumables status
Troubleshooting
cupsenable MyPrinter
lpstat -v MyPrinter
lpadmin -x MyPrinter
lpadmin -p MyPrinter -E -v "ipp://..." -m everywhere
tail -f /var/log/cups/error_log
Notes
- Prefer
ipp:// or ipps:// URIs over raw 9100 or LPD
-m everywhere auto-configures from printer's IPP capabilities
- Option names vary by printer; use
lpoptions -l to discover
- Sleep settings are best configured via printer's Remote UI
- Auto-sleep (1 min) keeps services alive - print jobs wake the printer automatically
- If the printer is completely unresponsive (IPP port closed, HTTP timeout), it's likely in deep sleep or powered off. Message the user to check/wake the printer physically.