NYRA — Portable Rust Operations Diagnostic Toolkit
Rust · Clap CLI · Ratatui TUI · Tokio · Serde/TOML · v0.1.0
Links: GitHub Repository
Summary: NYRA is a portable, offline-first System Administrator diagnostic toolkit compiled to a single Rust binary. It combines an interactive Ratatui terminal UI, a script-friendly CLI with deterministic exit codes and JSON output, a typed TOML workflow runner, and an offline command knowledge base — requiring no external backend or AI account.
Development Transparency: Designed from real on-site infrastructure troubleshooting requirements (portable USB / jump-host usage) and built using an AI-assisted development workflow with strict Rust compiler, Clippy, and automated test gates.
1. Three Operational Modes
- Interactive TUI (
nyra): Browse and fuzzy-search diagnostics by intent, edit validated inputs, run asynchronous checks without blocking the UI, and switch between 4 built-in themes (plus custom TOML theme import/export). - Direct CLI (
nyra net tcp <host> <port> --output json): Deterministic stdout JSON (schema_version: 1) and predictable exit codes for shell scripts and automation. - Workflow Runner (
nyra workflow run web-unreachable --target https://example.com): Chains DNS, TCP, TLS, and HTTP checks sequentially through a shared executor, or validates and runs custom TOML workflow files (nyra workflow validate/run-file).
2. Modular Monolith Architecture
All three interfaces execute through a single Tool Registry & Executor so validation, timeouts, cancellation, and redaction behave identically across TUI, CLI, and workflows:
┌───────────────┐ ┌───────────────┐ ┌────────────────────┐
│ Ratatui TUI │ │ Clap CLI │ │ TOML Workflow CLI │
└───────┬───────┘ └───────┬───────┘ └─────────┬──────────┘
└───────────────────┼─────────────────────┘
▼
Core Tool Registry & Shared Executor
(typed input validation, bounded timeouts,
cancellation tokens, privacy redaction)
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
12 Built-in Tools Offline Knowledge Sanitized Reports
(net/web/tls/sys/ (read-only command (JSON / HTML / CSV
file diagnostics) reference cards) redacted, ≤64 KiB)Deterministic Exit Code Contract
| Exit Code | Meaning |
|---|---|
0 | Completed with a positive diagnostic finding (e.g., open TCP port, healthy HTTP 2xx) |
1 | Completed with a negative finding (e.g., connection refused, no DNS answer, non-2xx) |
2 | Invalid command or input validation error |
3 | Execution or environment error (missing OS dependency, permission failure) |
4 | Run timeout/budget expired before a finding could be reported |
130 | Cancelled by operator |
3. Portability & Security Design
- Read-only by default: Built-in diagnostics and offline knowledge cards never mutate target hosts or auto-execute shell snippets.
- No plaintext secrets: Portable workspace mode (
portable.flagbeside the binary) stores only non-sensitive config/themes and degrades cleanly on read-only USB media. - Sanitized reporting & logs: Opt-in
--report-json/--report-html/--report-csvfiles redact full targets and observer identity (capped at 64 KiB, never overwriting existing files); structured stderr logs (--log-level) use an explicit allowlist so stdout JSON stays parseable.
4. Verification Status
- Quality Gates:
cargo fmt --all -- --check,cargo clippy --all-targets --locked -- -D warnings, andcargo test --all-targets --lockedpass (131 unit + 37 CLI + 1 workflow example = 169 tests passing, 0 failed). - Cross-Platform CI: GitHub Actions verifies both
ubuntu-latestandwindows-latest(MSVC).