Skip to content

Command line

The hostlens command is installed with the Python package

hostlens --help

The CLI calls the same HostLens methods as the Python API

Identify one address

hostlens identify 192.168.1.20
hostlens identify 192.168.1.20 --deep

The command prints known identity fields and the overall confidence

Scan a network

Use the detected local subnet

hostlens scan

Choose a mode

hostlens scan --fast
hostlens scan --deep

Pass a subnet explicitly

hostlens scan 192.168.1.0/24

--fast and --deep cannot be used together

The scan command prints an address as soon as it is found, then prints the completed profile after enrichment

Quick discovery

hostlens discover
hostlens discover 192.168.1.0/24

This uses fast mode and prints the resulting profiles

Passive watch

hostlens watch --passive
hostlens watch 192.168.1.0/24 --passive

Stop the command with Ctrl+C

Run without the console script

This is useful when checking which Python environment contains HostLens

python -m hostlens.cli --help

If python -m hostlens.cli works but hostlens does not, the virtual environment is probably inactive or its scripts directory is missing from PATH