| Crates.io | swbcli |
| lib.rs | swbcli |
| version | 0.1.0 |
| created_at | 2025-04-22 09:28:22.812966+00 |
| updated_at | 2025-04-22 09:28:22.812966+00 |
| description | A simple CLI tool for SwitchBot (v1.1) |
| homepage | |
| repository | https://github.com/exyrias/swbcli.git |
| max_upload_size | |
| id | 1643750 |
| size | 55,986 |
A simple CLI tool for interacting with the SwitchBot API. This tool allows you to list devices, check device statuses, and send commands to devices.
This project is written in Rust and can be installed using cargo.
Run the following commands to install the tool:
cargo install swbcli
This CLI tool interacts with the SwitchBot API to perform various actions such as listing devices, checking device statuses, and sending commands. Results will be returned in JSON format.
swbcli --token|-t <token> --secret|-s <secret> <action> [options]
--token or -t: Your SwitchBot API token (required)--secret or -s: Your SwitchBot API secret (required)<action>: The action to perform (required)
list: List all devicesstatus: Get the status of a specific devicecontrol: Send a command to a specific devicelist: No additional optionsstatus:
--device_id or -i: The ID of the device (required)control:
--device_id or -i: The ID of the device (required)--cmd or -c: The command to send (required)--param or -p: The command parameters in JSON format (required)swbcli -t <TOKEN> -s <SECRET> list
swbcli -t <TOKEN> -s <SECRET> status -i <DEVICE_ID>
# Bot: Turn on the switch
swbcli -t <TOKEN> -s <SECRET> control -i <DEVICE_ID> -c turnOn -p default
For detailed information about commands and parameters, please refer to https://github.com/OpenWonderLabs/SwitchBotAPI.
This project is licensed under the MIT License.