@switchbot/openapi-cli
Advanced tools
+10
-2
| { | ||
| "name": "@switchbot/openapi-cli", | ||
| "version": "3.7.1", | ||
| "version": "3.7.2", | ||
| "description": "SwitchBot smart home CLI — control devices, run scenes, stream real-time events, and integrate AI agents via MCP. Full API v1.1 coverage.", | ||
@@ -38,4 +38,9 @@ "keywords": [ | ||
| }, | ||
| "workspaces": [ | ||
| "packages/*" | ||
| ], | ||
| "scripts": { | ||
| "typecheck": "tsc --noEmit", | ||
| "typecheck:workspaces": "npm run typecheck --workspaces --if-present", | ||
| "typecheck:all": "npm run typecheck && npm run typecheck:workspaces", | ||
| "build": "node scripts/build.mjs", | ||
@@ -50,3 +55,6 @@ "dev": "tsx src/index.ts", | ||
| "smoke:pack-install": "node scripts/smoke-pack-install.mjs", | ||
| "smoke:codex-pack-install": "node scripts/smoke-codex-pack-install.mjs", | ||
| "test": "vitest run", | ||
| "test:workspaces": "npm test --workspaces --if-present", | ||
| "test:all": "npm test && npm run test:workspaces", | ||
| "test:watch": "vitest", | ||
@@ -58,3 +66,3 @@ "test:coverage": "vitest run --coverage", | ||
| "verify:release": "node scripts/verify-release.mjs", | ||
| "prepublishOnly": "npm test && npm run build && npm run smoke:pack-install" | ||
| "prepublishOnly": "npm test && npm run build && npm run smoke:pack-install && npm run smoke:codex-pack-install" | ||
| }, | ||
@@ -61,0 +69,0 @@ "dependencies": { |
+46
-1
@@ -48,3 +48,3 @@ # @switchbot/openapi-cli | ||
| - [Features](#features) · [Supported devices](#supported-devices) · [Requirements](#requirements) · [Installation](#installation) | ||
| - [Quick start](#quick-start) | ||
| - [Quick start](#quick-start) · [Codex integration](#codex-integration) | ||
| - [Credentials](#credentials) | ||
@@ -123,2 +123,4 @@ - [Policy](#policy) · [Rules engine](#rules-engine) | ||
| > **Using Codex?** Skip this section and jump to [Codex integration](#codex-integration) — Codex uses a separate plugin package, not the `--skill-path` link below. | ||
| The fast path (credentials + policy + skill link, with rollback on failure): | ||
@@ -172,2 +174,45 @@ | ||
| ## Codex integration | ||
| Use SwitchBot with [OpenAI Codex CLI](https://github.com/openai/codex) to control your smart home devices through natural-language AI conversations. | ||
| ### Quick start — just paste this into Codex | ||
| Not sure how to run commands? Copy the block below and paste it directly into your Codex chat: | ||
| ``` | ||
| Please set up the SwitchBot integration for me by running: | ||
| npx @switchbot/openapi-cli codex setup | ||
| Then restart Codex and confirm it's working. | ||
| ``` | ||
| Codex will run the setup, walk you through signing in, and let you know when it's ready. | ||
| ### For developers | ||
| **Requirements:** [Codex CLI](https://github.com/openai/codex) on `$PATH`, Node.js ≥ 18. | ||
| **One-command bootstrap** (installs CLI + plugin + auth + health check in one shot): | ||
| ```bash | ||
| npx @switchbot/openapi-cli codex setup | ||
| ``` | ||
| **Manual install** (if you prefer explicit control): | ||
| ```bash | ||
| npm install -g @switchbot/openapi-cli @switchbot/codex-plugin | ||
| switchbot install --agent codex # register-only; package must already be installed | ||
| switchbot auth login | ||
| ``` | ||
| **Health check and repair:** | ||
| ```bash | ||
| switchbot codex doctor # 7-check summary; exits 1 on any failure | ||
| switchbot codex repair # re-auth + re-register + re-check | ||
| ``` | ||
| Both `setup` and `repair` accept `--dry-run`, `--json`, `--yes`, and `--profile` / `--config` (global flags). Run `switchbot codex setup --help` for the full flag list. | ||
| ## Credentials | ||
@@ -174,0 +219,0 @@ |
Sorry, the diff of this file is too big to display
2914218
1.1%76173
1.02%933
5.07%