AgentPrint CLI
Use agentprint when the host already has CUPS tooling and the workflow needs structured printer discovery, queue setup, or non-interactive printing.
Invoke the Tool
Prefer the installed binary when it exists:
agentprint list
If working inside this repository or the binary is not installed, run:
go run ./cmd/agentprint -- list
Choose Commands
- Use
listto inspect configured local queues and identify the default printer. - Use
discoverto enumerate reachable IPP, IPPS, and DNS-SD printers through local CUPS tooling. - Use
ensureto create or repair a queue from-urior a-matchagainst discovered printers. - Use
printto submit a local file or HTTP(S) URL with CUPS options such as copies, duplex, media, scaling, color mode, and raw-option name=valueflags.
Apply Good Defaults
- Keep the default
-format jsonwhen another step will parse the result. - Use
-format tsvfor quick terminal inspection oflistanddiscover. - Prefer
ensure -match ... -defaulton boards where queues need to self-heal before a print job. - Reject or fix invalid combinations before running, especially
-scale-percentwith-fit-to-pageor-fill-page.
Examples
Discover reachable printers:
go run ./cmd/agentprint -- discover -format tsv
Repair a queue and set it as default:
go run ./cmd/agentprint -- ensure -printer office -match "Office Laser" -default
Print a remote PDF in monochrome:
go run ./cmd/agentprint -- print -printer office -input https://example.com/report.pdf -fit-to-page -color-mode monochrome