@switchbot/openapi-cli

SwitchBot smart home CLI — control devices, run scenes, stream events, and plug AI agents into your home via the built-in MCP server.
Human — start with Quick start: colored tables, error hints, shell completion, switchbot doctor.
Script — start with Global options: --json, --format tsv/yaml/id, --fields, stable exit codes, audit log.
Agent — start with docs/agent-guide.md: mcp serve, schema export, plan run, destructive-command guards.
Every surface shares the same catalog, cache, and HMAC client.
Installation
npm install -g @switchbot/openapi-cli
Requires Node.js ≥ 18. Run switchbot auth login to authenticate via browser — no Developer Options needed.
To use API token/secret directly instead, first obtain your credentials from the SwitchBot app:
- Open Profile → Preferences → About (app V9.0 or newer).
- Tap App Version 10 times to expose Developer Options.
- Open Developer Options → Get Token and copy the token and secret.
- For older apps, App Version is directly under Preferences. See the official credential instructions.
Then run:
switchbot config set-token <token> <secret>
Supported devices
Run switchbot catalog show for the effective catalog, including aliases and per-command details. Discovery follows the pinned official documentation; undocumented defaults and live-device behavior are not certified by local metadata.
| Category | Devices |
|---|
| Lighting | Color Bulb · Strip Light · Strip Light 3 · RGBICWW Strip Light · RGBICWW Light Bars · Floor Lamp · RGBICWW Floor Lamp · Ceiling Light · Ceiling Light Pro · RGBICWW Ceiling Light · RGBIC Neon Rope Light · RGBIC Neon Wire Rope Light · Candle Warmer Lamp · Permanent Outdoor Lights |
| Climate | Humidifier · Humidifier2 · Air Purifier VOC · Air Purifier Table VOC · Air Purifier PM2.5 · Air Purifier Table PM2.5 · Smart Radiator Thermostat |
| Security | Smart Lock · Smart Lock Pro · Smart Lock Pro Wifi · Smart Lock Ultra · Smart Lock Ultra Max · Lock Lite · Lock Vision · Lock Vision Pro · Keypad · Keypad Touch · Keypad Vision · Keypad Vision Pro · Garage Door Opener · Video Doorbell · Vision Doorbell (status only) |
| Curtains & blinds | Curtain · Curtain3 · Curtain 4 · Blind Tilt · Roller Shade |
| Power | Plug · Plug Mini (US) · Plug Mini (JP) · Plug Mini (EU) · Plug Mini (IT) · Outdoor Plug (EU) · Relay Switch 1 · Relay Switch 1PM · Relay Switch 2PM |
| Fans | Battery Circulator Fan · Battery Circulator Fan 2 Pro · Circulator Fan · Standing Circulator Fan |
| Cleaning | Robot Vacuum Cleaner S1 · Robot Vacuum Cleaner S1 Plus · K10+ · K10+ Pro · Robot Vacuum Cleaner K10+ Pro Combo · Robot Vacuum Cleaner S10 · Robot Vacuum Cleaner S20 · Robot Vacuum Cleaner S30 · Robot Vacuum Cleaner K11+ · Robot Vacuum Cleaner K11 Plus Pro · Robot Vacuum Cleaner K20 Plus Pro |
| Sensors (read-only) | Meter · MeterPlus · WoIOSensor · MeterPro · MeterPro(CO2) · WeatherStation · Motion Sensor · Presence Sensor · Contact Sensor · Water Detector · Wallet Finder Card |
| Hubs (read-only) | Hub · Hub Plus · Hub Mini · Hub 2 · Hub 3 · Hub 4 · AI Hub |
| Cameras | Indoor Cam · Pan/Tilt Cam · Pan/Tilt Cam 2K · Pan/Tilt Cam Plus 2K · Pan/Tilt Cam Plus 3K · Outdoor Spotlight Cam · Outdoor Pan/Tilt Cam 3K (status only) · Solar Pan/Tilt Cam 2K |
| Other | Bot · AI Art Frame · AI Art Frame 2 (also discoverable as AI Art Frame Luma) · AI MindClip · Kata Friends · Home Climate Panel · Remote |
| IR virtual remotes (via Hub) | Air Conditioner · TV · Streamer · Set Top Box · DVD · Speaker · Fan · Light · Others |
Device contract notes
OpenAPI changes in CLI 3.11.0: