Python Agent
CLI Reference

CLI Reference

The plexus CLI lets you start agents, add sensor capabilities, scan hardware, and monitor your device from the terminal.

Install it with the base package:

pip install plexus-python

plexus start

Set up and start streaming in one command. Handles auth, hardware detection, dependency installation, and sensor selection. Interactive when run without flags, non-interactive with flags like --sensor or --no-sensors.

plexus start

Flags

FlagTypeDefaultDescription
-k, --keystringenv / configAPI key. Overrides PLEXUS_API_KEY and config file.
-n, --namestringnoneDisplay name for this device in the dashboard.
--device-idstringnoneDevice ID from dashboard.
--orgstringnoneOrganization ID from dashboard.
-b, --busint1I2C bus number. Use 0 on older Raspberry Pi models.
-s, --sensorstringnoneSensor type to use (e.g. system). Repeatable.
--no-sensorsboolfalseDisable I2C sensor auto-detection.
--no-camerasboolfalseDisable camera auto-detection.
--mqttstringnoneMQTT broker to bridge (e.g. localhost:1883).
--mqtt-topicstringsensors/#MQTT topic to subscribe.
--liveboolfalseShow live terminal dashboard.
--auto-installboolfalseAuto-install missing Python dependencies.

Examples

# Interactive setup (prompts for API key and sensor selection)
plexus start
 
# Specify API key and device name
plexus start --key plx_xxxxx --name "test-rig-01"
 
# Stream system health metrics
plexus start --sensor system
 
# Live terminal dashboard
plexus start --live
 
# Bridge MQTT data
plexus start --mqtt localhost:1883
 
# Skip hardware auto-detection
plexus start --no-sensors --no-cameras
 
# Auto-install missing dependencies
plexus start --auto-install
 
# Use I2C bus 0 (Raspberry Pi Model A/B)
plexus start --bus 0

plexus add

Add sensor capabilities to your device configuration. Run without arguments to open the interactive picker.

plexus add

Or specify capabilities directly:

plexus add sensors can mavlink

Available Capabilities

CapabilityDescription
sensorsI2C sensors (IMU, temperature, pressure, etc.)
canCAN bus (SocketCAN)
mavlinkMAVLink (drones, autopilots)
mqttMQTT broker
modbusModbus TCP/RTU
opcuaOPC-UA
bleBluetooth Low Energy
serialSerial port (RS-232, UART)
systemSystem health (CPU, memory, disk, temperature)
tuiLive terminal dashboard

Examples

# Interactive picker — shows checkboxes for each capability
plexus add
 
# Add I2C sensors and CAN bus
plexus add sensors can
 
# Add everything
plexus add sensors can mavlink mqtt camera serial system

Two Pairing Methods

Method 1: API key (headless devices)

plexus pair --key plx_xxxxx

The key is saved to ~/.plexus/config.json and used for all future connections.

Method 2: Browser pairing (devices with a display)

This prints a URL and a 6-digit code. Open the URL in your browser, enter the code, and the device is paired.

→ Open https://app.plexus.company/auth/device
→ Enter code: 482 913
→ Waiting for confirmation...
✓ Paired as "test-rig-01"

plexus scan

Detect connected hardware — I2C sensors, CAN interfaces, serial ports, and cameras.

plexus scan

Flags

FlagTypeDefaultDescription
-a, --allboolfalseShow all I2C addresses (including unknown).
-b, --busint1I2C bus number.
--setupboolfalseAutomatically configure detected hardware.
--jsonboolfalseOutput results as JSON.

Examples

# Scan I2C bus (default)
plexus scan
# → Found MPU6050 at 0x68
# → Found BME280 at 0x76
# → Found INA219 at 0x40
 
# Scan everything
plexus scan --all
# → I2C: MPU6050 (0x68), BME280 (0x76)
# → CAN: can0 (500 kbit/s)
# → Serial: /dev/ttyUSB0 (GPS)
# → Camera: /dev/video0 (USB 720p)
 
# Scan and auto-configure
plexus scan --setup
 
# Machine-readable output
plexus scan --json

plexus status

Check the connection status of the currently running agent.

plexus status
Config:     ~/.plexus/config.json
Source ID:  source-a1b2c3d4
Name:       test-rig-01
Endpoint:   https://app.plexus.company
Auth:       plx_xxx...xxx (API key)
  ✓ Connected

plexus doctor

Diagnose common issues with your setup — missing dependencies, connectivity problems, sensor permissions.

plexus doctor
  Configuration
  ✓ Config file: ~/.plexus/config.json
  ✓ API key: plx_xxx...xxx
  ✓ Endpoint: https://app.plexus.company
  ✓ Source ID: source-a1b2c3d4

  Network
  ✓ DNS resolves: app.plexus.company
  ✓ HTTP reachable: https://app.plexus.company
  ✓ Authentication: valid

  Dependencies
  ✓ requests: installed
  ✓ click: installed
  ✓ websockets: installed

  Hardware Permissions
  ✓ I2C bus 1: accessible
  ✗ /dev/video0: permission denied
    Fix: sudo usermod -aG video $USER

  System
  Platform:   Linux aarch64
  Python:     3.11.2
  Hostname:   test-rig-01
  Agent:      v0.5.3

  5 passed, 1 failed, 0 warnings

Next Steps

  • Sending Data — Use the Python API directly
  • Adapters — Connect to CAN bus, MQTT, MAVLink, and more