MCPcopy Index your code
hub / github.com/a-tal/riz

github.com/a-tal/riz @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
132 symbols 253 edges 11 files 61 documented · 46%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Riz

Rust API (and CLI) for controlling Wiz lights

crate-badge docs-badge min-rust lic-badge

ci-badge downloads-badge docker-badge size-badge

sec-badge dep-badge codecov

UI

Check out Riz UI for an example of integrating a web UI with this API.

Dev

Both dev utilities are designed to be quick to iterate with, but dev.sh is faster.

run.sh

  • Use the separate build & run dockerfiles to start the API with Docker locally

dev.sh

  • Start the API without docker (requires Rust installed)

Config

Env Var Default Description
RIZ_PORT 8080 API listening port
RIZ_STORAGE_PATH . Path to storage (rooms.json must be writable by running UID)
RIZ_CORS_ORIGIN http://localhost:8000 Allowed CORS origin

Docker

Build Arg Default Description
UID 10010 Running UID

By default, RIZ_STORAGE_PATH is configured to /data; which is a VOLUME mount you may use.

The running dockerfiles include a healthcheck configuration.

CLI

To use the CLI; either pull the binary from the build container, or build this project locally with cargo build --release. The CLI will built as target/release/riz. Move that into your $PATH somewhere if you want to use riz anywhere.

$ riz --help
Riz light control CLI

Usage: riz [OPTIONS] [IP]...

Arguments:
  [IP]...  Bulb IPv4 address(es)

Options:
  -b, --brightness <BRIGHTNESS>  Set the bulb brightness (10-100)
  -c, --color <COLOR>            Set the bulb color as r,g,b (0-255)
  -C, --cool <COOL>              Set the cool white value (1-100)
  -W, --warm <WARM>              Set the warm white value (1-100)
  -p, --speed <SPEED>            Set the bulb speed (20-200)
  -t, --temp <TEMP>              Set the bulb temperature in Kelvin (1000-8000)
  -l, --list                     List the available scene IDs
  -s, --scene <SCENE>            Set the scene by ID
  -o, --on                       Turn the bulb on
  -f, --off                      Turn the bulb off
  -r, --reboot                   Reboot the bulb
  -i, --status                   Get the current bulb status
  -h, --help                     Print help
  -V, --version                  Print version

Extension points exported contracts — how you extend this code

FnBox (Interface)
(no doc) [1 implementers]
src/worker.rs

Core symbols most depended-on inside this repo

create
called by 22
src/routes/rooms.rs
read
called by 8
src/models.rs
ip
called by 7
src/models.rs
write
called by 7
src/storage.rs
new_light
called by 7
src/storage.rs
new_room
called by 5
src/storage.rs
set_power
called by 4
src/models.rs
udp_response
called by 4
src/models.rs

Shape

Method 76
Function 28
Class 19
Enum 8
Interface 1

Languages

Rust100%

Modules by API surface

src/models.rs65 symbols
src/storage.rs25 symbols
src/worker.rs15 symbols
src/routes/rooms.rs6 symbols
src/routes/lights.rs6 symbols
src/errors.rs6 symbols
src/bin/riz.rs5 symbols
src/bin/riz-api.rs3 symbols
src/routes/health.rs1 symbols

For agents

$ claude mcp add riz \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact