pgplex/pgtui
关于
使用 Go 和 Bubble Tea 编写的简单 PostgreSQL 终端界面
开发工具实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +3
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文[!NOTE] pgplex: The Postgres Toolchain for Humans and Agents - pgconsole · pgschema · pgtui · pgparser
Brought to you by Bytebase, open-source database governance platform.
pgtui

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.
Why pgtui?
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 pgtui. Inspired by lazygit, built for developers who live in the terminal.
Features
Database Navigation
Browse your databases, schemas, and tables with a familiar tree structure. Expand, collapse, and jump around with keyboard shortcuts you already know.

Quick Search
Filter table rows instantly with /. Type your search term and watch results update in real-time — simple, fast, and familiar.

JSONB Viewer
Native JSONB support with formatted display, tree navigation, and ready-to-use query snippets.

Command Palette
Quick access to everything via Ctrl+K. Search commands, jump to tables, or access recent queries — all without leaving the keyboard.

SQL Editor
Write and execute SQL directly. Results appear in tabs, so you can run multiple queries and compare results.

And More...
- 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
Installation
Homebrew (macOS/Linux)
brew install pgplex/pgtui/pgtui
Go Install
go install github.com/pgplex/pgtui/cmd/pgtui@latest
Download Binary
Download the latest release from the Releases page.
Build from Source
git clone https://github.com/pgplex/pgtui.git
cd pgtui
make build
./bin/pgtui
Requirements
- Go 1.24+ (for building from source)
- PostgreSQL 12+ (for connecting)
Quick Start
Launch pgtui
pgtuiConnect 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
von a JSONB cell to open the viewer - Press
Ctrl+Kto open the command palette
- Press
Get help
- Press
?to see all keyboard shortcuts
- Press
Keybindings
Global
| Key | Action |
|---|---|
Ctrl+K |
Open command palette |
Ctrl+E |
Open SQL editor |
Tab |
Switch panels |
? |
Show help |
q |
Quit |
Navigation
| 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 |
Data View
| Key | Action |
|---|---|
/ |
Search and filter rows |
Esc |
Clear search |
v |
Open JSONB viewer (on JSONB cell) |
p |
Toggle preview pane |
s |
Sort by column |
[ / ] |
Previous/Next tab |
SQL Editor
| Key | Action |
|---|---|
Ctrl+S |
Execute query |
Ctrl+O |
Open in external editor |
Esc |
Close editor |
Configuration
pgtui stores configuration in ~/.config/pgtui/:
| File | Purpose |
|---|---|
config.yaml |
UI and behavior settings |
connection_history.yaml |
Recent connections (auto-saved) |
favorites.yaml |
Saved SQL queries |
Example Config (config.yaml)
ui:
theme: "default"
mouse_enabled: true
panel_width_ratio: 25
general:
default_limit: 100
performance:
query_timeout: 30000
Documentation
- User Guide — Complete usage guide
- Roadmap — Planned features
Contributing
Contributions are welcome! Whether it's bug reports, feature requests, or pull requests — all are appreciated.
# Setup
git clone https://github.com/pgplex/pgtui.git
cd pgtui
make deps
# Development
make build # Build binary
make test # Run tests
make lint # Run linter
make fmt # Format code
Please read DEVELOPMENT.md before submitting a PR.
Star History
Acknowledgments
pgtui 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
Sponsor
Bytebase - open source, web-based database DevSecOps platform.
探索相关项目
加载中…
