Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.heylua.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

lua devices manages the registered devices your agent can command and receive triggers from — IoT sensors, label printers, smart-home gear, kiosks, etc. The command lets you list, enable, disable, remove, and test devices and their triggers without writing any code.
lua devices                              # Interactive management
lua devices list                         # List all devices
lua devices status --device-name label-printer
lua devices test --device-name label-printer
For defining devices in code, see the Devices tab. For building your own device client, see Build Your Own.

Subcommands

ActionWhat it does
listList all registered devices (optionally filter by --group).
statusPrint online/offline/disabled state and last-seen time for a device.
enableRe-enable a previously disabled device.
disableStop the agent from issuing commands to a device (offline mode).
removeUnregister a device. Use --force to skip the confirmation.
testSend a test command to a device. Prompts interactively or use --payload.
test-triggerFire a test trigger as if it came from the device.

Options

OptionDescription
--device-name <name>Device name. Required for most non-interactive actions.
--group <name>Filter device list by group (use with list).
--payload <json>JSON payload for test / test-trigger (default: {}).
--timeout <ms>Command timeout in milliseconds (default: 30000).
--forceSkip confirmation prompts (used with remove).

Examples

# Interactive picker
lua devices

# List all devices
lua devices list

# Filter list by group
lua devices list --group printers

# Inspect device state
lua devices status --device-name label-printer

# Enable / disable
lua devices enable  --device-name label-printer
lua devices disable --device-name label-printer

# Remove (confirms before deleting)
lua devices remove --device-name label-printer
lua devices remove --device-name label-printer --force

# Test a command (interactive payload)
lua devices test --device-name label-printer

# Test with a specific payload
lua devices test --device-name label-printer \
  --payload '{"command":"print","data":{"label":"order-1234"}}'

# Fire a test trigger
lua devices test-trigger --device-name label-printer \
  --payload '{"event":"button_pressed","data":{"button":"red"}}'

Test Command vs Test Trigger

CommandDirectionWhen to use
testAgent → deviceVerify your agent can send commands to a device and that the device responds.
test-triggerDevice → agentVerify your agent reacts correctly when a trigger fires from a device.

Common Workflow

After registering a new device:
lua devices list                                       # Confirm registration
lua devices status --device-name new-device            # Check it's online
lua devices test --device-name new-device              # Verify command path
lua devices test-trigger --device-name new-device      # Verify trigger path
lua logs --type device --name new-device --limit 10    # Inspect logs
lua logs --type device-trigger --name new-device       # Inspect triggers