Skip to main content

shelly

A fast CLI for discovering, monitoring, and controlling Shelly smart home devices.

CI crates.io PyPI License: MIT

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 (--password flag 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"

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shelly_cli-0.2.3.tar.gz (89.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

shelly_cli-0.2.3-py3-none-win_amd64.whl (3.0 MB view details)

Uploaded Python 3Windows x86-64

shelly_cli-0.2.3-py3-none-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

shelly_cli-0.2.3-py3-none-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

shelly_cli-0.2.3-py3-none-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

shelly_cli-0.2.3-py3-none-macosx_10_12_x86_64.whl (3.0 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file shelly_cli-0.2.3.tar.gz.

File metadata

  • Download URL: shelly_cli-0.2.3.tar.gz
  • Upload date:
  • Size: 89.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for shelly_cli-0.2.3.tar.gz
Algorithm Hash digest
SHA256 0a3dbb75400f49331915528b468e12301aeb26983583a9fe524c06b9b69be256
MD5 7adb41fa09c8b9c54b64f15da14da2a4
BLAKE2b-256 d5630e185d7b16674fe258710e3d6246e253f0bfba9e85a28eb83634665ad7f9

See more details on using hashes here.

File details

Details for the file shelly_cli-0.2.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: shelly_cli-0.2.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for shelly_cli-0.2.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c8b2adb9fa7b97e8acec8801d45d9358d8d0b4adff3bae025f99a3f8d4bc9850
MD5 64a1a3a1f77698f7a7e84431251d7d81
BLAKE2b-256 8995dce14d2b2e8bcd2057e1a8119d8ee257ac7baffa8a2b18dcfb351659cf90

See more details on using hashes here.

File details

Details for the file shelly_cli-0.2.3-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for shelly_cli-0.2.3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef15af037601d384cbf358fe7254102337fefac510144266efa321a5208bac66
MD5 79f7a38cdc534809a99eeed0c3bfe95d
BLAKE2b-256 c7226a7f20e774d540aaf24aea8b78cba299e35db8e03286ea04487013aa1d43

See more details on using hashes here.

File details

Details for the file shelly_cli-0.2.3-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for shelly_cli-0.2.3-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 61bce07409025ccaecc9d0597f8a8702b95759961e35a330923a5862dc754345
MD5 0fb19ee53681e8ceecd762063f16332c
BLAKE2b-256 c535b80bb2b9dbcd4657bbb5e4ff53baa663b62ab677a8ff9925ce12e36c9b57

See more details on using hashes here.

File details

Details for the file shelly_cli-0.2.3-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for shelly_cli-0.2.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58612587a2d603e9c0c258ea68e69a6c65e22eb0a6dddaee0076dcd0a0a3730e
MD5 a30d6c67d01e51ed7304e09de8de7a9f
BLAKE2b-256 6d3d009214bcf0e52a5d8803229a6e19fddbf1a6fa8c45c7552c93857f90f3f4

See more details on using hashes here.

File details

Details for the file shelly_cli-0.2.3-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for shelly_cli-0.2.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e92c02621d37b08c7adffa2d7e334ad99aa88048e11007fcea08f057bf9d5ffc
MD5 b9156689d5ab6bef4dc62fcb13217f37
BLAKE2b-256 ce22248c14ab338576794aa677a8f1ef308b13d2b40ecc7788c84e3ef8d9d2d5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.4

6 files

This release

0.2.3 This release

6 files

0.2.2

6 files

0.2.1

5 files

0.2.0

5 files

0.1.12

6 files

0.1.11

6 files

0.1.10

6 files

0.1.9

6 files

0.1.8

6 files

0.1.7

6 files

0.1.6

6 files

0.1.5

6 files

0.1.4

6 files

0.1.3

6 files

0.1.2

6 files

0.1.1

6 files

0.1.0

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page