fbcb245d5958345aa7347d9dc4e8871805e4c890
Phase 4 of the v0.1 MVP. Consolidates layout/fetch/render into internal/app and adds the interactive TUI; cmd/grot/run.go is now thin CLI wiring. - grid.go: Rect + GridLayout (auto-flow, absolute cells, reflow breakpoints <80/80-139/>=140) + focusMove (overlap-gated geometric hjkl). - fetch.go: FetchWidget/useRange/FetchAll moved out of run.go. - render.go: header, grid compositor, StaticFrame, and safeRender (never renders a widget below its MinSize). - model.go: Bubble Tea Model + RunTUI. tick -> batched per-widget fetch Cmds with an in-flight guard so slow queries never block Update or stack; keys for hjkl focus, Enter zoom, +/- range presets, r refresh, t theme, q quit; WindowSizeMsg reflow; vertical scroll; widget-local errors keep the grid intact. - run.go: default launches the TUI; --once renders one static frame. Fix: an aggressive resize could lay a widget out below its chrome, underflowing width math to a negative strings.Repeat count and panicking in TruncateVisual. TruncateVisual/Center/PadOrTruncate now clamp non-positive widths, and safeRender gates widget sizes — "live resize never breaks the grid". Verified: full interactive TUI against live Prometheus (real PTY) renders all widgets and handles all keys without panic; 12 model tests + grid/step tests; go test -race and golangci-lint clean.
grot
btop-style terminal dashboards for Prometheus & Grafana.
grot renders Prometheus metrics as polished terminal dashboards — braille charts, gradient gauges, threshold-colored stats. Point it at your existing Grafana dashboard JSON and get the same layout in your terminal.
Status: pre-release, under active development.
Quick start
# Widget gallery with fake data
grot demo --theme tokyo-night
# Coming soon:
# grot --prom http://localhost:9090 --config dashboard.yaml
# grot --prom http://localhost:9090 --grafana-json my-dashboard.json
Why
- grafterm is abandoned (2019) and limited to termdash's fixed widgets.
- btop proves terminal dashboards can be beautiful — but it only shows system metrics.
- Nothing renders your Grafana dashboards in the terminal. grot does.
Features
- Grafana import — parse dashboard JSON (stat, gauge, bargauge, timeseries panels) into a terminal layout
- Native YAML config — simple dashboard definitions without Grafana
- Themes — pilot, tokyo-night, catppuccin-mocha
- btop-like keys — hjkl focus, zoom, live time-range switching
- Widget-local errors: a broken query never breaks the grid
Development
make build # build ./bin/grot
make demo # render the widget gallery
make test # go test -race
make lint # golangci-lint
License
MIT
Description
btop-style terminal dashboards for Prometheus & Grafana.
10 MiB
0 Stars
1 Watchers
0 Forks
Languages
Go
98.5%
Makefile
1.5%