For additional context about technologies to be used, project structure, shell commands, and other important information, read the current plan
# Build the daemon binary
go build -o voxctrl ./cmd/voxctrl
# Run all unit tests (pure Go, no hardware needed)
go test ./...
# Full integration test — checks audio devices, whisper binaries, input permissions
bash scripts/test.shSingle Go binary (cmd/voxctrl/main.go) that wires five pipeline stages via Go channels:
Hotkey Listener → Audio Capture → STT (Whisper) → Intent Parser → Command Executor
↓ ↓
whisper-server (HTTP) Session Logger (SQLite)
- Hotkey: evdev (
/dev/input), Ctrl+Alt hardcoded (hold both to activate, release either to stop). No X11/Wayland dependency. - Audio: arecord (ALSA), 16kHz mono WAV to
/tmp/voxctrl_input.wav. - STT: prefers resident
whisper-serveron:8080, falls back towhisper-cli. - Intent: fuzzy Levenshtein match against
config/commands.yaml. - Executor: shell commands via
bash -c, notifies via system tray. - Session log: SQLite at
~/.local/share/voxctrl/sessions.db.
- Linux only. User must be in
inputgroup to read/dev/input/event*. - Build dependency:
libayatana-appindicator-glib-dev(CGO required byfyne.io/systray). - Runtime binaries:
arecord,whisper-server(preferred) orwhisper-cli. - Model default:
/usr/local/share/whisper/ggml-base.en.bin.
| Variable | Default | Purpose |
|---|---|---|
VOXCTRL_DEVICE |
auto-detect | /dev/input/eventX for hotkey |
VOXCTRL_ALSA_DEVICE |
default |
ALSA capture device |
VOXCTRL_MODEL |
/usr/local/share/whisper/ggml-base.en.bin |
Whisper model path |
VOXCTRL_WHISPER_THREADS |
runtime.NumCPU() |
Whisper threads |
VOXCTRL_WHISPER_BEAM |
1 |
Whisper beam size |
VOXCTRL_GPU_LAYERS |
0 |
GPU offload layers |
- Command registry:
config/commands.yamlis hot-reloaded within ~2 seconds. No daemon restart needed. - Hotkey change: edit
handleEventininternal/hotkey/listener.goto change the modifier chord or add a trigger key. - Systemd service:
deploy/voxctrl.serviceis a user unit. Install to~/.config/systemd/user/. - Logs: daemon writes to stdout/stderr and
~/.local/share/voxctrl/voxctrl.log. View live withjournalctl --user -u voxctrl -f. - Binary artifact:
voxctrlbinary is gitignored but often present in the working tree for local testing.
- Unit tests do not require hardware, whisper binaries, or ALSA devices. They test logic in isolation.
internal/hotkeytests simulate kernel events with fakeinputEventstructs.internal/stttests mock HTTP responses and file I/O.internal/sessiontests uset.TempDir()andt.Setenv("HOME", ...)to avoid touching real~/.local/share.scripts/test.shis the only test path that exercises real audio, whisper, and input devices.