Litmus CLI Reference
19 min
litmus cli is a standalone command line binary that exposes the full litmus sdk surface ( 550 functions, including all mutations, litmus edge manager, and litmus unify) without writing python useful for ai agents, ci pipelines, and interactive exploration the cli is no longer installed with the litmussdk python package it is built from the litmus go sdk and released on litmus sdk releases https //github com/litmusautomation/litmus sdk releases/releases under cli v tags, with binaries for macos arm64, linux amd64/arm64, and windows amd64, plus a sha256sums file install macos / linux (recommended) curl fssl https //raw\ githubusercontent com/litmusautomation/litmus sdk releases/main/install sh | sh the script detects your os and architecture, downloads the latest cli v release, verifies the sha256 checksum, and installs to / local/bin make sure / local/bin is on your path note for macos install via curl as shown above binaries downloaded through a browser are quarantined by gatekeeper and will refuse to run; if that happens, clear the flag with xattr d com apple quarantine \<path to binary> manual install (and windows) download the litmus cli \<os> \<arch> asset for your platform from the latest cli v release ( litmus cli windows amd64 exe on windows) verify it against the sha256sums file from the same release rename it to litmus cli ( litmus cli exe on windows), make it executable, and move it into a directory on path (e g / local/bin ) once installed, the cli can update itself in place with litmus cli update if you previously used the pip installed cli, note that older litmussdk versions leave a litmus sdk cli entry point in the environment's bin/ directory it does not conflict with the downloaded litmus cli binary, but you can remove it by upgrading the litmussdk package migrating from the pip installed cli the command was renamed from litmus sdk cli to litmus cli , and this is a clean break on the invocation contract function paths and json argument keys differ old (python cli) new (go cli) run devicehub devices list devices run le devicehub listdevices run lem lifecycle alerts list incidents args '{"project id" "x"}' run lem listincidents args '{"projectid" "x"}' run uns namespace get namespace run unify getnamespace nested snake case module paths flat \<product> \<package> \<pascalcasemethod> snake case json arg keys camelcase json arg keys (see list \<pkg> for names) litmus edge packages are grouped under the le prefix ( le devicehub , le system , le analytics , le digitaltwins , le flows , le integrations , le marketplace , le opc ) lem and unify paths are unchanged litmus cli list \[prefix] browses every callable path with its argument names if you pass an old style path to run , the cli prints a pointer to the migration guide and a suggested new path (e g lem lifecycle alerts list incidents suggests lem listincidents ), so old scripts fail with an explanation rather than silently saved connection profiles are unaffected existing / litmus/\<profile> json files written by the old cli load unchanged setup 1\ configure a connection sign in via the browser (writes a profile), or save one by hand \# browser based sign in; no argument shows all three product cards litmus cli login \[le|lem|unify] \# direct connection (oauth2) litmus cli config set \\ \ edge url https //\<device ip> \\ \ edge api client id \<client id> \\ \ edge api client secret \<client secret> \# lem bridge litmus cli config set \\ \ edge manager url https //\<lem url> \\ \ edge api token \<token> \\ \ edge manager project id \<project id> \\ \ edge manager device id \<device id> \\ \ use lem bridge true profiles are saved to / litmus/\<profile> json the default profile is named default to use multiple devices, pass profile \<name> to any command environment variables take precedence over profiles set edge url , edge api client id , edge api client secret (or the lem bridge variables) in the shell to override any saved profile to get edge credentials in the litmus edge ui navigate to system > access control > tokens, create an oauth 2 0 client with admin permissions, and copy the client id and client secret for full env var details and the three connection modes, see managing connections docid\ vwtfo9sxcmrbfx9cafenw supported keys for config set flag description edge url litmus edge device url edge api client id oauth 2 0 client id edge api client secret oauth 2 0 client secret edge manager url litmus edge manager url edge manager admin url lem admin url (optional) edge api token lem api token (used by direct lem and lem bridge) edge manager project id lem project id (for bridge mode) edge manager device id lem device id (for bridge mode) use lem bridge true to route le calls through lem validate certificate false to disable tls verification timeout seconds request timeout in seconds 2\ (optional) enable tab completion litmus cli completion bash # or zsh, fish, powershell add the printed setup line to / bashrc or / zshrc to persist across sessions completion also completes run and list dotted paths commands litmus cli run call any sdk function by its dotted path result is json on stdout \# no arguments litmus cli run le devicehub listdevices \# with arguments (json object, camelcase keys) litmus cli run lem listincidents args '{"projectid" "x"}' \# named profile litmus cli run le devicehub listdevices profile staging \# function signature and docs, with a ready to fill args skeleton litmus cli run le devicehub listdevices help litmus edge sdk packages live under the le prefix ( le devicehub , le system , le analytics , le digitaltwins , le flows , le integrations , le marketplace , le opc ); lem and unify paths have no prefix results are printed as json on stdout; errors go to stderr run litmus cli run h for the full flag list litmus cli list browse available packages and functions this is the canonical way to discover what the sdk can do ( 550 functions) \# list all packages litmus cli list \# list functions in a package, with argument names litmus cli list le devicehub litmus cli list lem \# print a package's sdk docs litmus cli list le devicehub help litmus cli config manage saved connection profiles litmus cli config set edge url https //10 0 0 1 edge api client id id edge api client secret secret litmus cli config show litmus cli config show profile staging # secrets masked curated product commands beyond the generic dispatcher, common operations are grouped under product subcommands litmus cli le devices # litmus edge device operations litmus cli le data # litmus edge data plane (live and historical tag values) litmus cli lem companies # litmus edge manager operations run litmus cli le h or litmus cli lem h to browse each group litmus cli version and litmus cli update litmus cli version prints the cli's own version and build details; litmus cli update self updates in place to the latest cli v release to get the litmus edge device firmware version, use litmus cli le version litmus cli completion print the shell completion script (bash, zsh, fish, powershell) run litmus cli h for full usage every command and sdk package has built in docs via help using with ai agents litmus cli is designed for use by ai agents and is the preferred method for agentic tasks key properties structured output results are always json on stdout, errors on stderr discoverable litmus cli list enumerates every callable function self describing litmus cli list \<package> shows argument names, and run \<path> help prints the signature with a ready to fill args skeleton composable pipe json output to jq or any other tool typical agent workflow \# 1 discover what's available litmus cli list \# 2 inspect a package litmus cli list le devicehub \# 3 read the function docs litmus cli run le devicehub listdevices help \# 4 call the function and parse the json result litmus cli run le devicehub listdevices | jq ' \[0] id' scope note the air gap template builder ( litmussdk airgap features airgaptemplate ) is class based and python only; it is not exposed by the cli drive it from python and use the cli for the surrounding live data fetches the full agent guide (with package mappings and patterns) lives at api litmus io/cli md https //api litmus io/cli md devicehub driver records (python package) these helpers manage the python sdk's own driver record cache and still ship with the litmussdk pip package (they are unrelated to litmus cli ) download dh record # download for current edge url version list dh versions # list available cached versions get dh cache dir # show where records are cached litmus cli handles driver record downloads internally; no manual step is needed when using it license copyright (c) litmus automation inc