From e329e567cf7119c1a98ad1808a071b2722da703b Mon Sep 17 00:00:00 2001 From: Faiz Kaysan Hidayat Date: Tue, 13 Oct 2026 19:40:09 +0700 Subject: [PATCH] Push: Add the cmd go --- cmd/nebara-tui/main.go | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 cmd/nebara-tui/main.go diff --git a/cmd/nebara-tui/main.go b/cmd/nebara-tui/main.go new file mode 100644 index 0000000..be2d504 --- /dev/null +++ b/cmd/nebara-tui/main.go @@ -0,0 +1,40 @@ +// Nebara OS TUI — Visual Baseline v0.1 +// Native terminal management interface for the Nebara S3GX Appliance. +// +// Usage: +// +// go run ./cmd/nebara-tui [--mock-state=warning|normal] +package main + +import ( + "flag" + "fmt" + "os" + + "github.com/nebara/nebara-os/internal/app" + "github.com/nebara/nebara-os/internal/mock" +) + +func main() { + stateFlag := flag.String("mock-state", "warning", "Mock state to display: 'warning' or 'normal'") + flag.Parse() + + var s mock.State + switch *stateFlag { + case "normal": + s = mock.NormalState() + case "warning": + s = mock.WarningState() + default: + fmt.Fprintf(os.Stderr, "Unknown mock state %q. Use 'warning' or 'normal'.\n", *stateFlag) + os.Exit(1) + } + + appState := app.NewStateFromMock(s) + application := app.NewApplication(appState) + + if err := application.Run(); err != nil { + fmt.Fprintf(os.Stderr, "fatal: %v\n", err) + os.Exit(1) + } +}