@switchbot/openapi-cli 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -252,6 +252,34 @@ Generic parameter shapes (which one applies is decided by the device — see the
252
252
 
253
253
  For the complete per-device command reference, see the [SwitchBot API docs](https://github.com/OpenWonderLabs/SwitchBotAPI#send-device-control-commands).
254
254
 
255
+ #### `devices expand` — named flags for packed parameters
256
+
257
+ Some commands require a packed string like `"26,2,2,on"`. `devices expand` builds it from readable flags:
258
+
259
+ ```bash
260
+ # Air Conditioner — setAll
261
+ switchbot devices expand <acId> setAll --temp 26 --mode cool --fan low --power on
262
+
263
+ # Curtain / Roller Shade — setPosition
264
+ switchbot devices expand <curtainId> setPosition --position 50 --mode silent
265
+
266
+ # Blind Tilt — setPosition
267
+ switchbot devices expand <blindId> setPosition --direction up --angle 50
268
+
269
+ # Relay Switch — setMode
270
+ switchbot devices expand <relayId> setMode --channel 1 --mode edge
271
+ ```
272
+
273
+ Run `switchbot devices expand <id> <command> --help` to see the available flags for any device command.
274
+
275
+ #### `devices explain` — plain-language command description
276
+
277
+ ```bash
278
+ switchbot devices explain <deviceId> <command> # e.g. "explain ABC123 setAll"
279
+ ```
280
+
281
+ Returns a human-readable description of what the command does and what each parameter means.
282
+
255
283
  ### `scenes` — run manual scenes
256
284
 
257
285
  ```bash
@@ -327,7 +355,7 @@ Output is a stream of JSON status objects (with `--json`) or a refreshed table.
327
355
  switchbot mcp serve
328
356
  ```
329
357
 
330
- Exposes 7 MCP tools: `list_devices`, `describe_device`, `get_device_status`, `send_command`, `list_scenes`, `run_scene`, `search_catalog`.
358
+ Exposes 8 MCP tools (`list_devices`, `describe_device`, `get_device_status`, `send_command`, `list_scenes`, `run_scene`, `search_catalog`, `account_overview`) plus a `switchbot://events` resource for real-time shadow updates.
331
359
  See [`docs/agent-guide.md`](./docs/agent-guide.md) for the full tool reference and safety rules (destructive-command guard).
332
360
 
333
361
  ### `cache` — inspect and clear local cache
@@ -25,6 +25,7 @@ const MCP_TOOLS = [
25
25
  'list_scenes',
26
26
  'run_scene',
27
27
  'search_catalog',
28
+ 'account_overview',
28
29
  ];
29
30
  export function registerCapabilitiesCommand(program) {
30
31
  program
@@ -65,6 +66,7 @@ export function registerCapabilitiesCommand(program) {
65
66
  entry: 'mcp serve',
66
67
  protocol: 'stdio (default) or --port <n> for HTTP',
67
68
  tools: MCP_TOOLS,
69
+ resources: ['switchbot://events'],
68
70
  },
69
71
  plan: {
70
72
  schemaCmd: 'plan schema',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@switchbot/openapi-cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Command-line interface for SwitchBot API v1.1",
5
5
  "keywords": [
6
6
  "switchbot",