lua devices manages the devices an agent can command: it lists the pushed device definitions, reports whether a device is connected, enables or disables it, removes it, and sends a command or a test trigger to a connected device. disable and remove change what the agent can do for every end user immediately.
Verified against lua-cli 3.33.0.
Synopsis
Description
With no action the command opens a menu covering every action. Every action exceptlist needs a device name; without --device-name it prompts you to pick one.
list prints the device definitions pushed to the agent, with ID, group, and description, filtered by --group if given. It reads definitions, not live connections: a device that only connects with a self-describing client and was never pushed is not listed. Use status for connection state.
status prints online when the device is connected, otherwise its stored state: offline, registered (enabled, not connected), or disabled.
enable and disable set that stored state. A disabled device is refused with DEVICE_DISABLED the next time it connects; enable sets it back to registered.
remove deletes the device definition and its versions after a confirmation prompt, or immediately with --force.
test sends a command to the connected device and prints the response and the round-trip latency. The command name is always prompted for; --payload supplies the JSON body and --timeout the wait. An offline device or a timed-out command is reported on screen with exit 0.
test-trigger relays a command named __test_trigger__<trigger> to the connected device with --payload. The trigger name is always prompted for. The platform runs no trigger handler for it, so use it as a connectivity check; to exercise a handler end to end, fire the trigger from the device client and read lua logs --type device-trigger.
Because test and test-trigger have no flag for the command or trigger name, both need an interactive terminal; under --ci they exit 1 at the prompt.
Devices are not a lua deploy type. A device defined with defineDevice is pushed with lua push device --name <device>, a standalone handler defined with defineDeviceTrigger with lua push device-trigger --name <trigger>. Each push uploads a version and then asks whether to publish it (default No); --auto-deploy publishes without asking, and --force alone skips the question and leaves the new version unpublished. A pushed defineDevice declaration reaches the runtime on the agent’s next turn whether or not you publish it; --auto-deploy only records it as the active version. A standalone defineDeviceTrigger runs only after its pushed version is published, with --auto-deploy or the push prompt. Self-describing devices need no push: their commands become tools while the device is connected.
Arguments
Accepted spellings:
ls, l → list; info, show → status; on, activate → enable; off, deactivate → disable; rm, delete, del → remove; run, exec → test; test_trigger → test-trigger.
Options
Examples
List the pushed device definitions.Output
Output
Exit codes
The full table is in Errors and exit codes.
See also
defineDeviceanddefineDeviceTrigger- Connect your first device
- Device triggers — handlers and how to fire them from the device
- Node client and Python client
lua logs—--type deviceand--type device-trigger

