Core Concepts
The CLI follows a standardGROUP COMMAND structure. Most commands operate on a specific Lager Box (Lager Box), which is specified using the --box option.
Nets
Most hardware commands operate on nets - named abstractions representing physical test points or signals. Nets map friendly names to instrument channels.Key Command Groups
Below is a summary of the main command groups available in the Lager CLI.Lager Box Management
- Boxes: Manage Lager Box configurations (add, edit, delete, import/export, lock)
- Hello: Verify connectivity to your Lager Box
- Update: Update Lager Box software
- SSH: Direct SSH access to Lager Box
- Logs: Check the size of Lager Box log files, and clean old ones
Configuration
- Instruments: List connected test equipment
- Nets: Create and manage nets (test point abstractions)
- Defaults: Set default Lager Box and net configurations
Power & Simulation
- Supply: Control programmable power supplies
- Battery: Simulate battery characteristics (SOC, voltage, capacity)
- Solar: Control solar panel simulators
- E-Load: Control electronic loads (CC/CV/CR/CP modes)
- Watt: Read power consumption from watt meters
- Energy: Integrate energy/charge and compute power statistics (Joulescope JS220, Nordic PPK2)
Measurement
- Scope: Control oscilloscopes for waveform capture
- Logic: Control logic analyzers with protocol decoding
- ADC: Read analog voltage values
- DMM: Take bench multimeter readings
- Thermocouple: Read temperature sensors
I/O & Communication
- GPI: Read digital inputs
- GPO: Write digital outputs
- DAC: Analog output voltage control
- UART: Serial communication
- USB: USB port power control
- BLE: Bluetooth Low Energy scanning
- BLE Sniffer: Capture Bluetooth LE radio traffic to pcap
Development
- Debug: Flash firmware, GDB server, memory access, RTT logging
- Python: Execute Python scripts on Lager Box
- Exec: Run build/test commands in a local Docker dev container
- Devenv: Configure the local Docker development environment
- Binaries: Run custom binaries on Lager Box
Utilities
Example: Test Script Workflow
This example shell script demonstrates a typical hardware test workflow.Setting Default Lager Box
To avoid specifying--box on every command, set a default Lager Box:
Box Resolution
A command that needs a Lager Box picks it in this order:- The
--boxoption of that command - The
LAGER_BOXenvironment variable - The default box from
lager defaults add --box
--box takes the name of a saved box or an IP address. With none of the three,
the command fails. It lists your saved boxes, or tells you how to add one.
Global Options
These options go before the command group, for examplelager --version:
--box is not a global option. Each command that talks to a box takes its own
--box, after the command. Every command also takes --help. On
lager install and lager update, --version names the box version to deploy,
not the CLI version.
Scripts and AI Agents
These rules let a script or an AI agent use the CLI without a human at a terminal.JSON Output
lager --output json <command> selects JSON output for one run. To select it for
all runs, set LAGER_OUTPUT=json. A command’s own --json flag also selects it.
In JSON mode, a command writes its result to stdout as one JSON object. When a
command fails, it writes one JSON object to stderr. This object is the error
envelope:
Exit Codes
The exit code tells you why a command failed:
The
Name column is the code field of the error envelope.
lager python, lager exec, lager devenv, and lager lease exit with the
code of the program they run. That code can be any number. Use the error
envelope to find a failure that comes from lager.
Confirmations
Commands that change the hardware, such aslager supply <net> enable, ask for
a confirmation. Add --yes to skip the question.
The CLI does not ask, and exits with code 8, when one of these is true:
- JSON output is selected.
LAGER_NONINTERACTIVE=1is set.- stdin closes before an answer.
--yes.
With no terminal, lager with no command shows help. It does not start the
interactive terminal.
Read-only mode
SetLAGER_READ_ONLY=1 to run only the commands that read. Any other command
exits with code 10 before it does anything. That includes lager python,
because a script can change the bench. lager agent guide --topic commands
shows which commands read.
Two commands depend on their options. lager supply <net> voltage and
lager supply <net> current read when you give no value. lager uart reads,
but with --send, --interactive, or --force it is refused.
Use it for an AI agent session that must not change the bench. --help and
--version still work.
Tips
- Use
lager <command> --helpto see all options for any command - Most commands support
--yesto skip confirmation prompts - Set defaults with
lager defaults addto reduce typing - Use the
tuisubcommand (where available) for interactive control - Commands that read values (like
adc,soc) can be used in scripts

