Connection Manager
query-cli makes it easy to manage multiple database connections from a single interface.
Supported Databases
| Driver | Status | Default Port |
|---|---|---|
| PostgreSQL | ✅ | 5432 |
| MySQL | ✅ | 3306 |
| SQLite | ✅ | file path |
Connection Screen
When you launch query-cli, you'll see the connection selection screen:
query-cli — Connection Select
Select a connection
↑/↓navigate·enterconfirm·ctrl+cquit
Production DB
postgres://admin@db.example.com:5432/app
Local Dev
postgres://postgres@localhost:5432/myapp
+ New connection
Create a new database connection
Quit
Exit query-cli
Navigation
↑/↓orj/k— Navigate connectionsEnter— Connect to selectedCtrl+C— Quit
Adding a Connection
Select + New connection to create a new profile:
query-cli — Connection Form
Name:My postgres db▌
Host:localhost
Port:5432
Database:postgres
User:postgres
Password:
tabmove·enternext / connect·escback
PostgreSQL / MySQL Fields
| Field | Description | Default |
|---|---|---|
| Name | Display name for this connection | auto-generated |
| Host | Database server address | localhost |
| Port | Server port | 5432 (PG) / 3306 (MySQL) |
| Database | Database name | — |
| User | Username | postgres (PG) / root (MySQL) |
| Password | Password (optional) | — |
SQLite Fields
| Field | Description |
|---|---|
| Name | Display name |
| Database | Path to .sqlite file |
Field Navigation
Tab— Move between fieldsEnter— Next field / Connect (on last field)Esc— Go back
Saved Connections
Connections are stored in:
~/.config/query-cli/connections.jsonEach saved connection appears on the selection screen for quick reconnection.
Switching Connections
Use /exit in the query editor or press Ctrl+C to return to the connection screen. Your unsaved queries can be preserved (you'll be prompted).