LAA manager (aka. laam) - Console
The LAA Manager is a python application that allows to interact with the LAA REST API.
This is the documentation to use laam via commands on a console.
LAA manager v0.10.1
The documentation refers to laam v0.10.1. Version notes at the bottom
Installation
laam is available from PyPI:
python3 -m venv venv
source venv/bin/activate
python3 -m pip install laam
python3 -m pip install --upgrade laam
laam --help
laam --version
Autocompletion
laam supports full shell autocompletion via argcomplete
for faster command entry and context-aware suggestions.
To activate global completion, run:
activate-global-python-argcomplete
New terminal sessions will now support laam the feature.
Autocompletion Examples:
Identities are loaded from the configuration file.
File paths are dynamically filtered based on whether the command targets local or remote (LAA) storage.
Configuration
In order to use laam with your LAA, you must create an identity with:
laam identities add --uri <uri> --token <token> <id_name>
# Example:
laam identities add --uri http://192.168.1.234 --token abcdefghijklmnopqrstuvwxyz0123456789 laa101
Where:
<uri>: URL of the LAA, you can use the ip address (prefixed withhttp://) indicated on the OLED screen<token>: api token created on the LAA as indicated in here<id_name>: name of the identity
laam identities are stored in ~/.config/laam.yaml.
The format of the file is pretty simple as it’s a list of dictionaries where the key if the identity name. The file would look like:
default:
token: xxxyyyzzz
uri: http://192.168.1.234
identity-1:
token: abcdef
uri: http://laa-00001.local
identity-2:
token: 123456
uri: http://laa-00002.local
The identities can then be used:
$ laam -i identity-1 <command>
Identity selection
You can have multiple identities, each with a unique name. When running laam
you can select the identity to use with laam -i <identity> ....
Default Identity
When no -i identity is provided, laam will use the identity called default.
It is suggested to manually create a default identity, or laam will fail.
Local Commands
“Local” commands won’t need an identity. Examples are: help, version, dut new, dut check.
Usage
These are all the commands and options available on laam:
$ laam --help
usage: laam [-h] [--version] [--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--uri URI] [--token TOKEN] [--identity ID]
{identities,dut,files,laacli,mcp,network,serials,services,ssh,system,usbs,workers} ...
Linaro Automation Appliance Manager
options:
-h, --help show this help message and exit
--version show program's version number and exit
--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
Set the logging level
identity:
--uri URI URI of the LAA API
--token TOKEN Token for the LAA API
--identity ID, -i ID Identity stored in the configuration
Command:
{identities,dut,files,laacli,mcp,network,serials,services,ssh,system,usbs,workers}
Command
identities Manage laam configuration
dut Enable attached DUT
files Manage files and directories in /var/lib/lava/dispatcher/tmp
laacli Run laacli commands on the LAA
mcp Start the MCP server
network Manage network
serials Manage DUT serials
services Manage services
ssh LAA SSH key management options
system Get LAA Info
usbs List USB devices
workers Manage workers
Options
help
Print the help text on the console, as already shown.
$ laam --help
version
Print the version of the tool.
$ laam --version
laam, vX.Y.Z
loglevel
Set the logging level.
$ laam --loglevel DEBUG -i idexample files push local/file.img file.img
DEBUG:laam.LAA:Creating LAA with identity idexample
DEBUG:laam.LAA:LAA uri: <URI>
DEBUG:laam.LAA:LAA base_uri: <URI>/api/v1
DEBUG:laam.LAA:Creating Files
DEBUG:laam.LAA.Files:push: `file` is pure data
DEBUG:laam.LAA.Files:Request: POST <URI>/api/v1/files/file.img kwargs: {'data': <MultipartEncoder: {'file': ('file.img', <_io.BufferedReader name='local/file.img'>)}>, 'headers': {'Content-Type': 'multipart/form-data; boundary=xyz'}}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): <URI>
DEBUG:urllib3.connectionpool:<URI> "POST /api/v1/files/file.img HTTP/1.1" 200 0
DEBUG:laam.LAA.Files:Request returned
DEBUG:laam.LAA.Files:Request succeeded
Commands
identities
Manage laam identities stored in ~/.config/laam.yaml.
$ laam identities --help
usage: laam identities [-h] {add,update,delete,list,show} ...
options:
-h, --help show this help message and exit
Sub command:
{add,update,delete,list,show}
Sub command
add add an identity
update update an identity
delete delete an identity
list list available identities
show show identity details
dut
It is a command that helps the creating new device configuration files and tests them.
$ laam dut --help
usage: laam dut [-h] {check,new,render,test,interact} ...
options:
-h, --help show this help message and exit
Sub command:
{check,new,render,test,interact}
Sub command
check Check the configuration
new Create a device configuration file
render Render device-type template and device dict
test Boot test the DUT
interact Powers on the DUT and starts serial. Ctrl+C to stop and power off.
Local Commands
The following commands don’t need identity: dut new, dut check.
files
Manage files in /var/lib/lava/dispatcher/tmp on the LAA.
$ laam files --help
usage: laam files [-h] {list,pull,push,rm,mkdir,rmdir,decompress} ...
options:
-h, --help show this help message and exit
Sub command:
{list,pull,push,rm,mkdir,rmdir,decompress}
Sub command
list List files on the LAA
pull Pull a file from the LAA
push Push a file in the LAA
rm Remove a file on the LAA
mkdir Create directory
rmdir Remove a directory
decompress Decompress a file
laacli
Execute laacli commands on the LAA.
$ laam laacli --help
usage: laam laacli [-h] {button,history,led,power,rev,screenshot,temp,usb,usbg-ms,watt} ...
options:
-h, --help show this help message and exit
Sub command:
{button,history,led,power,rev,screenshot,temp,usb,usbg-ms,watt}
Sub command
button Virtual buttons
history Sensor history
led User LED
power Power rails
rev LAA revision
screenshot OLED screenshot
temp Query temperature (°C)
usb USB hub
usbg-ms USB Gadget Mass storage
watt Power consumption
mcp
Start an MCP (Model Context Protocol) server exposing the LAA to AI agents.
$ laam mcp --help
usage: laam mcp [-h] [--transport {stdio,streamable-http}] [--host HOST]
[--port PORT] --workdir WORKDIR
options:
-h, --help show this help message and exit
--transport {stdio,streamable-http}
MCP transport (default: stdio)
--host HOST Host for streamable-http
--port PORT Port for streamable-http
--workdir WORKDIR Directory file_push and file_pull are limited to
The server exposes the following tools to the MCP client: button_control,
power_control, usb_control, sensor_history, file_list, file_push,
file_pull, serial_list, serial_open, serial_write,
serial_read_until, serial_close, and system_version.
File transfers
The file_push and file_pull tools can only read and write files inside
the directory given with --workdir.
network
Manage LAA network configuration
$ laam network --help
usage: laam network [-h] {addresses,hostname,interfaces,routes,settings} ...
options:
-h, --help show this help message and exit
Sub command:
{addresses,hostname,interfaces,routes,settings}
Sub command
addresses List addresses
hostname Hostname
interfaces List interfaces
routes List routes
settings Settings
serials
List and interact with the different serial consoles provided by the LAA.
$ laam serials --help
usage: laam serials [-h] {list,connect,detect,scan,show} ...
options:
-h, --help show this help message and exit
Sub command:
{list,connect,detect,scan,show}
Sub command
list List serials
connect Connect to serial
detect Detect the device serial, returns when 10 ASCII printable characters are received
scan Listen to all serials in parallel
show Serial details
services
Monitor systemd services running on the LAA.
$ laam services --help
usage: laam services [-h] {list,logs} ...
options:
-h, --help show this help message and exit
Sub command:
{list,logs} Sub command
list List services
logs Services logs
ssh
Manage ssh keys used to ssh to the appliance.
$ laam ssh --help
usage: laam ssh [-h] {list,show,add,delete} ...
options:
-h, --help show this help message and exit
Sub command:
{list,show,add,delete}
Sub command
list Appliance ssh key list
show Appliance ssh key details
add Appliance ssh key upload
delete Appliance ssh key delete
ssh user
To ssh to the appliance, add your ssh key using laam ssh or the web interface then run:
ssh torizon@laa-<serial>.local
system
Display LAA system information.
$ laam system --help
usage: laam system [-h] {logs,fleet,version} ...
options:
-h, --help show this help message and exit
Sub command:
{logs,fleet,version} Sub command
logs Appliance logs
fleet Bakfleet Information
version Appliance Version
usbs
Display usb devices.
$ laam usbs --help
usage: laam usbs [-h] {list,show} ...
options:
-h, --help show this help message and exit
Sub command:
{list,show} Sub command
list List USB devices
show USB details
workers
Manage LAVA workers running on the LAA.
$ laam workers --help
usage: laam workers [-h] {dockerfile,list,logs,show,test} ...
options:
-h, --help show this help message and exit
Sub command:
{dockerfile,list,logs,show,test}
Sub command
dockerfile LAVA worker Dockerfile
list List workers
logs Worker logs
show Worker details
test Test connection to server
Contributing
Contributions, bug reports and feature requests are welcome! Please see the issues or open a merge request.
Backward Compatibility Policy
laam interfaces directly with LAA OS API endpoints.
To ensure stability for automation and CI/CD pipelines, we follow these rules:
Version Baseline: Full backward compatibility is guaranteed starting with laam 0.9.0 and LAA OS 1.7.0.
Backward-Compatible API: LAA OS API endpoints are never removed. Existing endpoints can be changed in backward-compatible ways only. This means any laam version works with any LAA OS version >= 1.7.0.
Automation-First:
laammust remain a reliable component for any third-party automation tools using an LAA.
Version notes
LED sub-command
The LED sub-command is working from LAA OS > v1.6.1.
LAA OS v1.4
The REST API used by laam is only available in LAA OS v1.4 and after.
LAA manager =< v0.8.1
laam =< v0.8.1 serials connect command cannot connect with LAA OS =< v1.5.5.
This has been fixed in laam v0.8.2
LAA manager v0.8.2
The “laam network settings” command fails. This has been fixed in laam v0.8.3
LAA manager v0.9.0
The “laam files list” command is compatible with LAA OS >= 1.7.1
LAA manager v0.11.0
The “laam laacli history” and “laam mcp” commands are available in versions after laam v0.11.0.