hp-query
Looks up static HP printer model information from HPLIP's models database
TLDR
SYNOPSIS
hp-query [MODE] [OPTIONS]
DESCRIPTION
hp-query looks up static model information for an HP printer from HPLIP's internal models database (models.dat), given a device URI, a normalized HPLIP model name, or a raw MDL: string taken from the printer's IEEE-1284 device ID.It is designed to be called from other programs and installer scripts rather than run interactively, returning one field (-k) or all fields (-a) about a model: supported data types, required plugins, back-end capabilities, and similar metadata used elsewhere in HPLIP.
PARAMETERS
-d device-uri, --device=device-uri
Specify the model by CUPS device URI.-m model, --model=model
Specify the normalized model name, as used in HPLIP's models.dat.-r model, --raw=model
Specify the raw model name, taken from the MDL: field of the device's IEEE-1284 device ID.-k key, --key=key
Key to query (a models.dat field name).-a, --all
Query all keys instead of a single one.-s sep, --sep=sep
Separator between values when used with -a: a literal character, or one of tab, newline, cr, lf, crlf.-x
Suppress the trailing linefeed on output.-n, --non-interactive
Run without interactive prompts.-l level, --logging=level
Set logging verbosity: none, info (default), error, warn, or debug.-g
Run with debug-level logging (equivalent to -l debug).-h, --help
Display help and exit.
INSTALL
CAVEATS
Part of the HPLIP package. This queries HPLIP's local models database, not the printer directly, so results depend entirely on whether that model is present in models.dat; very new or unlisted models return little or nothing. Resolving a model from -d device-uri still requires the device to be reachable long enough to read its device ID.
HISTORY
hp-query is one of the model-lookup utilities in HPLIP (HP Linux Imaging and Printing), HP's open-source printer/scanner driver suite for Linux.