greentic-redbutton
greentic-redbutton is a Rust CLI for listening to a matching HID button device and posting redbutton.click webhook events. The current implementation covers the CLI, config resolution, HID-based device enumeration/connection, reconnecting runtime, webhook delivery, embedded i18n, and CI/release automation.
The HID backend is the first implementation slice of .codex/PR-01.md. It is aimed at keyboard-style HID devices and defaults to Greentic's target VID/PID plus the enter key.
Development
Run the local CI wrapper from the repo root:
The CLI currently exposes:
Supported config flags:
Matching environment variables:
Default values:
vendor_id = 32904
product_id = 21
key = enter
webhook_url = http://127.0.0.1:8080/events/webhook
timeout_ms = 5000
i18n
The crate embeds locale JSON files from i18n/ at build time. Runtime locale selection uses this precedence:
--locale <tag>LC_ALL,LC_MESSAGES,LANG- OS locale via
sys-locale en
Manage locale files with:
tools/i18n.sh is prepared for the Greentic translator flow, uses all supported locales from i18n/locales.json, and caps translation batches at 200 translations per batch.
CI and Releases
ci/local_check.sh is the single developer entrypoint. It runs formatting, clippy, tests, build, docs, i18n validation, and crates.io packaging checks for every publishable crate in the workspace.
Local validation:
Release flow:
- Bump
versioninCargo.toml. - Commit the change.
- Create and push a matching git tag:
vX.Y.Z. - GitHub Actions runs
.github/workflows/publish.yml.
publish.yml verifies that the tag matches Cargo.toml, reruns ci/local_check.sh, performs crates.io dry-runs, publishes to crates.io, and builds cargo-binstall archives for these targets:
- Windows
x86_64 - Windows
aarch64 - Linux
x86_64 - Linux
aarch64 - macOS 15
x86_64 - macOS 15
aarch64
Required GitHub secret:
CARGO_REGISTRY_TOKEN