| Crates.io | aranet-cli |
| lib.rs | aranet-cli |
| version | 0.1.10 |
| created_at | 2026-01-17 01:06:38.981095+00 |
| updated_at | 2026-01-22 03:25:48.364375+00 |
| description | Command-line interface for Aranet environmental sensors |
| homepage | |
| repository | https://github.com/cameronrye/aranet |
| max_upload_size | |
| id | 2049645 |
| size | 852,044 |
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).
cargo install aranet-cli
Or build from source:
git clone https://github.com/cameronrye/aranet.git
cd aranet
cargo build --release --package aranet-cli

aranet scan
aranet read --device <DEVICE_ADDRESS>
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
# Specify multiple devices
aranet read -d device1 -d device2
# Or comma-separated
aranet read -d living-room,bedroom,office
# Read from BLE advertisements without connecting (requires Smart Home enabled)
aranet read --device <DEVICE_ADDRESS> --passive
# 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>
aranet info --device <DEVICE_ADDRESS>
aranet set --device <DEVICE_ADDRESS> interval 5
aranet set --device <DEVICE_ADDRESS> range extended
# 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
aranet doctor
# Sync device history (incremental - only new records)
aranet sync --device <DEVICE_ADDRESS>
# Full sync (re-download all history)
aranet sync --device <DEVICE_ADDRESS> --full
# 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
# Display pressure in inches of mercury
aranet read --device <DEVICE_ADDRESS> --inhg
# Explicitly use hPa (default)
aranet read --device <DEVICE_ADDRESS> --hpa
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)| 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
The CLI uses rich styling by default with color-coded values, spinners, and table formatting.
| 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
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 | - |
Get a compact one-line status:
aranet status --device <DEVICE> --brief
# Output: Aranet4 17C3C: 800 ppm [GREEN] | 22.5C | 45% | 85%
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
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.
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 |
| aranet-wasm | - | WebAssembly module |
MIT
Made with ❤️ by Cameron Rye