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

Uploaded Python 3Windows x86-64

shelly_cli-0.1.3-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.3-py3-none-manylinux_2_28_aarch64.whl (5.5 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

shelly_cli-0.1.3-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.3.tar.gz.

File metadata

  • Download URL: shelly_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 51.1 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.3.tar.gz
Algorithm Hash digest
SHA256 79b21b6b241788d11365e67db6d59ae738652f9a0ac51c1f9a3536c5110fb0a6
MD5 b74b70905ad0cc3d63692017f42604b5
BLAKE2b-256 cd838cadcb3b988c7e740cda908728b8d5f8e5f46569207750698ed585db8f7b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shelly_cli-0.1.3-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.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b6467a20ac323aa5ecf8d7dac680f8f6434ebe817c2a5bb48ae54ade1683cdf3
MD5 0608d54579f4c5af2c49ea9a96f6afb0
BLAKE2b-256 0fa56c9d5c6540fab32e2ec0ca6e8c6aaa0f20009b2ba21e634c8fce3a92f8cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 84f96d837f7a05cb6bd1c4d913fbd520360b4c3ecad5d10a74b1358a34daaca4
MD5 1a1397b4d66e1894ca14f81fe56e7130
BLAKE2b-256 86cf8b60940b43b9316f4d40a316237e15fdf7a21a0f0174ba35630920527083

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.3-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bdbfd79e2bd69d58d35258183832be52b8dbaf683355c365fa25f41e68a152e9
MD5 67498cdf1da2182ef61ab9979251d3dd
BLAKE2b-256 6f576b5cc9ea7bd102e27d1c22f678db0e1e4130cff41f51beabf6e43a12c9cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b3fc5ff58c2aab2e6a84596af98504ed5ff26afa03af63e13adc70f6f8d44180
MD5 ae27f37d9876cf62d59203f133039d59
BLAKE2b-256 5c212128266709cf54504e59c2fa8a165482470725e699b16b5abd49081357ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 621040c2cea8a50f736bb16351cf918adfdd390d58d7338e41f7a2689dda424e
MD5 4a741d53d6baf5934c938f506f0e5543
BLAKE2b-256 48c0fd64ceacee308f120382c4a1391a0cce5fd8479b40a853cb44c831a812b3

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