11 releases
Uses new Rust 2024
| 0.1.12 | Feb 2, 2026 |
|---|---|
| 0.1.11 | Feb 1, 2026 |
| 0.1.10 | Jan 22, 2026 |
#89 in Hardware support
Used in 2 crates
2MB
44K
SLoC
aranet-cli
Command-line interface for Aranet environmental sensors.
A fast, scriptable CLI for reading sensor data, downloading history, and configuring Aranet devices (Aranet4, Aranet2, AranetRn+, Aranet Radiation).
Installation
cargo install aranet-cli
Or build from source:
git clone https://github.com/cameronrye/aranet.git
cd aranet
cargo build --release --package aranet-cli
Demo

Usage
Scan for devices
aranet scan
Read current measurements
aranet read --device <DEVICE_ADDRESS>
Download measurement history
aranet history --device <DEVICE_ADDRESS>
aranet history --device <DEVICE_ADDRESS> --count 100 --format csv --output history.csv
# Filter by date range
aranet history --device <DEVICE_ADDRESS> --since 2026-01-15 --until 2026-01-16
Read from multiple devices
# Specify multiple devices
aranet read -d device1 -d device2
# Or comma-separated
aranet read -d living-room,bedroom,office
Passive read mode
# Read from BLE advertisements without connecting (requires Smart Home enabled)
aranet read --device <DEVICE_ADDRESS> --passive
Watch real-time data
# Watch a specific device
aranet watch --device <DEVICE_ADDRESS> --interval 60
# Watch all devices passively (requires Smart Home enabled)
aranet watch --passive
# Watch a specific device passively
aranet watch --passive --device <DEVICE_ADDRESS>
View device information
aranet info --device <DEVICE_ADDRESS>
Configure device settings
aranet set --device <DEVICE_ADDRESS> interval 5
aranet set --device <DEVICE_ADDRESS> range extended
Manage device aliases
# Create an alias for a device
aranet alias set living-room AA:BB:CC:DD:EE:FF
# List all aliases
aranet alias list
# Use aliases instead of addresses
aranet read -d living-room
# Remove an alias
aranet alias remove living-room
Diagnose BLE issues
aranet doctor
Sync history to local database
# Sync device history (incremental - only new records)
aranet sync --device <DEVICE_ADDRESS>
# Full sync (re-download all history)
aranet sync --device <DEVICE_ADDRESS> --full
Query cached data
# List cached devices
aranet cache devices
# Show cache statistics
aranet cache stats
# Query cached history
aranet cache history --device <DEVICE_ADDRESS> --count 100
# Show database info
aranet cache info
Pressure units
# Display pressure in inches of mercury
aranet read --device <DEVICE_ADDRESS> --inhg
# Explicitly use hPa (default)
aranet read --device <DEVICE_ADDRESS> --hpa
Configuration
The CLI supports persistent configuration via a TOML file:
# Initialize config file
aranet config init
# Set a default device
aranet config set device <DEVICE_ADDRESS>
# Set default output format
aranet config set format json
# Show current config
aranet config show
Configuration options:
device— Default device addressformat— Default output format (text,json,csv)timeout— Connection timeout in secondsno_color— Disable colored outputfahrenheit— Use Fahrenheit for temperature displayinhg— Use inHg for pressure displaybq— Use Bq/m3 for radon (instead of pCi/L)
Output Formats
| Format | Description |
|---|---|
text |
Human-readable colored output (default) |
json |
JSON for scripting and APIs |
csv |
CSV for spreadsheets and data analysis |
aranet read --device <DEVICE> --format json
aranet read --device <DEVICE> --json # shorthand
Visual Styling
The CLI uses rich styling by default with color-coded values, spinners, and table formatting.
Style Modes
| Mode | Description |
|---|---|
rich |
Full styling with tables, spinners, colored values (default) |
minimal |
Colors only, no tables or spinners |
plain |
No styling, suitable for scripting |
# Use minimal styling
aranet read --device <DEVICE> --style minimal
# Plain output for scripts
aranet history --device <DEVICE> --style plain
# Set via environment variable
export ARANET_STYLE=minimal
Color-Coded Values
Sensor readings are color-coded based on thresholds:
| Metric | Green | Yellow | Red |
|---|---|---|---|
| CO2 | < 800 ppm | 800-1000 ppm | > 1000 ppm |
| Radon | < 100 Bq/m3 | 100-150 Bq/m3 | > 150 Bq/m3 |
| Battery | > 50% | 20-50% | < 20% |
| Humidity | 30-60% | Outside range | - |
Brief Mode
Get a compact one-line status:
aranet status --device <DEVICE> --brief
# Output: Aranet4 17C3C: 800 ppm [GREEN] | 22.5C | 45% | 85%
Shell Completions
Generate shell completions for your preferred shell:
aranet completions bash > ~/.local/share/bash-completion/completions/aranet
aranet completions zsh > ~/.zfunc/_aranet
aranet completions fish > ~/.config/fish/completions/aranet.fish
TUI Dashboard
Launch the interactive terminal dashboard:
aranet tui
The TUI provides real-time monitoring with sparkline charts, threshold alerts, multi-device support, and more. See aranet-tui for the complete feature list and keybindings.
Related Crates
This CLI is part of the aranet workspace:
| Crate | crates.io | Description |
|---|---|---|
| aranet-core | Core BLE library for device communication | |
| aranet-types | Shared types for sensor data | |
| aranet-store | Local data persistence | |
| aranet-tui | Terminal UI dashboard | |
| aranet-service | Background collector and REST API | |
| aranet-gui | Desktop GUI application |
License
MIT
Made with ❤️ by Cameron Rye
Dependencies
~53–110MB
~2M SLoC