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.6.tar.gz (55.7 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.6-py3-none-win_amd64.whl (5.4 MB view details)

Uploaded Python 3Windows x86-64

shelly_cli-0.1.6-py3-none-manylinux_2_28_x86_64.whl (6.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

shelly_cli-0.1.6-py3-none-manylinux_2_28_aarch64.whl (5.7 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

shelly_cli-0.1.6-py3-none-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

shelly_cli-0.1.6-py3-none-macosx_10_12_x86_64.whl (5.3 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: shelly_cli-0.1.6.tar.gz
  • Upload date:
  • Size: 55.7 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.6.tar.gz
Algorithm Hash digest
SHA256 2cbd1a59b57fc85e9ccdb2dad882961f1b8c2dcdb10cbdbceb8368dd9c6c19cf
MD5 91c25182e8fbec1baf3b256bf9de623d
BLAKE2b-256 866e15fa9efb09343d2d04269a6201a8364fc022acb9e10f939f860a18556542

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shelly_cli-0.1.6-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.4 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.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e3f610cdf45adab7fe0fab2ae27eac133d5ac6d4a736742c4ab438d2f8d36c3f
MD5 2254f2089de60f2facb6f78ade92312f
BLAKE2b-256 20eab12d868903e8ee71432a2a34a5b57d952a6935869bd1bcfd670bcafaa707

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.6-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2f9a057693ee6052f4a5c35ead997e7a5e4aaea80e9e7abb48087caf6f24e9f0
MD5 5ec8c167d69294148a5d07938756d827
BLAKE2b-256 0cb8f15397bad1e4d74974c0c6b333abdebb056b8515e5ef423de8d7d52c1f4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.6-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 534b45bc76f751b2cc532332c593aaeefd83a277ac5cedd10031b9d5dce73a1e
MD5 532ff42574a2b567e18158ca52bbda57
BLAKE2b-256 a4460e67e9541d6e94f2b4dfc9598a01432e87e7cc35e0233478c854ad7c2a84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3678f6c3d8909cde093d6b83d9e374dbaa9cae1532c73048df448661ea039197
MD5 991a9af97a2bae8ec926ef7b88bc38e5
BLAKE2b-256 2cb0c8823802c2c0609e9d1fffe305d1dc0d85941ec55645cc3022204fe36a77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shelly_cli-0.1.6-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e779d5c3182d74d826673c68e4833179cce07f8bd0afcd85589994b3482513fc
MD5 77ec81cd904b87665fbb1e3586e16de8
BLAKE2b-256 378b86ebec22828c4db4f3d1037bac5ab0e69f71f247cb267c52ac325808affe

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