Skip to main content

CLI for managing and controlling Shelly devices

Project description

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)
  • 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 (--password flag or config file)
  • Device groups with filter-based and name-based definitions
  • Firmware check and update across all devices
  • Device renaming from the CLI
  • Structured JSON output for scripting and AI agent integration
  • Shell completions (bash, zsh, fish, powershell)
  • Fuzzy device name matching with "did you mean?" suggestions
  • Color output with automatic detection

Install

uv (recommended)

uv tool install shelly-cli

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

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

Groups

shelly group add lights "Kitchen" "Living Room" "Bedroom"
shelly group list
shelly -g lights off               # Turn off all lights
shelly -g lights status            # Status of all lights

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"

Configuration

shelly config get -n "Kitchen"     # Get device config
shelly completions zsh             # Generate shell completions

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
shelly schema

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)
Gen2 Shelly Plus 1, Plus 1PM, Plus 2PM Supported (switch, power, firmware)
Gen3 Shelly Mini 1PM G3, Plus series G3 Supported (switch, power, firmware)

License

MIT License -- see LICENSE file.

Project details


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.1.2.tar.gz (51.0 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.1.2-py3-none-win_amd64.whl (5.2 MB view details)

Uploaded Python 3Windows x86-64

shelly_cli-0.1.2-py3-none-manylinux_2_28_x86_64.whl (5.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

shelly_cli-0.1.2-py3-none-manylinux_2_28_aarch64.whl (5.5 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

shelly_cli-0.1.2-py3-none-macosx_11_0_arm64.whl (4.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

shelly_cli-0.1.2-py3-none-macosx_10_12_x86_64.whl (5.1 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: shelly_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for shelly_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 59c75759163a72aa5236a5a8b49b4bb7e9c9bcdda2a87de84f4aeddb33e35877
MD5 39563e9c2ab69b84ffe40beb4adb7845
BLAKE2b-256 ea22dd9b132211a463850e84892831a252cb808b9797f4c716bed91757c410c2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for shelly_cli-0.1.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c10b780373a7c986f43e0ba34950ef1d248d1f8b8e527b2d0e510e8116ec613f
MD5 105129a521ed949966c06bcfe7e2e283
BLAKE2b-256 2e5b7def9460bbf9dc23f9ebc9582f23bb106f483107ff51c20dbcae289ba5ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.2-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c176c60e0102dd3912cbe559138f391303faf606a6feae79ca558033023cb654
MD5 e4121b2aa33db9051fbab24d59a6dc27
BLAKE2b-256 98ddc3ace37837690457427e16e6446c4937511731ed8e42fb7eab3a46ac81e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.2-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0037c8506e8ec293c5fcb639d6754155fb41a3a1bc1632ffb6f94f0aeebbc612
MD5 1a8dab351a0beee18f84b0ee1d279a4b
BLAKE2b-256 050987b98ebeb2808d63fc2a7419333050d6ce9271417dc64452bb1e3f7b8a6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3378dd025721449857800e20fc41c3faa5a2033c8d7b112997353a433fc2ae22
MD5 8fefcfb79ec8054e8911445f1d3ed3dd
BLAKE2b-256 e63181f8e2d7ae93d36d0997ea17002f7e10a919edec6584073dc127c4ece9cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e0fab4d1f759ffbc844dcfc760742a1ea90dbf6c4e95ea50beb698aa9c3a1345
MD5 5d590e5b7469239a263c1fca29dcdce3
BLAKE2b-256 4152d4aa684c73400599c328a670f979538e5b640c68c35384dd342710701be6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page