{"id":43742919,"url":"https://github.com/dlt/pg_glimpse","last_synced_at":"2026-03-03T16:16:16.530Z","repository":{"id":336414778,"uuid":"1149558556","full_name":"dlt/pg_glimpse","owner":"dlt","description":"🐘 Terminal-based PostgreSQL dashboard for monitoring queries, locks, replication, and   performance","archived":false,"fork":false,"pushed_at":"2026-02-13T08:50:57.000Z","size":54102,"stargazers_count":55,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-13T20:04:48.218Z","etag":null,"topics":["cli","monitoring","observability","postgresql","ratatui","rust","tui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dlt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-04T08:53:30.000Z","updated_at":"2026-02-13T19:34:48.000Z","dependencies_parsed_at":"2026-02-13T13:00:01.524Z","dependency_job_id":null,"html_url":"https://github.com/dlt/pg_glimpse","commit_stats":null,"previous_names":["dlt/pg_glimpse"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/dlt/pg_glimpse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt%2Fpg_glimpse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt%2Fpg_glimpse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt%2Fpg_glimpse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt%2Fpg_glimpse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlt","download_url":"https://codeload.github.com/dlt/pg_glimpse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt%2Fpg_glimpse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30050222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T14:38:37.398Z","status":"ssl_error","status_checked_at":"2026-03-03T14:38:06.721Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","monitoring","observability","postgresql","ratatui","rust","tui"],"created_at":"2026-02-05T12:06:06.956Z","updated_at":"2026-03-03T16:16:16.524Z","avatar_url":"https://github.com/dlt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n        ██████╗  ██████╗     ██████╗ ██╗     ██╗███╗   ███╗██████╗ ███████╗███████╗\n        ██╔══██╗██╔════╝    ██╔════╝ ██║     ██║████╗ ████║██╔══██╗██╔════╝██╔════╝\n        ██████╔╝██║  ███╗   ██║  ███╗██║     ██║██╔████╔██║██████╔╝███████╗█████╗\n        ██╔═══╝ ██║   ██║   ██║   ██║██║     ██║██║╚██╔╝██║██╔═══╝ ╚════██║██╔══╝\n        ██║     ╚██████╔╝   ╚██████╔╝███████╗██║██║ ╚═╝ ██║██║     ███████║███████╗\n        ╚═╝      ╚═════╝     ╚═════╝ ╚══════╝╚═╝╚═╝     ╚═╝╚═╝     ╚══════╝╚══════╝\n\n                        Real-time PostgreSQL monitoring in your terminal\n```\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/dlt/pg_glimpse/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/dlt/pg_glimpse/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/dlt/pg_glimpse\"\u003e\u003cimg src=\"https://codecov.io/gh/dlt/pg_glimpse/branch/main/graph/badge.svg\" alt=\"Coverage\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/summary/new_code?id=dlt_pg_glimpse\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=dlt_pg_glimpse\u0026metric=alert_status\" alt=\"Quality Gate\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/summary/new_code?id=dlt_pg_glimpse\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=dlt_pg_glimpse\u0026metric=security_rating\" alt=\"Security\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/pg_glimpse\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/pg_glimpse.svg\" alt=\"Crates.io\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/pg_glimpse\"\u003e\u003cimg src=\"https://img.shields.io/crates/d/pg_glimpse.svg\" alt=\"Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/crates/l/pg_glimpse.svg\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.rust-lang.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/rust-1.74%2B-blue.svg\" alt=\"Rust\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#install\"\u003eInstall\u003c/a\u003e •\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#keyboard-reference\"\u003eKeys\u003c/a\u003e •\n  \u003ca href=\"#recording--replay\"\u003eReplay\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n\u003e **Note:** This project is under active development. You may encounter bugs or unexpected behavior. If you find any issues, please [open an issue](https://github.com/dlt/pg_glimpse/issues).\n\nA blazing-fast TUI for PostgreSQL. Monitor active queries, connections, locks, cache performance, replication lag, vacuum progress, and more — all from your terminal. Built with Rust and [ratatui](https://ratatui.rs).\n\n![pg_glimpse demo](demo-final.gif)\n\n## Install\n\n**Homebrew** (macOS/Linux):\n```bash\nbrew install dlt/tap/pg_glimpse\n```\n\n**Scoop** (Windows):\n```powershell\nscoop bucket add dlt https://github.com/dlt/scoop-bucket\nscoop install pg_glimpse\n```\n\n**Cargo** (any platform with Rust 1.74+):\n```bash\ncargo install pg_glimpse\n```\n\n**Binary**: grab a prebuilt binary from [Releases](https://github.com/dlt/pg_glimpse/releases).\n\n## Features\n\n### Panels\n\n| Key | Panel | What you see |\n|:---:|-------|--------------|\n| — | **Queries** | Active queries with PID, user, state, duration, wait events |\n| `Tab` | **Blocking** | Lock blocking chains — who's waiting on whom |\n| `w` | **Wait Events** | What backends are waiting on |\n| `t` | **Table Stats** | Dead tuples, bloat, sizes, last vacuum |\n| `R` | **Replication** | Streaming replica lag (write/flush/replay) |\n| `v` | **Vacuum** | Live vacuum progress with phase |\n| `x` | **Wraparound** | XID age and wraparound risk |\n| `I` | **Indexes** | Scan counts, tuple reads, sizes |\n| `S` | **Statements** | pg_stat_statements metrics |\n| `A` | **WAL \u0026 I/O** | WAL rate, checkpoints, archiver stats (PG14+) |\n\n### Live Graphs\n\nSparkline graphs tracking:\n- Connections\n- Average query time\n- Cache hit ratio\n- Active queries\n- Lock count\n- TPS (transactions per second)\n- WAL write rate\n\n### Stats Overview\n\nServer version, uptime, database size, connection usage, cache hit ratio, dead tuples, wraparound status, replication lag, checkpoint stats, TPS, WAL rate, blocks read/sec, oldest transaction age, autovacuum workers.\n\n### More\n\n- **Inspect overlay** — press `Enter` to see full query details, index definitions, or statement stats\n- **Fuzzy filter** — press `/` to filter with match highlighting\n- **Clipboard** — press `y` to yank SQL to clipboard\n- **SQL highlighting** — syntax-highlighted queries everywhere\n- **Themes** — Tokyo Night, Dracula, Nord, Solarized, Catppuccin\n- **Recordings browser** — press `L` to browse and replay past sessions\n- **Zen mode** — press `z` to collapse graphs and maximize panel space\n\n## Usage\n\n```bash\n# Connect with parameters\npg_glimpse -H localhost -p 5432 -d mydb -U postgres\n\n# Connection string\npg_glimpse -c \"host=localhost port=5432 dbname=mydb user=postgres\"\n\n# PostgreSQL URI\npg_glimpse -c \"postgresql://user:pass@host:5432/dbname\"\n\n# Use service file (~/.pg_service.conf)\npg_glimpse --service=production\n\n# Custom refresh interval\npg_glimpse -r 1 --history-length 240\n```\n\n### Options\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `--service` | PostgreSQL service name from `~/.pg_service.conf` | — |\n| `-c`, `--connection` | Connection string (overrides service) | — |\n| `-H`, `--host` | PostgreSQL host | `localhost` |\n| `-p`, `--port` | PostgreSQL port | `5432` |\n| `-d`, `--dbname` | Database name | `postgres` |\n| `-U`, `--user` | Database user | `postgres` |\n| `-W`, `--password` | Database password | — |\n| `-r`, `--refresh` | Refresh interval (seconds) | `2` |\n| `--history-length` | Sparkline data points | `120` |\n| `--ssl` | Enable SSL/TLS connection | — |\n| `--ssl-insecure` | SSL without cert verification (RDS/Aurora) | — |\n| `--ssl-cert` | Client certificate file for mutual TLS | — |\n| `--ssl-key` | Client private key file for mutual TLS | — |\n| `--ssl-root-cert` | CA root certificate for server verification | — |\n| `--replay` | Replay a recorded session | — |\n\n### Environment Variables\n\n`PGHOST`, `PGPORT`, `PGDATABASE`, `PGUSER`, `PGPASSWORD`, `PGSERVICE`, `PG_GLIMPSE_CONNECTION`, `PGSSLCERT`, `PGSSLKEY`, `PGSSLROOTCERT`\n\n### PostgreSQL Service File\n\nStore connection parameters in `~/.pg_service.conf` to avoid passing credentials on the command line:\n\n```ini\n[production]\nhost=prod.db.example.com\nport=5432\ndbname=myapp\nuser=readonly\npassword=secretpassword\n\n[staging]\nhost=staging.db.example.com\nport=5432\ndbname=myapp\nuser=app_user\npassword=another_secret\n```\n\nThen connect with:\n```bash\npg_glimpse --service=production\n```\n\nIndividual CLI parameters override service file values if both are provided.\n\n### Client Certificate Authentication (Mutual TLS)\n\nPostgreSQL supports client certificate authentication for enhanced security. To use mutual TLS:\n\n```bash\n# Specify certificate files explicitly\npg_glimpse -H myserver.example.com -d mydb -U user -W password \\\n  --ssl \\\n  --ssl-cert ~/.postgresql/postgresql.crt \\\n  --ssl-key ~/.postgresql/postgresql.key \\\n  --ssl-root-cert ~/.postgresql/root.crt\n\n# Or use environment variables\nexport PGSSLCERT=~/.postgresql/postgresql.crt\nexport PGSSLKEY=~/.postgresql/postgresql.key\nexport PGSSLROOTCERT=~/.postgresql/root.crt\npg_glimpse --ssl -H myserver.example.com -d mydb -U user -W password\n```\n\n**Service file with certificates:**\n```ini\n[secure-prod]\nhost=prod.db.example.com\nport=5432\ndbname=myapp\nuser=app_user\npassword=secretpassword\nsslcert=/path/to/client.crt\nsslkey=/path/to/client.key\nsslrootcert=/path/to/ca.crt\n```\n\n**Default paths:** If certificates exist in `~/.postgresql/` directory, they'll be auto-detected:\n- `~/.postgresql/postgresql.crt` (client certificate)\n- `~/.postgresql/postgresql.key` (client private key)\n- `~/.postgresql/root.crt` (CA certificate)\n\n**Important notes:**\n- Client certificate authentication requires both password AND certificate\n- Private key files should have mode `0600` (readable only by owner)\n- Use `--ssl` for verified TLS or `--ssl-insecure` for self-signed server certificates\n\n## Keyboard Reference\n\n### Global\n\n| Key | Action |\n|-----|--------|\n| `q` / `Ctrl+C` | Quit |\n| `Esc` | Back to Queries / Quit |\n| `p` | Pause / resume |\n| `r` | Force refresh |\n| `?` | Help |\n| `,` | Configuration |\n| `z` | Zen mode (collapse graphs) |\n| `L` | Recordings browser |\n| `y` | Yank to clipboard |\n| `/` | Fuzzy filter |\n\n### Navigation\n\n| Key | Action |\n|-----|--------|\n| `↑` / `k` | Previous row |\n| `↓` / `j` | Next row |\n| `Enter` | Inspect |\n| `s` | Cycle sort column |\n| `b` | Refresh bloat estimates |\n| `X` | Reset pg_stat_statements |\n| `C` | Cancel query (batch if filtered) |\n| `K` | Terminate backend (batch if filtered) |\n\n## Recording \u0026 Replay\n\nEvery live session is automatically recorded to `~/.local/share/pg_glimpse/recordings/` (configurable). This is useful for:\n\n- **Incident investigation** — review what happened during an outage\n- **Sharing with teammates** — send a recording file for async debugging\n- **Post-mortem analysis** — step through events at your own pace\n\n### How it works\n\n- Recordings are saved as JSONL files named `host_port_YYYYMMDD_HHMMSS.jsonl`\n- Each snapshot (every refresh interval) is captured with all panel data\n- Old recordings are automatically cleaned up based on retention setting (default: 1 hour)\n\n### Browse recordings\n\nPress `L` during a live session to open the recordings browser. Navigate with `↑`/`↓`, press `Enter` to replay, or `d` to delete a recording.\n\n### Replay a session\n\nFrom the browser, or via command line:\n\n```bash\npg_glimpse --replay ~/.local/share/pg_glimpse/recordings/localhost_5432_20260205_143022.jsonl\n```\n\nRecordings auto-play when opened. All panels, sorting, filtering, and inspection work identically in replay mode. Actions that modify the database (Cancel/Kill) are disabled. Press `q` to exit replay and return to live monitoring.\n\n### Replay controls\n\n| Key | Action |\n|-----|--------|\n| `Space` | Play / pause |\n| `←` / `h` | Step back one snapshot |\n| `→` / `l` | Step forward one snapshot |\n| `\u003c` / `\u003e` | Adjust playback speed (0.25x – 8x) |\n| `g` / `G` | Jump to start / end |\n\n## Configuration\n\nPress `,` to open settings. Saved to `~/.config/pg_glimpse/config.toml`.\n\n| Setting | Options |\n|---------|---------|\n| Graph Marker | Braille / HalfBlock / Block |\n| Color Theme | Tokyo Night / Dracula / Nord / Solarized / Catppuccin |\n| Refresh Interval | 1–60s |\n| Warn Duration | 0.1s+ |\n| Danger Duration | warn threshold – 300s |\n| Recording Retention | 10m – 24h |\n| Recordings Dir | Custom path (default: `~/.local/share/pg_glimpse/recordings/`) |\n\n## Extension Support\n\nAutomatically detects and integrates with:\n- **pg_stat_statements** — query-level stats (powers the Statements panel)\n\nDetected (shown as indicators in stats panel):\n- **pg_buffercache** — buffer cache inspection\n- **pg_stat_kcache** — OS-level CPU/disk stats\n- **pg_wait_sampling** — wait event profiling\n\n## Troubleshooting\n\n**Password with special characters**\n\nIf your password contains special characters (`!`, `$`, `\"`, etc.), the shell may interpret them before pg_glimpse receives them. Use the `PGPASSWORD` environment variable with single quotes:\n\n```bash\nPGPASSWORD='my!pass$word' pg_glimpse -H myhost -d mydb -U myuser\n```\n\n**SSL connection to RDS/Aurora**\n\nCloud-hosted PostgreSQL typically requires SSL but uses certificates not in your system trust store. Use `--ssl-insecure`:\n\n```bash\npg_glimpse --ssl-insecure -H myinstance.rds.amazonaws.com -d mydb -U myuser\n```\n\n## FAQ\n\n**Did you build it or did Claude?**\n\nYes.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlt%2Fpg_glimpse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlt%2Fpg_glimpse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlt%2Fpg_glimpse/lists"}