Skip to content

CLI Overview

The aranet CLI provides a fast, scriptable interface for interacting with Aranet environmental sensors.

CLI Demo

  • Device Discovery — Scan for nearby Aranet devices via Bluetooth
  • Current Readings — Read live sensor values (CO₂, temperature, humidity, pressure, radon, radiation)
  • Multi-Device Support — Read from multiple devices in parallel
  • Passive Mode — Read from BLE advertisements without connecting
  • Historical Data — Download measurement history with timestamps and date filters
  • Progress Bars — Visual progress for history downloads
  • Device Aliases — Save friendly names for device addresses
  • Device Info — Query device metadata (serial, firmware, model)
  • Settings — Read and modify device configuration
  • Diagnosticsdoctor command for BLE troubleshooting
  • Unit Conversion — Fahrenheit, inHg pressure, pCi/L radon options
  • Interactive Picker — Select devices from a menu when none specified
  • Export — Output in text, JSON, or CSV formats
  • Shell Completions — Auto-complete for bash, zsh, fish, PowerShell
Terminal window
# Build from source
git clone https://github.com/cameronrye/aranet.git
cd aranet
cargo install --path crates/aranet-cli
Terminal window
# Show help
aranet --help
# Scan for devices
aranet scan
# Read current values
aranet read --device <ADDRESS>
# Download history
aranet history --device <ADDRESS> --output data.csv
OptionDescription
-v, --verboseEnable verbose/debug output
-q, --quietSuppress non-essential output
-o, --output <FILE>Write output to file instead of stdout
--jsonOutput in JSON format (shorthand for --format json)
--no-colorDisable colored output
--style <MODE>Visual styling: rich (default), minimal, plain
--fahrenheitDisplay temperature in Fahrenheit
--inhgDisplay pressure in inches of mercury
--bqDisplay radon in Bq/m3 (instead of pCi/L)
-h, --helpShow help information
--versionShow version number

The CLI uses rich styling by default with spinners, color-coded values, and table formatting.

ModeDescription
richFull styling with tables, spinners, colored values (default)
minimalColors only, no tables or spinners
plainNo styling, suitable for scripting
Terminal window
# Use minimal styling
aranet read --device <ADDRESS> --style minimal
# Plain output for scripts
aranet history --device <ADDRESS> --style plain
# Set via environment variable
export ARANET_STYLE=minimal

Sensor readings are color-coded based on health thresholds:

MetricGreenYellowRed
CO2< 800 ppm800-1000 ppm> 1000 ppm
Radon< 100 Bq/m3100-150 Bq/m3> 150 Bq/m3
Battery> 50%20-50%< 20%
Humidity30-60%Outside range-

Most commands support multiple output formats:

Terminal window
# Text (default, human-readable)
aranet read --device <ADDRESS> --format text
# JSON (for scripting/APIs)
aranet read --device <ADDRESS> --format json
# CSV (for spreadsheets)
aranet history --device <ADDRESS> --format csv
VariableDescription
ARANET_DEVICEDefault device address
RUST_LOGLog level (debug, info, warn, error)
NO_COLORDisable colored output (any value)
CodeMeaning
0Success
1General error
2Device not found
3Connection failed
4Bluetooth unavailable

Made with ❤️ by Cameron Rye