11# ONEVOX TUI — Architecture & Implementation
22
3- > Terminal user interface for the Vox speech-to-text engine, built with
3+ > Terminal user interface for the onevox speech-to-text engine, built with
44> [ OpenTUI] ( https://github.com/nicholasgasior/opentui ) and
55> [ Bun] ( https://bun.sh ) .
66
2525
2626## Overview
2727
28- The TUI provides a rich terminal interface for configuring and operating the Vox
28+ The TUI provides a rich terminal interface for configuring and operating the onevox
2929speech-to-text daemon. It is a ** standalone TypeScript application** that runs
3030under Bun and communicates with the Rust backend either by reading/writing config
31- files directly or by shelling out to the compiled ` vox ` binary for runtime
31+ files directly or by shelling out to the compiled ` onevox ` binary for runtime
3232operations (device listing, model management, daemon status).
3333
3434The interface follows a ** flat, light-themed, minimalist design** with no
@@ -45,7 +45,7 @@ background tints, bold section headers, and color contrast.
4545| UI Framework | ` @opentui/core ` — flex-based TUI |
4646| Config Format | TOML (hand-rolled parser, no ext dep) |
4747| History Store | JSON (flat file) |
48- | Backend CLI | ` vox ` Rust binary via ` Bun.spawn() ` |
48+ | Backend CLI | ` onevox ` Rust binary via ` Bun.spawn() ` |
4949| Build | ` bun build --target bun ` |
5050
5151---
6666│ │ ├── stepper.ts # ◀ value ▶ numeric selector
6767│ │ └── toggle.ts # On/Off slide toggle
6868│ ├── data/ # Data access & CLI wrapper
69- │ │ ├── cli.ts # Shells to `vox ` binary, device listing
69+ │ │ ├── cli.ts # Shells to `onevox ` binary, device listing
7070│ │ ├── config.ts # TOML config read/write
7171│ │ └── history.ts # JSON history read/write
7272│ └── panels/ # Full-screen content panels
@@ -214,7 +214,7 @@ Modal confirmation with semi-transparent backdrop:
214214
215215### Config (` data/config.ts ` )
216216
217- - ** Path resolution** : ` %APPDATA%\vox \config.toml ` (Win), ` ~/Library/Application Support/vox /config.toml ` (macOS), ` ~/.config/vox /config.toml ` (Linux)
217+ - ** Path resolution** : ` %APPDATA%\onevox \config.toml ` (Win), ` ~/Library/Application Support/onevox /config.toml ` (macOS), ` ~/.config/onevox /config.toml ` (Linux)
218218- ** Format** : TOML, parsed with a hand-rolled regex parser (no external dependency)
219219- ** Load** : Deep-merges file values over ` DEFAULT_CONFIG ` — missing keys get defaults
220220- ** Save** : Serializes each section as ` [section] ` with ` key = value ` lines
@@ -234,25 +234,25 @@ Modal confirmation with semi-transparent backdrop:
234234
235235### CLI Wrapper (` data/cli.ts ` )
236236
237- Shells out to the compiled ` vox ` binary for operations that require the Rust
237+ Shells out to the compiled ` onevox ` binary for operations that require the Rust
238238runtime (audio device enumeration, model download, daemon status).
239239
240240** Binary resolution** (` voxBin() ` ):
241241
2422421 . Check ` $VOX_BIN ` environment variable
243- 2 . Walk upward from ` import.meta.dir ` looking for ` Cargo.toml ` → use ` target/release/vox ` or ` target/debug/vox `
243+ 2 . Walk upward from ` import.meta.dir ` looking for ` Cargo.toml ` → use ` target/release/onevox ` or ` target/debug/onevox `
2442443 . Walk upward from ` process.cwd() ` as fallback
245- 4 . Fall back to ` "vox " ` on ` $PATH `
245+ 4 . Fall back to ` "onevox " ` on ` $PATH `
246246
247247** Device listing** (` listDevicesWithError() ` ):
248248
249- 1 . Run ` vox devices list` , parse output lines matching ` N. DeviceName (default) - 48000Hz, 2 ch `
249+ 1 . Run ` onevox devices list` , parse output lines matching ` N. DeviceName (default) - 48000Hz, 2 ch `
2502502 . On Windows, if no devices found, fall back to PowerShell ` Get-CimInstance Win32_SoundDevice `
2512513 . Return ` { devices, error } ` so the UI can display errors
252252
253253### History (` data/history.ts ` )
254254
255- - ** Path** : ` %APPDATA%\vox \history.json ` (Win), ` ~/Library/Application Support/vox /history.json ` (macOS), ` ~/.local/share/vox /history.json ` (Linux)
255+ - ** Path** : ` %APPDATA%\onevox \history.json ` (Win), ` ~/Library/Application Support/onevox /history.json ` (macOS), ` ~/.local/share/onevox /history.json ` (Linux)
256256- ** Format** : JSON array of ` HistoryEntry ` objects
257257- Utility functions: ` newestFirst() ` , ` formatTimestamp() ` , ` formatDuration() ` , ` truncateText() `
258258
@@ -401,18 +401,18 @@ when the daemon reloads its config.
401401### 2. CLI Subprocess (` data/cli.ts ` )
402402
403403For runtime operations that require CPAL or other native libraries, the TUI
404- shells out to the compiled ` vox ` binary:
404+ shells out to the compiled ` onevox ` binary:
405405
406406| Operation | Command | Notes |
407407| --------------- | ----------------------- | ---------------------------------- |
408- | List devices | ` vox devices list` | Parses stdout, Windows PS fallback |
409- | List models | ` vox models downloaded` | Checks which models are on disk |
410- | Download model | ` vox models download X` | Triggers download |
411- | Remove model | ` vox models remove X` | Deletes model files |
412- | Daemon status | ` vox status` | Connection check |
408+ | List devices | ` onevox devices list` | Parses stdout, Windows PS fallback |
409+ | List models | ` onevox models downloaded` | Checks which models are on disk |
410+ | Download model | ` onevox models download X` | Triggers download |
411+ | Remove model | ` onevox models remove X` | Deletes model files |
412+ | Daemon status | ` onevox status` | Connection check |
413413
414414The binary is located by walking up from the TUI's source directory until
415- ` Cargo.toml ` is found, then checking ` target/release/vox ` and ` target/debug/vox ` .
415+ ` Cargo.toml ` is found, then checking ` target/release/onevox ` and ` target/debug/onevox ` .
416416
417417### IPC Protocol (future)
418418
@@ -443,7 +443,7 @@ instead of spawning subprocesses.
443443- [x] Config persistence — TOML read/write, deep-merge with defaults
444444- [x] History persistence — JSON read/write
445445- [x] Help overlay — ` ? ` toggles full keyboard shortcut reference
446- - [x] Device listing — ` vox devices list` with Windows PowerShell fallback
446+ - [x] Device listing — ` onevox devices list` with Windows PowerShell fallback
447447- [x] Binary auto-discovery — walks up to ` Cargo.toml ` for ` target/ ` binaries
448448- [x] Error surfacing — device/binary errors shown in UI, not silently swallowed
449449
@@ -488,7 +488,7 @@ bun build src/index.ts --outdir dist --target bun
488488
489489| Variable | Purpose |
490490| --------- | ------------------------------------------ |
491- | ` VOX_BIN ` | Override path to the ` vox ` binary |
491+ | ` VOX_BIN ` | Override path to the ` onevox ` binary |
492492
493493---
494494
0 commit comments