A simple terminal UI for PostgreSQL, written in Go with the Bubble Tea framework.
Features • Installation • Quick Start • Keybindings • Configuration • Docs
Status: Beta — Core features are stable and ready for daily use. See Roadmap for planned features.
If you're anything like me, you love PostgreSQL but hate context-switching between your terminal and a heavy GUI client just to peek at some data. You want something that:
- Stays in your terminal — no Electron, no browser tabs, just your good old terminal
- Respects your muscle memory — Vim-style navigation because your fingers already know the way
- Gets out of your way — connect, browse, filter, done
That's lazypg. Inspired by lazygit, built for developers who live in the terminal.
Browse your databases, schemas, and tables with a familiar tree structure. Expand, collapse, and jump around with keyboard shortcuts you already know.
Filter table rows instantly with /. Type your search term and watch results update in real-time — simple, fast, and familiar.
Native JSONB support with formatted display, tree navigation, and ready-to-use query snippets.
Quick access to everything via Ctrl+K. Search commands, jump to tables, or access recent queries — all without leaving the keyboard.
Write and execute SQL directly. Results appear in tabs, so you can run multiple queries and compare results.
- Query Favorites — Save and organize frequently used queries
- Auto-Discovery — Automatically find local PostgreSQL instances
- Mouse Support — Click, scroll, double-click when you want to
- Connection History — Quick reconnect to recent databases
- Vim Motions —
gg,G,Ctrl+D,Ctrl+U, relative line numbers
brew install rebelice/tap/lazypggo install github.com/rebelice/lazypg@latestDownload the latest release from the Releases page.
git clone https://github.com/rebelice/lazypg.git
cd lazypg
make build
./bin/lazypg- Go 1.24+ (for building from source)
- PostgreSQL 12+ (for connecting)
-
Launch lazypg
lazypg
-
Connect to a database
- Press
cto open the connection dialog - Select a discovered instance or enter connection details manually
- Press
Enterto connect
- Press
-
Navigate your data
- Use
hjklor arrow keys to move around - Press
Enterto expand nodes or select tables - Press
Tabto switch between panels
- Use
-
Search and explore
- Press
/to search and filter rows - Press
jon a JSONB cell to open the viewer - Press
Ctrl+Kto open the command palette
- Press
-
Get help
- Press
?to see all keyboard shortcuts
- Press
| Key | Action |
|---|---|
Ctrl+K |
Open command palette |
Ctrl+E |
Open SQL editor |
Tab |
Switch panels |
? |
Show help |
q |
Quit |
| Key | Action |
|---|---|
h j k l |
Move left/down/up/right |
g / G |
Jump to top/bottom |
Ctrl+D / Ctrl+U |
Page down/up |
Enter |
Select / Expand |
Esc |
Close dialog / Cancel |
| Key | Action |
|---|---|
/ |
Search and filter rows |
Esc |
Clear search |
j |
Open JSONB viewer (on JSONB cell) |
p |
Toggle preview pane |
s |
Sort by column |
[ / ] |
Previous/Next tab |
| Key | Action |
|---|---|
Ctrl+S |
Execute query |
Ctrl+O |
Open in external editor |
Esc |
Close editor |
lazypg stores configuration in ~/.config/lazypg/:
| File | Purpose |
|---|---|
config.yaml |
UI and behavior settings |
connection_history.yaml |
Recent connections (auto-saved) |
favorites.yaml |
Saved SQL queries |
ui:
theme: "default"
mouse_enabled: true
panel_width_ratio: 25
general:
default_limit: 100
performance:
query_timeout: 30000- User Guide — Complete usage guide
- Roadmap — Planned features
Contributions are welcome! Whether it's bug reports, feature requests, or pull requests — all are appreciated.
# Setup
git clone https://github.com/rebelice/lazypg.git
cd lazypg
make deps
# Development
make build # Build binary
make test # Run tests
make lint # Run linter
make fmt # Format codePlease read DEVELOPMENT.md before submitting a PR.
lazypg wouldn't exist without these amazing projects:
- lazygit — The inspiration for this project
- Bubble Tea — The TUI framework
- Lip Gloss — Terminal styling
- pgx — PostgreSQL driver for Go
- Bubblezone — Mouse support
MIT — feel free to use this in your own projects.