Getting Started
11 min
this page walks you from a fresh environment to your first sdk call for deeper coverage of authentication and multi device workflows, see managing connections docid\ vwtfo9sxcmrbfx9cafenw 1\ install the sdk ships as a standalone wheel from the releases repo https //github com/litmusautomation/litmus sdk releases/releases download the latest whl and install it pip install litmussdk whl all runtime dependencies are bundled in the wheel; no extra installs are needed requirements python 3 12 or newer 2\ generate credentials in your litmus edge ui navigate to system > access control > tokens press + next to api credentials and select oauth 2 0 client grant admin permissions (lesser permissions are supported but may limit sdk functionality) copy the client id and client secret for more detail see the create an api token docid\ lvnoqksvr3jrihsooxahr 3\ configure set environment variables (or place them in a env file in your working directory; both are loaded automatically) export edge url=https //\<your edge ip> export edge api client id=\<client id> export edge api client secret=\<client secret> if your device uses a self signed tls certificate (common in edge deployments), also set export validate certificate=false for lem bridged or direct lem connections, see managing connections docid\ vwtfo9sxcmrbfx9cafenw 4\ first call from litmussdk devicehub import devices \# uses the default connection from environment variables all devices = devices list devices() print(all devices) each device is a pydantic model pass raw=true to get the api json unchanged instead all raw = devices list devices(raw=true) # list\[dict\[str, any]] 5\ cli quick start the sdk ships a cli that exposes every public function without writing python useful for scripting, ci pipelines, and ai agents \# discover available functions litmus sdk cli list # all modules litmus sdk cli list devicehub devices # functions in one module \# call a function (result as json on stdout) litmus sdk cli run devicehub devices list devices litmus sdk cli run devicehub tags list all tags args '{"limit" 50}' see sdk cli reference docid\ s7o dg4pyackxxpsoj2qf for the full command set devicehub driver records the sdk ships with bundled devicehub driver record templates used during device validation if you need records for a specific litmus edge version not covered by the bundled set, use the cli download dh record # download templates for the configured edge url version list dh versions # list available bundled versions get dh cache dir # show where templates are cached license copyright (c) litmus automation inc