@switchbot/codex-plugin
v0.1.5
Published
SwitchBot Codex plugin — wires Codex to the SwitchBot CLI MCP server (24 tools, zero Node.js dependencies)
Downloads
1,004
Readme
SwitchBot Codex Plugin
Codex plugin for SwitchBot smart-home control through the authoritative
switchbot CLI MCP server.
What it installs
- A Codex skill at
skills/switchbot/SKILL.md - An MCP server definition that runs
switchbot mcp serve --tools all - A best-effort
onInstallhook that runs non-interactive setup when the CLI is present - Legacy helper binaries:
switchbot-codex-authandswitchbot-codex-install
Requirements
- Node.js
>=18 @switchbot/openapi-cli >=3.7.1- Codex with plugin marketplace support
Install
Recommended
npx @switchbot/openapi-cli codex setupswitchbot codex setup installs or upgrades the CLI and Codex plugin packages
if needed, registers the plugin with Codex, prompts for credentials when
needed, then verifies the integration.
Direct Codex install
If you install the plugin from Codex itself, enable plugin hooks for automatic best-effort setup:
[features]
plugin_hooks = trueThe hook never blocks plugin installation. If setup needs credentials or the SwitchBot CLI is missing, finish with:
npx @switchbot/openapi-cli codex setupVerify
Run:
switchbot --version
switchbot doctor
switchbot devices listThen restart Codex and ask:
List my SwitchBot devices and tell me which ones are currently on.
If install succeeds but you are not logged in
This usually means the plugin installed, but the browser auth step did not run or did not complete.
Run:
switchbot-codex-authIf you prefer the CLI directly:
switchbot auth login
switchbot doctorDo not paste your token or secret into Codex chat. The login flow stores credentials in your OS keychain.
Re-login
Use this when switchbot doctor reports auth failures, the token was rotated,
or Codex says credentials exist but are rejected.
switchbot auth logout
switchbot auth login
switchbot doctor
switchbot devices listAfter re-login, restart Codex and retry:
List my SwitchBot devices and tell me which ones are currently on.
Verify End-To-End
For a full release-style verification, run:
switchbot --version
switchbot doctor
switchbot devices listExpected result:
switchbot --versionis3.7.1or newerswitchbot doctorcompletes without credential failuresswitchbot devices listreturns your devices- Codex can answer the device prompt without asking for secrets
Uninstall
Remove the plugin entry:
codex plugin remove switchbot@codex-pluginOlder prerelease installs may have used switchbot@switchbot-skill; removing
that id is harmless if Codex reports it is not installed.
If you installed the npm package globally and also want to remove the helper commands:
npm uninstall -g @switchbot/codex-pluginFull Uninstall
To remove the plugin, local policy files, and stored login state:
codex plugin remove switchbot@codex-plugin
switchbot auth logoutOptional cleanup:
npm uninstall -g @switchbot/codex-plugin
npm uninstall -g @switchbot/openapi-cliKey detail: deleting local files under ~/.switchbot does not automatically
remove credentials from the OS keychain. Use switchbot auth logout when you
want a true logout.
