shelly-cli-0.1.10 is not a library.
shelly
A fast CLI for discovering, monitoring, and controlling Shelly smart home devices.
Features
- Auto-discovery of Shelly devices on the local network (with subnet auto-detection)
- Unified Gen1 + Gen2/Gen3 support (transparent protocol handling)
- Multi-switch device support (e.g., Shelly 2.5 with dual relays)
- Interactive watch dashboard with live power, temperature, WiFi monitoring -- and switch control
- Energy consumption tracking (total kWh per device)
- Detailed device info view (model, firmware, uptime, WiFi, temperature)
- Device health checks (temperature, WiFi signal, firmware, uptime)
- Device authentication (
--passwordflag or config file) - Device groups with filter-based and name-based definitions
- Firmware check and update across all devices
- Config backup and restore with network-safe defaults
- Schedule and webhook inspection (Gen2/Gen3)
- Device renaming and configuration from the CLI
- Structured JSON output for scripting and AI agent integration
- Shell completions with dynamic device name suggestions (bash, zsh, fish)
- Fuzzy device name matching with "did you mean?" suggestions
- Color output with automatic detection
Install
uv (recommended)
Homebrew (macOS/Linux)
pip
Cargo
Pre-built binaries
Download from GitHub Releases.
Quick Start
# 1. Discover devices (auto-detects your subnet)
# 2. See what you found
# 3. Check device health
Usage
Device control
Monitoring
Device management
Configuration
Supported config keys: name, eco_mode, led_status_disable.
Backup and restore
Restore skips network/WiFi/MQTT/cloud settings to avoid bricking devices.
Schedules and webhooks
Groups
Authentication
For devices with authentication enabled:
# Per-command
# Or set in config file (~/.config/shelly-cli/config.toml)
# [auth]
# password = "secret"
Shell completions
# Generate completions (includes dynamic device name suggestions)
# After installing, tab-complete device names:
# shelly -n <TAB> → "Kitchen Light" "Living Room" "Bedroom Fan"
# shelly -g <TAB> → "lights" "gen1" "gen3"
Agent Integration
Designed for scripting and AI agent use with structured, machine-readable output.
# Structured JSON output (auto-enabled when piped)
|
# Consistent envelope: {"ok": true, "data": ...} or {"ok": false, "error": {...}}
# {"ok": false, "error": {"code": "DEVICE_NOT_FOUND", "message": "..."}}
# Machine-readable schema with types, targeting docs, and error codes
Error codes: DEVICE_NOT_FOUND, DEVICE_UNREACHABLE, AUTH_REQUIRED, NETWORK_ERROR, INVALID_INPUT, GROUP_NOT_FOUND, NO_CACHED_DEVICES, PARTIAL_FAILURE.
Groups Configuration
Groups are defined in a TOML file:
# ~/.config/shelly-cli/groups.toml (Linux)
# ~/Library/Application Support/shelly-cli/groups.toml (macOS)
[]
= ["Kitchen Light", "Living Room Light", "Bedroom Light"]
= { = "gen1" }
= { = "gen3" }
= { = "all" }
Or manage via CLI: shelly group add, shelly group remove, shelly group show.
Supported Devices
| Generation | Examples | Status |
|---|---|---|
| Gen1 | Shelly 1, 1PM, 2.5, Plug S, Dimmer | Supported (switch, power, firmware, config) |
| Gen2 | Shelly Plus 1, Plus 1PM, Plus 2PM | Supported (switch, power, firmware, config, schedules, webhooks) |
| Gen3 | Shelly Mini 1PM G3, Plus series G3 | Supported (switch, power, firmware, config, schedules, webhooks) |
License
MIT License -- see LICENSE file.