CLI Tool
The dice-rs-cli crate provides a command-line tool (dice-rs) for
interacting with GoDice devices without writing code.
Installation
cargo install dice-rs-cli
Commands
Scan
Scan for nearby GoDice devices:
dice-rs scan 5
The argument is the scan duration in seconds.
Listen
Connect to a dice and print events:
dice-rs listen AA:BB:CC:DD:EE:FF d6
The first argument is the MAC address (or a partial prefix). The second is
the dice type (d6, d20, d10, d10x, d4, d8, d12).
Battery
Query battery level:
dice-rs battery AA:BB:CC:DD:EE:FF
LED Control
Set LED colors:
# Set both LEDs to red
dice-rs led AA:BB:CC:DD:EE:FF set red
# Set each LED independently
dice-rs led AA:BB:CC:DD:EE:FF set-dual red blue
# Pulse animation
dice-rs led AA:BB:CC:DD:EE:FF pulse green
# Turn off
dice-rs led AA:BB:CC:DD:EE:FF off
Tap Interrupts
Enable or disable tap notifications:
dice-rs tap AA:BB:CC:DD:EE:FF true
dice-rs double-tap AA:BB:CC:DD:EE:FF true
Calibration
dice-rs calibrate AA:BB:CC:DD:EE:FF
Status
Get comprehensive status:
dice-rs status AA:BB:CC:DD:EE:FF
Color
Query the dice shell color:
dice-rs color AA:BB:CC:DD:EE:FF
Charging
Query charging state:
dice-rs charging AA:BB:CC:DD:EE:FF
Disconnect
# Disconnect a specific dice
dice-rs disconnect AA:BB:CC:DD:EE:FF
# Disconnect all connected dice
dice-rs disconnect-all
Interactive Mode
Start a REPL for interactive exploration:
dice-rs interactive
Available commands in interactive mode: scan, connect <address>,
disconnect, battery, color, charging, led <color>, status,
calibrate, quit.