Aleks Petrov 54750935a2 feat(grafana): import Grafana dashboard JSON with gridPos layout
Phase 5 of the v0.1 MVP — reproduce a Grafana dashboard in the terminal.

- internal/grafana: Import/Convert map a Grafana export (bare or {"dashboard":{}}
  wrapped) to a normalized config.Dashboard + warnings. stat/gauge/bargauge/
  timeseries map 1:1; fieldConfig defaults (unit/decimals/min/max/thresholds),
  stacking, reduceOptions, and targets (expr/legendFormat/instant) carry over;
  time.from now-<dur> -> range, refresh -> refresh. Row panels drop but promote
  their children; unsupported types become a placeholder in their grid slot with
  a warning.
- config: TypePlaceholder (query-less) + exported Dashboard.Normalize so the
  importer runs the loader's validation/defaults.
- widget: Placeholder panel ("unsupported: <type>").
- app/grid: GridLayout now honors 24-col gridPos (scale to termW, group by
  Grafana row) when present, else auto-flows; composeGrid is Y-grouped, X-sorted,
  and gap-aware so tiled dashboards reproduce faithfully.
- cli: run --grafana-json <file>; new `grot import <file> [--check]`.

Verified: `run --grafana-json pilot-dashboard.json --once` @ :9093 reproduces the
Grafana 4x4 layout with correct titles/units/thresholds/charts; synthetic fixture
covers gauge/bargauge/row-promotion/placeholder. Golden tests (real + synthetic +
wrapped + parseNowRange) + gridPos layout test; go test -race and lint clean.
2026-07-07 15:51:33 +02:00

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

S
Description
btop-style terminal dashboards for Prometheus & Grafana.
Readme MIT
10 MiB
0 Stars 1 Watchers 0 Forks
Languages
Go 98.5%
Makefile 1.5%