Skip to content

Commit 071addb

Browse files
doublegateclaude
andcommitted
feat: add spectre tui subcommand for launching TUI dashboard v0.4.2
Wire the spectre-tui crate into the CLI binary as a first-class subcommand, enabling users to launch the multi-panel TUI dashboard directly via `spectre tui` (or alias `spectre ui`). Implementation: - New `crates/spectre-cli/src/commands/tui.rs` module with `TuiArgs` struct and `execute()` handler that loads config via `load_config()` and invokes `spectre_tui::run(&config)` to start the async event loop - Added `spectre-tui` as path dependency of `spectre-cli` in Cargo.toml - Registered `Tui` variant (with `ui` visible alias) in `Commands` enum in `commands/mod.rs` with dispatch routing in `execute()` - CLI subcommand count: 12 -> 13, test count: 43 -> 44, file count: 17 -> 18 Documentation updates: - README.md: Updated TUI launch syntax (`spectre --tui` -> `spectre tui`), interface modes diagram, project structure tree, subcommand/test/file counts, version badge and footer (0.4.1 -> 0.4.2) - CHANGELOG.md: Added [0.4.2] entry with full technical details - CLAUDE.md: Updated CLI file/test/subcommand counts, added tui to commands ref - Cargo.toml: Workspace version 0.4.1 -> 0.4.2 All quality gates pass: 44 CLI tests, zero clippy warnings, cargo fmt clean. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 0ea8e65 commit 071addb

File tree

8 files changed

+112
-25
lines changed

8 files changed

+112
-25
lines changed

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- GUI application with Tauri 2.0 — Phase 5
1212
- MCP server implementation — Phase 6
1313

14+
## [0.4.2] - 2026-02-04
15+
16+
### Added
17+
18+
#### TUI Subcommand — CLI-to-TUI Integration
19+
20+
- **`spectre tui` subcommand** (`crates/spectre-cli/src/commands/tui.rs`):
21+
- New CLI entry point to launch the SPECTRE TUI dashboard directly from the CLI binary
22+
- Loads SPECTRE configuration via standard `load_config()` pipeline (file discovery, env vars, CLI override)
23+
- Invokes `spectre_tui::run()` to start the async event loop with terminal initialization
24+
- Visible alias `ui` for convenience (`spectre ui`)
25+
- Added `spectre-tui` as a dependency of `spectre-cli` for cross-crate integration
26+
27+
### Changed
28+
- CLI subcommand count: 12 → 13 (added `tui`)
29+
- CLI test count: 43 → 44 (added `test_tui_args_default`)
30+
- CLI source file count: 17 → 18 (added `commands/tui.rs`)
31+
- `spectre-cli/Cargo.toml`: Added `spectre-tui` path dependency
32+
- `spectre-cli/src/commands/mod.rs`: Registered `Tui` variant in `Commands` enum with execution routing
33+
34+
### Technical Details
35+
- 119 Rust source files across 5 crates
36+
- 865 tests total: 44 CLI + 538 core unit + 235 TUI + 3 doc-tests + 45 integration
37+
- Zero clippy warnings at all lint levels (standard, pedantic, nursery)
38+
- No new workspace dependencies — uses existing `spectre-tui` workspace member
39+
1440
## [0.4.1] - 2026-02-04
1541

1642
### Changed
@@ -590,7 +616,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
590616

591617
---
592618

593-
[Unreleased]: https://github.com/doublegate/SPECTRE/compare/v0.4.1...HEAD
619+
[Unreleased]: https://github.com/doublegate/SPECTRE/compare/v0.4.2...HEAD
620+
[0.4.2]: https://github.com/doublegate/SPECTRE/compare/v0.4.1...v0.4.2
594621
[0.4.1]: https://github.com/doublegate/SPECTRE/compare/v0.4.0...v0.4.1
595622
[0.4.0]: https://github.com/doublegate/SPECTRE/compare/v0.3.0...v0.4.0
596623
[0.3.0]: https://github.com/doublegate/SPECTRE/compare/v0.2.0...v0.3.0

CLAUDE.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
1919
**Phase 3:** Operation PHANTOM (v0.3.x) - TUI Dashboard **COMPLETE**
2020
**Phase 4:** Operation SPECTER (v0.4.x) - Advanced Features **COMPLETE**
2121

22-
**SPECTRE Tests:** 864 (43 CLI + 538 core + 235 TUI + 3 doc-tests + 45 integration) | **Code:** ~31,000 lines Rust (118 files)
22+
**SPECTRE Tests:** 865 (44 CLI + 538 core + 235 TUI + 3 doc-tests + 45 integration) | **Code:** ~31,000 lines Rust (119 files)
2323

2424
**Repository:** [github.com/doublegate/SPECTRE](https://github.com/doublegate/SPECTRE)
2525

@@ -91,11 +91,11 @@ Target Network → ProRT-IP (Recon) → CyberChef (Analysis) → WRAITH (Exfil/C
9191

9292
```
9393
crates/
94-
├── spectre-cli/ # Unified CLI orchestrator (17 files, 43 tests)
94+
├── spectre-cli/ # Unified CLI orchestrator (18 files, 44 tests)
9595
│ └── src/
9696
│ ├── main.rs # Entry point, CLI parsing with clap 4
97-
│ ├── commands/ # 12 subcommands: scan, chef, send, receive, identity, peer,
98-
│ │ # status, config, completions, campaign, pipeline, plugin
97+
│ ├── commands/ # 13 subcommands: scan, chef, send, receive, identity, peer,
98+
│ │ # status, config, completions, campaign, pipeline, plugin, tui
9999
│ └── output/ # table (comfy-table) and json (serde_json) formatters
100100
├── spectre-core/ # Core orchestration library (81 files, 538 unit + 45 integration tests)
101101
│ ├── src/
@@ -280,6 +280,7 @@ spectre peer <subcommand> # Trusted peer management
280280
spectre status # Component health checks
281281
spectre config <subcommand> # Configuration management
282282
spectre completions <shell> # Shell completion generation
283+
spectre tui # Launch TUI dashboard (alias: ui)
283284

284285
# Orchestration commands (Phase 2)
285286
spectre campaign create <name> # Create a new campaign

Cargo.lock

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ members = [
99
]
1010

1111
[workspace.package]
12-
version = "0.4.1"
12+
version = "0.4.2"
1313
edition = "2021"
1414
rust-version = "1.88"
1515
authors = ["doublegate"]

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A unified offensive security toolkit combining wire-speed secure communications,
1313
<a href="https://github.com/doublegate/SPECTRE"><img src="https://img.shields.io/github/stars/doublegate/SPECTRE?style=flat-square" alt="GitHub Stars"></a>
1414
<a href="https://github.com/doublegate/SPECTRE/fork"><img src="https://img.shields.io/github/forks/doublegate/SPECTRE?style=flat-square" alt="GitHub Forks"></a>
1515
<a href="https://github.com/doublegate/SPECTRE/actions/workflows/ci.yml"><img src="https://github.com/doublegate/SPECTRE/actions/workflows/ci.yml/badge.svg" alt="CI Status"></a>
16-
<a href="https://github.com/doublegate/SPECTRE/releases"><img src="https://img.shields.io/badge/version-0.4.1-blue.svg" alt="Version"></a>
16+
<a href="https://github.com/doublegate/SPECTRE/releases"><img src="https://img.shields.io/badge/version-0.4.2-blue.svg" alt="Version"></a>
1717
<a href="https://www.rust-lang.org/"><img src="https://img.shields.io/badge/rust-1.88%2B-orange.svg" alt="Rust"></a>
1818
<a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-22%2B-green.svg" alt="Node.js"></a>
1919
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT%2FGPLv3%2FApache--2.0-green.svg" alt="License"></a>
@@ -48,8 +48,8 @@ Modern offensive security requires seamless tool integration. SPECTRE eliminates
4848

4949
| Metric | Value |
5050
| ---------------------- | ----------------------------------------------------------------------- |
51-
| **Combined Tests** | 6,941 (SPECTRE: 864 + WRAITH: 2,957 + ProRT-IP: 2,557 + CyberChef: 563) |
52-
| **SPECTRE Codebase** | ~31,000 lines Rust (118 source files across 5 crates) |
51+
| **Combined Tests** | 6,942 (SPECTRE: 865 + WRAITH: 2,957 + ProRT-IP: 2,557 + CyberChef: 563) |
52+
| **SPECTRE Codebase** | ~31,000 lines Rust (119 source files across 5 crates) |
5353
| **Component Code** | ~180,000 (Rust) + ~40,000 (TypeScript/JavaScript) |
5454
| **Languages** | Rust 2024, TypeScript, JavaScript |
5555
| **Network Throughput** | 10+ Gbps (WRAITH), 10M+ pps (ProRT-IP) |
@@ -71,7 +71,7 @@ SPECTRE provides four distinct interaction methods to suit different operational
7171
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
7272
│ │ CLI │ │ TUI │ │ GUI │ │ MCP Server │ │
7373
│ │ spectre │ │ spectre │ │ spectre │ │ spectre-mcp │ │
74-
│ │ cmd │ │ --tui │ │ --gui │ │ │ │
74+
│ │ cmd │ │ tui │ │ --gui │ │ │ │
7575
│ ├──────────┤ ├──────────┤ ├──────────┤ ├──────────────────┤ │
7676
│ │ Scripts │ │ Real- │ │ Visual │ │ AI-Assisted │ │
7777
│ │ Pipelines│ │ time │ │ Campaign │ │ Natural Language │ │
@@ -125,8 +125,8 @@ spectre scan --output json 10.0.0.0/24 | \
125125
**Real-time operational dashboard leveraging ProRT-IP's 60 FPS TUI framework.**
126126

127127
```bash
128-
spectre --tui # Launch full TUI dashboard
129-
spectre scan --tui 192.168.1.0/24 # Scan with live visualization
128+
spectre tui # Launch full TUI dashboard (alias: spectre ui)
129+
spectre scan --tui 192.168.1.0/24 # Scan with live visualization
130130
```
131131

132132
**Dashboard Panels:**
@@ -313,7 +313,7 @@ SPECTRE follows a modular microservices architecture where each component operat
313313

314314
| Layer | Purpose | Technology | Status |
315315
| ----------------------- | ------------------------------------------------ | -------------------------------- | --------------- |
316-
| **CLI Orchestrator** | Unified command interface (12 subcommands) | Rust (clap 4) | **Implemented** |
316+
| **CLI Orchestrator** | Unified command interface (13 subcommands) | Rust (clap 4) | **Implemented** |
317317
| **Core Library** | Config, scanning, comms, analysis, orchestration | Rust (tokio, serde, tracing) | **Implemented** |
318318
| **Target Management** | Priority queue, scope enforcement, async DNS | Rust (ipnetwork, tokio) | **Implemented** |
319319
| **Job Orchestration** | State machine, concurrency control, events | Rust (tokio, broadcast channels) | **Implemented** |
@@ -468,7 +468,7 @@ spectre scan --capture pcap -p 443 10.0.0.0/24 | \
468468
spectre report --format json --output indicators.json
469469

470470
# TUI mode for live analysis
471-
spectre --tui threat-hunt --interface eth0
471+
spectre tui
472472
```
473473

474474
### Security Auditing
@@ -561,7 +561,7 @@ spectre chef "From_Base64" --input encoded.txt
561561
spectre send document.pdf --peer <peer-id> --encrypt
562562

563563
# TUI: Launch dashboard
564-
spectre --tui
564+
spectre tui
565565

566566
# GUI: Launch web interface
567567
spectre --gui
@@ -589,7 +589,7 @@ SPECTRE releases follow an operational codename convention:
589589

590590
### Phase 1: Foundation — Operation BLACKOUT (Complete)
591591

592-
- [x] SPECTRE CLI skeleton with subcommand routing (9 commands, Nmap-compatible flags)
592+
- [x] SPECTRE CLI skeleton with subcommand routing (13 commands, Nmap-compatible flags)
593593
- [x] Component version detection and health checks (`spectre status`)
594594
- [x] Unified configuration management (TOML with file discovery and env var support)
595595
- [x] Structured logging with tracing (RUST_LOG, file output, JSON format)
@@ -666,11 +666,11 @@ SPECTRE/
666666
├── .editorconfig # Editor standards
667667
668668
├── crates/
669-
│ ├── spectre-cli/ # Unified CLI orchestrator (17 files, 43 tests)
669+
│ ├── spectre-cli/ # Unified CLI orchestrator (18 files, 44 tests)
670670
│ │ ├── Cargo.toml
671671
│ │ └── src/
672672
│ │ ├── main.rs # Entry point, CLI parsing
673-
│ │ ├── commands/ # 12 subcommand implementations
673+
│ │ ├── commands/ # 13 subcommand implementations
674674
│ │ │ ├── scan.rs # Network scanning (ProRT-IP)
675675
│ │ │ ├── chef.rs # Data analysis (CyberChef-MCP)
676676
│ │ │ ├── send.rs # Secure send (WRAITH)
@@ -682,7 +682,8 @@ SPECTRE/
682682
│ │ │ ├── completions.rs # Shell completion generation
683683
│ │ │ ├── campaign.rs # Campaign management (7 subcommands)
684684
│ │ │ ├── pipeline.rs # Data pipeline execution (3 subcommands)
685-
│ │ │ └── plugin.rs # Plugin management (3 subcommands)
685+
│ │ │ ├── plugin.rs # Plugin management (3 subcommands)
686+
│ │ │ └── tui.rs # TUI dashboard launcher
686687
│ │ └── output/ # Output formatting
687688
│ │ ├── table.rs # Table output (comfy-table)
688689
│ │ └── json.rs # JSON output (serde_json)
@@ -924,6 +925,6 @@ SPECTRE builds on the shoulders of giants:
924925

925926
**SPECTRE**_Unified Offensive Security_
926927

927-
**Version:** 0.4.1 | **License:** Multi-license | **Language:** Rust + TypeScript | **Status:** Active Development
928+
**Version:** 0.4.2 | **License:** Multi-license | **Language:** Rust + TypeScript | **Status:** Active Development
928929

929930
**Last Updated:** 2026-02-04

crates/spectre-cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ path = "src/main.rs"
1919
# Core library
2020
spectre-core = { path = "../spectre-core" }
2121

22+
# TUI dashboard
23+
spectre-tui = { path = "../spectre-tui" }
24+
2225
# Async runtime
2326
tokio = { workspace = true }
2427

crates/spectre-cli/src/commands/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub mod receive;
2020
pub mod scan;
2121
pub mod send;
2222
pub mod status;
23+
pub mod tui;
2324

2425
/// SPECTRE - Security Platform for Encrypted Comms, Testing, Enumeration, Recon
2526
///
@@ -108,6 +109,10 @@ pub enum Commands {
108109
/// Plugin management (list, run, info)
109110
Plugin(plugin::PluginArgs),
110111

112+
/// Launch the TUI dashboard
113+
#[command(visible_alias = "ui")]
114+
Tui(tui::TuiArgs),
115+
111116
/// Generate shell completions
112117
Completions(completions::CompletionsArgs),
113118
}
@@ -140,6 +145,7 @@ pub async fn execute(cli: Cli) -> Result<()> {
140145
Commands::Campaign(args) => campaign::execute(args, cli.config).await,
141146
Commands::Pipeline(args) => pipeline::execute(args, cli.config).await,
142147
Commands::Plugin(args) => plugin::execute(args, cli.config).await,
148+
Commands::Tui(args) => tui::execute(args, cli.config).await,
143149
Commands::Completions(args) => completions::execute(args),
144150
}
145151
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//! TUI dashboard command
2+
//!
3+
//! Launches the SPECTRE terminal user interface with real-time
4+
//! multi-panel dashboard for scan monitoring, data analysis,
5+
//! secure communications, and campaign management.
6+
7+
use std::path::PathBuf;
8+
9+
use anyhow::{Context, Result};
10+
use clap::Args;
11+
use tracing::{debug, info, instrument};
12+
13+
/// Arguments for the tui command
14+
#[derive(Args, Debug)]
15+
#[command(
16+
about = "Launch the TUI dashboard",
17+
long_about = "Launch the SPECTRE terminal user interface.\n\n\
18+
Provides a real-time, multi-panel dashboard with:\n\
19+
• Recon panel - scan monitoring and results\n\
20+
• Analysis panel - CyberChef data transformation\n\
21+
• Comms panel - WRAITH secure communications\n\
22+
• Campaign panel - operation management\n\n\
23+
Keybindings: Tab/Shift-Tab to switch panels, F1 for help, q to quit."
24+
)]
25+
pub struct TuiArgs;
26+
27+
/// Execute the tui command
28+
#[instrument(skip(config_path))]
29+
pub async fn execute(_args: TuiArgs, config_path: Option<PathBuf>) -> Result<()> {
30+
info!("Launching SPECTRE TUI dashboard");
31+
debug!(?config_path, "Configuration path");
32+
33+
let config = spectre_core::config::load_config(config_path.as_deref())
34+
.context("Failed to load configuration")?;
35+
36+
spectre_tui::run(&config).await
37+
}
38+
39+
#[cfg(test)]
40+
mod tests {
41+
use super::*;
42+
43+
#[test]
44+
fn test_tui_args_default() {
45+
// TuiArgs has no fields, verify it can be constructed
46+
let _args = TuiArgs;
47+
}
48+
}

0 commit comments

Comments
 (0)