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)
- RGB / RGBW / CCT / dimmable light control (
shelly light, Gen2/Gen3) - Multi-channel device support, per-plug control via
--id(e.g., Shelly 2.5 dual relays, PowerStrip) - 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)
uv tool install shelly-cli
# Or run without installing
uvx shelly-cli --help
Homebrew (macOS/Linux)
brew install rvben/tap/shelly-cli
pip
pip install shelly-cli
Cargo
cargo install shelly-cli
Pre-built binaries
Download from GitHub Releases.
Quick Start
# 1. Discover devices (auto-detects your subnet)
shelly discover
# 2. See what you found
shelly devices
# 3. Check device health
shelly health
Usage
Device control
shelly on "Kitchen Light" # Turn on
shelly off "Kitchen Light" # Turn off
shelly toggle -n "Living Room" # Toggle
shelly status -n "Kitchen Light" # Get status
For multi-channel devices (dual relays, power strips), select a specific plug/channel with --id (defaults to 0). The available switch IDs are listed by shelly info.
shelly info -n "Office Strip" # Lists Switch 0, Switch 1, ...
shelly on -n "Office Strip" --id 1 # Turn on plug 1
shelly off -n "Office Strip" --id 3 # Turn off plug 3
shelly switch status -n "Office Strip" --id 2 # Status of plug 2
Light control (Gen2/Gen3 RGB / RGBW / CCT / dimmable)
shelly light on -n "Desk Lamp" --color '#00ff88' # RGB color (hex)
shelly light on -n "Desk Lamp" --color warm # named color
shelly light on -n "Desk Lamp" --rgb 0,255,136 --brightness 80
shelly light set -n "Desk Lamp" --brightness 40 # change brightness, keep power state
shelly light on -n "Strip" --rgb 255,0,0 --white 0 # RGBW: color + white channel
shelly light on -n "Bulb" --temp 3000 --brightness 60 # CCT: color temperature (Kelvin)
shelly light off -n "Desk Lamp"
shelly light toggle -n "Desk Lamp"
shelly light status -n "Desk Lamp"
--id selects the component on multi-light devices (default 0). Brightness is 1-100 for RGB/RGBW and 0-100 for CCT/dimmable. --color accepts hex (#rrggbb) or a name (red, green, blue, white, warm, cyan, magenta, yellow, orange, purple, pink, off); --rgb takes r,g,b each 0-255.
Monitoring
shelly watch # Interactive dashboard
shelly health # Health check all devices
shelly power -a # Power usage for all devices
shelly energy -a # Total energy (kWh) per device
shelly info -n "Kitchen Light" # Detailed device info
Device management
shelly rename -n "old-name" "New Name" # Rename device
shelly firmware check -a # Check for updates
shelly firmware update -a # Update all firmware
shelly reboot -n "Kitchen Light" # Reboot device
Configuration
shelly config get -n "Kitchen" # Get device config (JSON)
shelly config get -a # Get config for all devices
shelly config set -n "Kitchen" eco_mode true # Set a config value
shelly config set -n "Kitchen" name "New Name" # Rename via config
Supported config keys: name, eco_mode, led_status_disable.
Backup and restore
shelly backup -n "Kitchen" # Backup single device
shelly backup -a # Backup all devices to shelly-backups/
shelly backup -a -o ~/backups # Custom output directory
shelly restore -n "Kitchen" shelly-backups/kitchen-2025-01-15.json
Restore skips network/WiFi/MQTT/cloud settings to avoid bricking devices.
Schedules and webhooks
shelly schedule list -n "Kitchen" # View device schedules (Gen2/Gen3)
shelly schedule list -a # View all device schedules
shelly webhook list -n "Kitchen" # View device webhooks
shelly webhook list -a # View all device webhooks
Groups
shelly group add lights "Kitchen" "Living Room" "Bedroom"
shelly group list
shelly group show lights
shelly -g lights off # Turn off all lights
shelly -g lights status # Status of all lights
shelly -g gen3 firmware check # Check firmware for Gen3 devices
Authentication
For devices with authentication enabled:
# Per-command
shelly --password "secret" status -a
# Or set in config file (~/.config/shelly-cli/config.toml)
# [auth]
# password = "secret"
shelly watch distinguishes rejected credentials from devices that are truly
offline. When a device shows AUTH, press p to enter a replacement password
with hidden input. The dashboard restores the normal terminal for the prompt,
saves the credential in an owner-only config file, and resumes automatically.
Shell completions
# Generate completions (includes dynamic device name suggestions)
shelly completions zsh > ~/.zfunc/_shelly # zsh
shelly completions bash > /etc/bash_completion.d/shelly # bash
shelly completions fish > ~/.config/fish/completions/shelly.fish # fish
# 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)
shelly status -a | jq '.data'
# Consistent envelope: {"ok": true, "data": ...} or {"ok": false, "error": {...}}
shelly -n "nonexistent" status
# {"ok": false, "error": {"code": "DEVICE_NOT_FOUND", "message": "..."}}
# Machine-readable schema with types, targeting docs, and error codes
shelly schema
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)
[groups]
lights = ["Kitchen Light", "Living Room Light", "Bedroom Light"]
gen1 = { filter = "gen1" }
gen3 = { filter = "gen3" }
all = { filter = "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, PowerStrip 4 (S4PL) | Supported (switch, power, firmware, config, schedules, webhooks) |
License
MIT License -- see LICENSE file.
Releasing
Vership owns versioning, changelog generation, release commits, and tags. See the release runbook for the verified workflow and recovery policy.
Metadata
Release files for shelly-cli 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shelly_cli-0.2.5.tar.gz | 92.3 kB | Without provenance | Details for shelly_cli-0.2.5.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| shelly_cli-0.2.5-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for shelly_cli-0.2.5-py3-none-win_amd64.whl |
| shelly_cli-0.2.5-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details for shelly_cli-0.2.5-py3-none-manylinux_2_28_x86_64.whl |
| shelly_cli-0.2.5-py3-none-manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64 | Details for shelly_cli-0.2.5-py3-none-manylinux_2_28_aarch64.whl |
| shelly_cli-0.2.5-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for shelly_cli-0.2.5-py3-none-macosx_11_0_arm64.whl |
| shelly_cli-0.2.5-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details for shelly_cli-0.2.5-py3-none-macosx_10_12_x86_64.whl |
Total release size: 15.6 MB
Release files / shelly_cli-0.2.5.tar.gz
| Download URL | shelly_cli-0.2.5.tar.gz |
|---|---|
| Size | 92.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c4405e8d9ab7ccf2e5a69a2432612e5f80dbb7ff644d2ac66bb7c57a089b7ff
|
|
BLAKE2b-256 checksum How to use checksums |
626479918f4f848ba0d2e0294dd89dd56a75733ffe7e6b47073595467ec2685a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / shelly_cli-0.2.5-py3-none-win_amd64.whl
| Download URL | shelly_cli-0.2.5-py3-none-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7ebc5ad7785913ffe72e606e8daa555169309365d1e8426e988af7515024a6a2
|
|
BLAKE2b-256 checksum How to use checksums |
7a86c8d6d0a9c2afa5602c48c53e85e1883857fe3b8704e42115bb5724e5cf7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / shelly_cli-0.2.5-py3-none-manylinux_2_28_x86_64.whl
| Download URL | shelly_cli-0.2.5-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
f312d6117d37a17729c3390fce097647e227a206431f4f4099c865fd2e0b715f
|
|
BLAKE2b-256 checksum How to use checksums |
9c2e96e4e20038fd94b9a5acf135a5ae21c1f25941da8d1ec4eed69d78f41e01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / shelly_cli-0.2.5-py3-none-manylinux_2_28_aarch64.whl
| Download URL | shelly_cli-0.2.5-py3-none-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
8c47163e7c2098215ea191c69559cfa26d95df2e03dd94961da236a3c46d8928
|
|
BLAKE2b-256 checksum How to use checksums |
7803f26aaba1f084bdb136afda2a00042b23396575694746e86c9114243745ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / shelly_cli-0.2.5-py3-none-macosx_11_0_arm64.whl
| Download URL | shelly_cli-0.2.5-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
19e362dcabda0b84eb45092d452dc74da51041666847fb42bec67442a1ce94de
|
|
BLAKE2b-256 checksum How to use checksums |
e0410ab262132a9f757510d776bff29ba6bfb1c988da50defd05bd2a83c5fc6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / shelly_cli-0.2.5-py3-none-macosx_10_12_x86_64.whl
| Download URL | shelly_cli-0.2.5-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
df0397c5402722fbc9abbe7286221296d948d1c2a2e6cca72cabb418961393d4
|
|
BLAKE2b-256 checksum How to use checksums |
c9a4a737af966ad5e80c6f7d29f58d112fca894336d804862651f47df5c32c6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for shelly-cli 0.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.