Initial WLED CLI

This commit is contained in:
2026-05-10 21:04:44 +02:00
commit 2291c85f6a
4 changed files with 400 additions and 0 deletions

73
README.md Normal file
View File

@@ -0,0 +1,73 @@
# wled-cli
Tiny no-dependency CLI for talking to a WLED box over its JSON API.
## Features
- turn lights on/off
- set brightness
- set named or hex colors
- target 1-based inclusive LED ranges
- set effects by name or id
- list effects
- list presets
- use presets by name or id
- inspect raw WLED JSON endpoints
## Install
```bash
npm install
npm link
```
Or just run it directly:
```bash
node ./bin/wled.js status
```
## Default target
By default the CLI talks to:
- `http://wled.local`
Override with:
```bash
wled --url http://another-device.local status
```
Or set an env var:
```bash
export WLED_URL=http://another-device.local
```
## Usage
```bash
wled on
wled off
wled status
wled effects
wled effects rainbow
wled presets
wled set --color blue --range 70-80 --brightness 50%
wled set --hex '#00ff88' --effect solid
wled set --preset 1
wled raw /json/info
```
## Notes
- `--range` is **1-based inclusive**. So `70-80` means LEDs 70 through 80.
- `--brightness` accepts `1-255` or a percentage like `50%`.
- `--effect` accepts a numeric id or a fuzzy name match.
- `--preset` accepts a numeric id or a fuzzy preset name match.
- For new integrations, prefer WLED's JSON API docs: https://kno.wled.ge/interfaces/json-api/
## License
MIT