Skip to main content

Crate aranet_cli

Crate aranet_cli 

Source
Expand description

Command-line interface for Aranet environmental sensors.

This crate provides a comprehensive CLI for interacting with Aranet devices including the Aranet4, Aranet2, AranetRn+ (Radon), and Aranet Radiation sensors.

§Features

  • Device scanning: Discover nearby Aranet devices via BLE
  • Current readings: Display real-time sensor values with color-coded status
  • Historical data: Download and export measurement history
  • Device configuration: Adjust measurement interval, Bluetooth range, and Smart Home mode
  • Continuous monitoring: Watch mode for ongoing data collection
  • Multiple output formats: Text, JSON, and CSV output support
  • Configuration file: Persistent settings for default device and preferences
  • Shell completions: Generate completions for bash, zsh, fish, and PowerShell

§Commands

CommandDescription
scanScan for nearby Aranet devices
readRead current sensor values
statusQuick one-line status display
historyDownload historical data
infoDisplay device information
setConfigure device settings
watchContinuously monitor a device
configManage CLI configuration
aliasManage device aliases
syncSync history to the local cache
cacheQuery cached data
reportSummarize cached history
doctorRun Bluetooth diagnostics
completionsGenerate shell completions

§Output Formats

The CLI supports three output formats:

  • Text (default): Human-readable colored output
  • JSON: Machine-readable JSON format
  • CSV: Comma-separated values for spreadsheets and data analysis

§Configuration

The CLI stores configuration in ~/.config/aranet/config.toml (or platform equivalent). Configuration options include:

  • device: Default device address
  • format: Default output format
  • no_color: Disable colored output
  • fahrenheit: Use Fahrenheit for temperature display

§Environment Variables

  • ARANET_DEVICE: Default device address (overridden by --device flag)
  • NO_COLOR: Disable colored output when set

§Examples

Scan for devices:

aranet scan

Read current values from a specific device:

aranet read --device AA:BB:CC:DD:EE:FF

Download history as CSV:

aranet history --device AA:BB:CC:DD:EE:FF --format csv --output data.csv

Watch a device continuously:

aranet watch --device AA:BB:CC:DD:EE:FF --interval 60

Set measurement interval:

aranet set --device AA:BB:CC:DD:EE:FF interval 5

Re-exports§

pub use aranet_core;
pub use aranet_types;

Modules§

config
Configuration file management.
tui
Main entry point for the TUI dashboard.

Functions§

local_now_fmt
Get the current local time formatted with the given time format description string.