This document provides a complete reference for configuring the Shelly CLI.
Configuration File The CLI reads configuration from ~/.config/shelly/config.yaml by default. You can specify a different location using the --config flag or SHELLY_CONFIG environment variable.
Creating Configuration 1
2
3
4
5
6
# Initialize with defaults
shelly init
# Or create manually
mkdir -p ~/.config/shelly
touch ~/.config/shelly/config.yaml
Configuration Options Global Settings Option Type Default Description outputstring tableDefault output format: table, json, yaml, csv, template colorbool trueEnable colored output themestring/object draculaColor theme (name or configuration block) api_modestring localAPI mode: local, cloud, or auto verbosityint 0Verbosity level: 0=silent, 1=info, 2=debug, 3=trace quietbool falseSuppress non-essential output telemetrybool falseOpt-in anonymous usage telemetry editorstring - Preferred editor for shelly config edit. Falls back to $EDITOR, $VISUAL, then nano
1
2
3
4
5
6
7
8
output : table
color : true
theme : dracula
api_mode : local
verbosity : 0
quiet : false
telemetry : false # Opt-in anonymous usage telemetry
editor: vim # Optional : vim, code, nano, emacs, etc.
Telemetry Shelly CLI includes opt-in anonymous usage telemetry to help improve the CLI. This is disabled by default.
What is collected (when enabled):
Command name (e.g., “device list”, “switch on”) Whether the command succeeded or failed CLI version, OS, and architecture Command execution duration What is NOT collected:
Device information (names, addresses, configurations) IP addresses or network information Authentication credentials Command arguments or parameters See the Event payload definition for the exact data structure.
1
2
3
4
5
6
7
8
# Enable via config command
shelly config set telemetry = true
# Disable
shelly config set telemetry = false
# Or enable during setup wizard
shelly init
Logging Settings Configure debug logging behavior for troubleshooting.
Option Type Default Description log.jsonbool falseOutput logs in JSON format for machine parsing log.categoriesstring ""Filter logs by category (comma-separated)
Verbosity levels:
0 (default): Silent - no debug output1 (-v): Info level - basic operational logs2 (-vv): Debug level - detailed diagnostic information3 (-vvv): Trace level - maximum verbosityLog categories: network, config, device, api, auth, plugin, discovery, firmware
1
2
3
4
5
6
7
8
9
verbosity : 0
log :
# JSON format for log aggregation tools
json : false
# Filter to specific categories (empty = all)
# Example: "network,api" to only see network and API logs
categories : ""
Theme Configuration The theme can be specified as a simple string or a configuration block.
Simple Theme Name Theme with Color Overrides 1
2
3
4
5
6
7
8
9
10
11
12
theme :
name : dracula
colors :
foreground : "#f8f8f2"
background : "#282a36"
green : "#50fa7b"
red : "#ff5555"
yellow : "#f1fa8c"
blue : "#6272a4"
cyan : "#8be9fd"
purple : "#bd93f9"
bright_black : "#44475a"
External Theme File 1
2
theme :
file : ~/.config/shelly/themes/mytheme.yaml
Discovery Settings Configure device discovery behavior.
Option Type Default Description discovery.timeoutduration 5sDiscovery timeout discovery.mdnsbool trueEnable mDNS discovery discovery.blebool falseEnable BLE discovery discovery.coiotbool trueEnable CoIoT discovery discovery.networkstring auto Default network for scanning
1
2
3
4
5
6
discovery :
timeout : 5s
mdns : true
ble : false
coiot : true
network : 192.168.1.0 /24
Cloud Settings Configure Shelly Cloud API access.
Option Type Default Description cloud.enabledbool falseEnable cloud API cloud.emailstring - Shelly Cloud email cloud.access_tokenstring - Cloud API access token cloud.refresh_tokenstring - Cloud API refresh token cloud.server_urlstring - Cloud server URL (usually auto-detected)
1
2
3
4
5
cloud :
enabled : true
email : user@example.com
access_token : your-access-token
refresh_token : your-refresh-token
Note: Use shelly cloud login to authenticate interactively.
Integrator Settings Configure Shelly Integrator API credentials for OEM/partner integrations. These credentials are used for advanced API operations.
Option Type Default Description integrator.tagstring - Integrator tag (partner identifier) integrator.tokenstring - Integrator API token
1
2
3
integrator :
tag : my-partner-tag
token : my-integrator-token
Environment variables take precedence:
SHELLY_INTEGRATOR_TAG - Integrator tagSHELLY_INTEGRATOR_TOKEN - Integrator tokenDevice Registry Register devices for easy access by name.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
devices :
living-room :
address : 192.168.1.100
generation : 2
model : SNSW-001X16EU
auth :
user : admin
password : secret
kitchen :
address : 192.168.1.101
generation : 3
model : SNSW-102P16EU
garage :
address : shelly-garage.local
generation : 2
Device Properties Property Type Required Description addressstring yes IP address, hostname, or mDNS name generationint no Device generation (1, 2, 3, or 4) modelstring no Device model identifier auth.userstring no Authentication username auth.passwordstring no Authentication password
Aliases Create shortcuts for common commands.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
aliases :
ll :
name : ll
command : device list
shell : false
morning :
name : morning
command : scene activate morning-routine
shell : false
backup-all :
name : backup-all
command : |
for d in $(shelly device list -o json | jq -r '.[].name'); do
shelly backup create "$d" -o "backups/$d.json"
done
shell : true
Alias Properties Property Type Default Description namestring - Alias name commandstring - Command to execute shellbool falseExecute via shell (enables pipes, variables)
Device Groups Group devices for batch operations.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
groups :
lights :
name : lights
devices :
- living-room
- kitchen
- bedroom
downstairs :
name : downstairs
devices :
- living-room
- kitchen
- hallway
outdoor :
name : outdoor
devices :
- porch
- garage
- garden
Scenes Define scenes with multiple device actions.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
scenes :
movie-night :
name : movie-night
description : Dim lights for movie watching
actions :
- device : living-room
method : Switch.Set
params :
id : 0
on : false
- device : kitchen
method : Light.Set
params :
id : 0
brightness : 20
- device : hallway
method : Light.Set
params :
id : 0
on : false
morning-routine :
name : morning-routine
description : Wake up lights
actions :
- device : bedroom
method : Light.Set
params :
id : 0
on : true
brightness : 50
- device : kitchen
method : Switch.Set
params :
id : 0
on : true
Scene Action Properties Property Type Required Description devicestring yes Target device name methodstring yes RPC method to call paramsobject no Method parameters
Alerts Configure monitoring alerts for device conditions.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
alerts :
kitchen-offline :
name : kitchen-offline
description : Alert when kitchen device goes offline
device : kitchen
condition : offline
action : notify
enabled : true
created_at : "2025-01-15T10:00:00Z"
high-power :
name : high-power
description : Alert on high power consumption
device : heater
condition : "power>2000"
action : "webhook:http://example.com/alert"
enabled : true
snoozed_until : ""
created_at : "2025-01-15T10:00:00Z"
Alert Properties Property Type Required Description namestring yes Unique alert identifier descriptionstring no Human-readable description devicestring yes Device to monitor conditionstring yes Trigger condition (e.g., offline, power>100, temperature>30) actionstring yes Action when triggered: notify, webhook:URL, or command:CMD enabledbool yes Whether alert is active snoozed_untilstring no RFC3339 timestamp if temporarily snoozed created_atstring yes When alert was created
Alert Commands 1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Create an alert
shelly alert create kitchen-offline --device kitchen --condition offline
# List all alerts
shelly alert list
# Test an alert (dry-run)
shelly alert test kitchen-offline
# Snooze for 1 hour
shelly alert snooze kitchen-offline --duration 1h
# Clear snooze
shelly alert snooze kitchen-offline --clear
Note: The alert system stores configurations only. Active monitoring requires integration with shelly monitor or external scheduling.
Templates Store device configuration templates for provisioning.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
templates :
switch-default :
name : switch-default
description : Default switch configuration
model : SNSW-001X16EU
generation : 2
config :
sys :
device :
name : ""
ui_data : {}
switch:0 :
name : Main
initial_state : restore_last
auto_on : false
auto_off : false
Plugin Settings Configure the plugin system.
1
2
3
4
5
6
plugins :
enabled : true
path :
- ~/.config/shelly/plugins
- /opt/shelly-plugins
- ~/custom-plugins
Rate Limiting Settings Configure rate limiting to prevent overloading Shelly devices. This is particularly important for Gen1 (ESP8266) devices which have very limited resources:
Gen1 (ESP8266): Maximum 2 concurrent HTTP connections, easily overwhelmedGen2+ (ESP32): Maximum 5 concurrent HTTP transactions, more resilientThe CLI uses sensible defaults based on these hardware constraints. Customize only if needed.
Option Type Default Description ratelimit.gen1.min_intervalduration 2sMinimum time between requests to same Gen1 device ratelimit.gen1.max_concurrentint 1Max simultaneous requests per Gen1 device ratelimit.gen1.circuit_thresholdint 3Failures before circuit breaker opens ratelimit.gen2.min_intervalduration 500msMinimum time between requests to same Gen2 device ratelimit.gen2.max_concurrentint 3Max simultaneous requests per Gen2 device ratelimit.gen2.circuit_thresholdint 5Failures before circuit breaker opens ratelimit.global.max_concurrentint 5Total concurrent requests across all devices ratelimit.global.circuit_open_durationduration 60sHow long to back off unresponsive devices ratelimit.global.circuit_success_thresholdint 2Successes needed to close circuit
1
2
3
4
5
6
7
8
9
10
11
12
13
ratelimit :
gen1 :
min_interval : 2s
max_concurrent : 1
circuit_threshold : 3
gen2 :
min_interval : 500ms
max_concurrent : 3
circuit_threshold : 5
global :
max_concurrent : 5
circuit_open_duration : 60s
circuit_success_threshold : 2
Circuit Breaker Pattern:
The circuit breaker protects both the CLI and devices from cascading failures:
Closed (normal): Requests flow normallyOpen (backing off): After circuit_threshold consecutive failures, the circuit opens and requests are rejected immediately for circuit_open_durationHalf-Open (testing): After the duration, a single probe request is allowed. If successful, circuit closes; if failed, circuit reopensTUI Settings Configure the TUI dashboard.
Option Type Default Description tui.refresh_intervalint 5Legacy: global refresh interval in seconds (deprecated) tui.refresh.gen1_onlineduration 15sRefresh interval for online Gen1 devices tui.refresh.gen1_offlineduration 60sRefresh interval for offline Gen1 devices tui.refresh.gen2_onlineduration 5sRefresh interval for online Gen2+ devices tui.refresh.gen2_offlineduration 30sRefresh interval for offline Gen2+ devices tui.refresh.focused_boostduration 3sFaster refresh for currently selected device
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
tui :
# Adaptive refresh intervals (preferred over refresh_interval)
refresh :
gen1_online : 15s # Gen1 is fragile, poll conservatively
gen1_offline : 60s # Don't hammer offline Gen1 devices
gen2_online : 5s # Gen2 handles faster polling
gen2_offline : 30s # Back off for offline Gen2
focused_boost : 3s # Selected device gets priority refresh
theme :
name : nord # Independent TUI theme
keybindings :
up : [k, up]
down : [j, down]
left : [h, left]
right : [l, right]
page_up : [ctrl+u, pgup]
page_down : [ctrl+d, pgdn]
home : [g, home]
end : [G, end]
enter : [enter]
escape : [esc]
refresh : [r, ctrl+r]
filter : [/, f]
command : [:]
help : [?, F1]
quit : [q, ctrl+c]
toggle : [t, space]
turn_on : [o]
turn_off : [x]
reboot : [R]
tab : [tab]
shift_tab : [shift+tab]
view1 : ["1" ]
view2 : ["2" ]
view3 : ["3" ]
view4 : ["4" ]
Environment Variables Configuration can be set via environment variables with the SHELLY_ prefix. Nested config keys use underscores (e.g., cloud.access_token becomes SHELLY_CLOUD_ACCESS_TOKEN).
User-Configurable Variables Variable Config Equivalent Description SHELLY_CONFIG- Config file path (checked before default) SHELLY_OUTPUToutputOutput format (table, json, yaml) SHELLY_NO_COLOR- Disable colors (presence = disabled) SHELLY_THEMEthemeTheme name SHELLY_API_MODEapi_modeAPI mode (local, cloud, auto) SHELLY_VERBOSITYverbosityVerbosity level (0-3) SHELLY_QUIETquietQuiet mode (true/false) SHELLY_LOG_JSONlog.jsonJSON log output (true/false) SHELLY_LOG_CATEGORIESlog.categoriesLog category filter (comma-separated) SHELLY_NO_UPDATE_CHECK- Disable update notifications (presence = disabled) SHELLY_CLOUD_ACCESS_TOKENcloud.access_tokenCloud API token SHELLY_CLOUD_EMAIL- Cloud login email (used by shelly cloud login) SHELLY_CLOUD_PASSWORD- Cloud login password (used by shelly cloud login) NO_COLOR- Standard color disable (https://no-color.org )
Plugin Environment Variables These are set BY the CLI when executing plugins, not user-configurable:
Variable Description SHELLY_CONFIG_PATHPath to config file SHELLY_DEVICES_JSONJSON string of registered devices SHELLY_OUTPUT_FORMATCurrent output format
Global Flags These flags are available on all commands and override config values.
Flag Short Description --config- Config file path --output-oOutput format --no-color- Disable colors --quiet-qSuppress non-essential output --verbose-vIncrease verbosity (stackable: -v, -vv, -vvv) --log-json- Output logs in JSON format --log-categories- Filter logs by category (comma-separated) --template- Go template (with -o template)
Verbosity examples:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Info level - basic operation logs
shelly device list -v
# Debug level - detailed diagnostics
shelly device info kitchen -vv
# Trace level - maximum verbosity
shelly discover mdns -vvv
# Filter to specific categories
shelly device list -v --log-categories network,api
# JSON logs for parsing
shelly device list -vv --log-json
Full Configuration Example 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# ~/.config/shelly/config.yaml
# Global settings
output : table
color : true
theme : dracula
api_mode : local
verbosity : 0
quiet : false
telemetry : false # Opt-in anonymous usage telemetry
editor : vim # Falls back to $EDITOR, $VISUAL, then nano
# Logging settings (for debugging)
log :
json : false
categories : ""
# Discovery settings
discovery :
timeout : 5s
mdns : true
ble : false
coiot : true
network : 192.168.1.0 /24
# Cloud settings (optional)
cloud :
enabled : false
email : ""
access_token : ""
refresh_token : ""
# Integrator settings (for OEM/partners)
# integrator:
# tag: my-partner-tag
# token: my-integrator-token
# Device registry
devices :
living-room :
address : 192.168.1.100
generation : 2
model : SNSW-001X16EU
auth :
user : admin
password : secret
kitchen :
address : 192.168.1.101
generation : 3
bedroom :
address : 192.168.1.102
generation : 2
# Device groups
groups :
all-lights :
name : all-lights
devices :
- living-room
- kitchen
- bedroom
downstairs :
name : downstairs
devices :
- living-room
- kitchen
# Scenes
scenes :
movie-night :
name : movie-night
description : Dim lights for movies
actions :
- device : living-room
method : Switch.Set
params :
id : 0
on : false
- device : kitchen
method : Light.Set
params :
id : 0
brightness : 20
all-off :
name : all-off
description : Turn off all lights
actions :
- device : living-room
method : Switch.Set
params :
id : 0
on : false
- device : kitchen
method : Switch.Set
params :
id : 0
on : false
- device : bedroom
method : Switch.Set
params :
id : 0
on : false
# Aliases
aliases :
ll :
command : device list
st :
command : status
off-all :
command : batch off all-lights
# Alerts
alerts :
kitchen-offline :
name : kitchen-offline
device : kitchen
condition : offline
action : notify
enabled : true
created_at : "2025-01-15T10:00:00Z"
# Templates
templates :
switch-default :
name : switch-default
description : Default switch configuration
model : SNSW-001X16EU
generation : 2
config : {}
# Plugin settings
plugins :
enabled : true
path :
- ~/.config/shelly/plugins
# Rate limiting (uses sensible defaults - customize only if needed)
ratelimit :
gen1 :
min_interval : 2s
max_concurrent : 1
circuit_threshold : 3
gen2 :
min_interval : 500ms
max_concurrent : 3
circuit_threshold : 5
global :
max_concurrent : 5
circuit_open_duration : 60s
circuit_success_threshold : 2
# TUI settings
tui :
refresh :
gen1_online : 15s
gen1_offline : 60s
gen2_online : 5s
gen2_offline : 30s
focused_boost : 3s
keybindings :
quit : [q, ctrl+c]
toggle : [t, space]
Configuration Commands 1
2
3
4
5
6
7
8
9
10
11
12
# Show current configuration
shelly config show
# Get specific value
shelly config get output
# Set value
shelly config set output json
shelly config set theme nord
# Open config in editor
$EDITOR ~/.config/shelly/config.yaml
Configuration Files Location Platform Path Linux/macOS ~/.config/shelly/config.yamlWindows %APPDATA%\shelly\config.yaml
Directory Structure 1
2
3
4
5
6
7
8
9
10
~/.config/shelly/
├── config.yaml # Main configuration
├── plugins/ # Installed plugins
│ ├── shelly-notify # Plugin binary
│ └── ...
├── themes/ # Custom themes
│ └── mytheme.yaml
└── backups/ # Device backups (if using default path)
├── kitchen.json
└── living-room.json
Migration If upgrading from an older version, the CLI will automatically migrate configuration where possible. Check the release notes for any manual migration steps required.