grom

release upstream license

Note

This is a fork of qf-studio/grom. It tracks upstream and adds features that are proposed upstream but not merged yet. Once they land upstream, prefer the official release.

Feature Upstream status
Prometheus auth (bearer / basic), custom CA, extra headers incl. X-Scope-OrgID tenants — see Authentication, TLS and tenants PR qf-studio/grom#3
Named profiles (--profile) for several Prometheus backends planned, issue qf-studio/grom#2

Fork releases are versioned vX.Y.Z-fork.N and published on this fork's releases page. Bugs in the fork-only features: open an issue here. Everything else: upstream.

btop-style terminal dashboards for Prometheus & Grafana.

grom renders Prometheus metrics as polished terminal dashboards — braille charts, gradient meters, threshold-colored stats. Point it at your existing Grafana dashboard JSON and get the same layout in your terminal.

grom demo

Status: early release, under active development.

Why

  • grafterm — the only Grafana-ish TUI — 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. grom does.

Install

This fork (Linux / macOS, amd64 + arm64 — prebuilt binaries on the fork releases page):

# prebuilt binary, e.g. linux/amd64:
v=0.3.1-fork.1
curl -fsSLO https://github.com/Panahifarah/grom/releases/download/v$v/grom_${v}_linux_amd64.tar.gz
curl -fsSLO https://github.com/Panahifarah/grom/releases/download/v$v/checksums.txt
sha256sum --ignore-missing -c checksums.txt && tar -xzf grom_${v}_linux_amd64.tar.gz grom
install -m 0755 grom ~/.local/bin/grom

From source (the module path stays github.com/qf-studio/grom so the fork can keep merging upstream, which means go install github.com/Panahifarah/... does not work — clone instead):

git clone https://github.com/Panahifarah/grom && cd grom
make build && install -m 0755 bin/grom ~/.local/bin/grom

Upstream:

brew install --cask qf-studio/tap/grom   # macOS / Linux
go install github.com/qf-studio/grom/cmd/grom@latest

Prebuilt binaries for darwin/linux (amd64 + arm64) on the releases page.

Quick start

# Widget gallery with fake data — no Prometheus needed
grom demo --theme tokyo-night

# Works against ANY Prometheus (only uses `up` + scrape_* metrics)
grom run --config examples/prometheus.yaml --prom http://localhost:9090

# Render your existing Grafana dashboard in the terminal
grom run --grafana-json my-dashboard.json --prom http://localhost:9090

# What maps? Validate an import without running it
grom import my-dashboard.json          # summary + warnings
grom import --check my-dashboard.json  # non-zero exit on any warning (CI)

# One static frame to stdout (snapshots, docs, cron)
grom run -c dashboard.yaml --prom http://localhost:9090 --once

Authentication, TLS and tenants

For a Prometheus behind auth, a private CA or a multi-tenant backend (Mimir, Cortex, Thanos), pass connection options to grom run. Secrets are read from files only — never from flags — and are re-read on every request, so rotated credentials are picked up without a restart.

Flag Effect
--prom-bearer-file PATH Authorization: Bearer <token from file>
--prom-basic-auth-user USER + --prom-basic-auth-password-file PATH HTTP basic auth
--prom-ca-file PATH verify the server with this PEM CA bundle
--prom-header "Name: value" extra header on every request (repeatable)
# Behind an authenticating reverse proxy, internal CA
grom run -c dashboard.yaml --prom https://prometheus.example.com \
  --prom-bearer-file ~/.config/grom/token --prom-ca-file ~/.config/grom/ca.pem

# Multi-tenant backend: select the tenant with X-Scope-OrgID
grom run -c dashboard.yaml --prom https://mimir.example.com/prometheus \
  --prom-header "X-Scope-OrgID: team-a"

Keys

Key Action
hjkl / arrows move focus
enter zoom the focused panel
esc close zoom (or the help overlay)
+ / - widen / narrow the time range (5m → 24h presets)
r refresh now
t cycle theme
? help overlay
q / ctrl-c quit

Dashboards

Native configs are small YAML files. Every widget is one PromQL query (or several) plus presentation:

title: my service
theme: pilot          # pilot | tokyo-night | catppuccin-mocha
refresh: 10s
range: 1h

widgets:
  - type: stat                      # stat | gauge | bargauge | timeseries
    title: error rate
    unit: percentunit               # percent | percentunit | currencyUSD |
    sparkline: true                 #   s | ms | bytes | short | <suffix>
    grid: { x: 0, y: 0, w: 6, h: 4 }   # Grafana-style 24-column placement
    thresholds:                     # color by CURRENT value
      - color: green                #   base (no value)
      - value: 0.01
        color: yellow
      - value: 0.05
        color: red
    queries:
      - expr: sum(rate(errors_total[5m])) / sum(rate(requests_total[5m]))

  - type: timeseries
    title: requests / s
    stacked: true
    grid: { x: 6, y: 0, w: 18, h: 8 }
    queries:
      - expr: sum by (code) (rate(requests_total[5m]))
        legend: "{{code}}"          # Grafana-style label templates

Notes:

  • grid is optional — omit it everywhere and grom auto-flows widgets into rows with responsive breakpoints (1 column < 80 cols, 2 < 140, 4 beyond).
  • timeseries always query a range (step auto-sized to the chart width); stat joins in with sparkline: true (value + trend band); gauges and bar gauges stay instant. instant: true on a query opts out of ranges.
  • Threshold colors are semantic (green, yellow, red, blue, text, gray — resolved per theme) or raw hex.
  • A failing query marks only its own panel — the rest of the grid stays live.

Working examples: examples/prometheus.yaml (runs against any Prometheus) and examples/pilot.yaml.

Grafana import

grom run --grafana-json / grom import accept a dashboard JSON export — bare or API-wrapped ({"dashboard": {...}}).

Grafana grom
stat, gauge, bargauge, timeseries panels 1:1 widgets
gridPos 24-column layout, scaled to your terminal
fieldConfig unit / decimals / min / max / thresholds honored
stat graphMode area → sparkline, none → number only
custom stacking stacked chart
targets[].expr / legendFormat / instant queries
time.from: now-<dur>, refresh initial range & poll interval
rows dropped; children promoted in place
anything else placeholder panel in its grid slot + a warning

Terminal notes

  • Color: 24-bit when your terminal advertises it, degrading to ANSI-256/16 otherwise. Piped output is colorless by default (CLICOLOR_FORCE=1 forces the ANSI fallback — for faithful captures use a PTY).
  • Braille: charts use braille dots (2×4 per cell). If your font lacks coverage, --ascii switches to solid block characters.

Development

make build   # build ./bin/grom
make demo    # render the widget gallery
make test    # go test -race
make lint    # golangci-lint

Releases are tag-driven: make release V=x.y.z pushes the tag and CI (goreleaser) publishes binaries + the Homebrew cask. The README GIF regenerates with vhs docs/demo.tape (point it at any live Prometheus).

Roadmap

  • Prometheus auth (basic / bearer / TLS)
  • Per-breakpoint restacking of imported layouts; 2-D canvas for staircase grids
  • Config-free explore mode (metric browser, ad-hoc queries)

License

MIT © QF Studio

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%