instro ships a command-line interface for inspecting and discovering instruments on your bench.
Running the CLI
The CLI comes with theinstro package — see Installation for adding it to your project. In a project that has instro installed, run commands with uv run:
uvx runs it in a throwaway environment:
uvx can be slow when it triggers a fresh install of instro’s full dependency tree. For regular use, put instro on your PATH instead so you can call it from anywhere:
instro —version
Prints the installed version of the coreinstro package followed by every optional workspace package (instro-contrib, instro-unstable, instro-ethernetip, instro-daq-ni, instro-daq-labjack, instro-daq-mcc, instro-i2c-aardvark). Packages that are not installed are marked not installed with the pip install "instro[<extra>]" command that provides them — see Additional Packages for what each extra covers.
instro discover
Scans all available VISA resources and serial ports, queries each instrument for its identity, and prints a summary table. To force a specific VISA backend, pass--backend:
The
@ivi backend finds an available IVI-compliant backend on your system e.g. NI-VISA or Keysight IO. @ivi is more reliable for USB and GPIB instruments. The @py backend (pyvisa-py) is a pure-Python fallback that works without NI-VISA installed but may not detect all instruments.Output
Before scanning, the command prints which VISA backend is active (@ivi, or @py when no IVI VISA is installed). On the @py backend it also lists any interfaces the scan cannot cover — for example GPIB: unavailable — gpib_ctypes is installed but could not locate the gpib library (install NI-488.2 or linux-gpib) — so you know when an empty result reflects a missing library rather than an empty bench. These notes are informational; the scan still runs and the command exits 0.
The command groups results into up to three tables.
Recognized devices — instruments with a known driver. The table shows the VISA resource address, instrument category, and the instro driver class to use.
Serial devices — serial ports detected by the OS. These are listed separately because serial instruments require manual configuration; instro discover cannot query them automatically.
Unrecognized devices — instruments that responded to *IDN? but did not match any known driver. The raw IDN response is shown so you can identify the device.
If no devices are found at all, the command prints a single error panel; on the @py backend the panel repeats any unavailable interfaces.
Using a recognized device
Pass the resource address from the Recognized devices table directly to the driver’s constructor:Unrecognized devices
If your instrument appears in the Unrecognized devices table,instro does not yet have a driver for it. See Custom instruments for how to author one, or instro-contrib to check for community-contributed drivers.