Skip to content

Commit c88516e

Browse files
Mana (마나)claude
andcommitted
feat: add scalex dash — multi-cluster Kubernetes TUI dashboard
Implements the core TUI dashboard with: - VSCode-like 4-panel layout (sidebar, tab bar, center, status bar) - NERDTree-style cluster/namespace browser in sidebar - k9s-style resource tables (pods, deployments, services, nodes) - Top view for node resource utilization - Bottom status bar with cluster health (green/yellow/red) indicators - Gruvbox dark theme - Headless mode with JSON output for AI agents - Multi-cluster kubeconfig discovery from _generated/clusters/ - Keyboard navigation (j/k, Tab, Ctrl+N, ?, q) - 635 tests passing (598 existing + 7 new) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 363697b commit c88516e

File tree

12 files changed

+3952
-131
lines changed

12 files changed

+3952
-131
lines changed

scalex-cli/Cargo.lock

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

scalex-cli/Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ rust-version = "1.82"
66
description = "Multi-cluster SDI platform CLI for bare-metal Kubernetes provisioning"
77

88
[dependencies]
9-
clap = { version = "4", features = ["derive"] }
9+
clap = { version = "4", features = ["derive", "env"] }
1010
serde = { version = "1", features = ["derive"] }
1111
serde_json = "1"
1212
serde_yaml = "0.9"
@@ -16,6 +16,13 @@ tabled = "0.17"
1616
dotenvy = "0.15"
1717
chrono = { version = "0.4", features = ["serde"] }
1818

19+
# TUI dashboard (scalex dash)
20+
ratatui = "0.29"
21+
crossterm = "0.28"
22+
kube = { version = "0.98", features = ["client", "runtime", "derive"] }
23+
k8s-openapi = { version = "0.24", features = ["latest"] }
24+
tokio = { version = "1", features = ["full"] }
25+
1926
[dev-dependencies]
2027
tempfile = "3"
2128

scalex-cli/src/commands/dash.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
use clap::Args;
2+
3+
use crate::dash;
4+
5+
#[derive(Args)]
6+
pub struct DashArgs {
7+
/// Run in headless mode (JSON output for AI agents)
8+
#[arg(long)]
9+
pub headless: bool,
10+
11+
/// Directory containing per-cluster kubeconfig files
12+
#[arg(long, env = "SCALEX_KUBECONFIG_DIR")]
13+
pub kubeconfig_dir: Option<std::path::PathBuf>,
14+
15+
/// Filter to a specific cluster name
16+
#[arg(long)]
17+
pub cluster: Option<String>,
18+
19+
/// Filter to a specific namespace
20+
#[arg(long)]
21+
pub namespace: Option<String>,
22+
23+
/// Resource type filter for headless mode (pods, deployments, services, nodes)
24+
#[arg(long)]
25+
pub resource: Option<String>,
26+
27+
/// Data refresh interval in seconds
28+
#[arg(long, default_value = "5")]
29+
pub refresh: u64,
30+
}
31+
32+
pub fn run(args: DashArgs) -> anyhow::Result<()> {
33+
let rt = tokio::runtime::Runtime::new()?;
34+
rt.block_on(dash::run(args))
35+
}

scalex-cli/src/commands/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub mod bootstrap;
22
pub mod cluster;
3+
pub mod dash;
34
pub mod facts;
45
pub mod get;
56
pub mod kernel_tune;

0 commit comments

Comments
 (0)