Skip to content

Connection Manager

query-cli makes it easy to manage multiple database connections from a single interface.

Supported Databases

DriverStatusDefault Port
PostgreSQL5432
MySQL3306
SQLitefile path

Connection Screen

When you launch query-cli, you'll see the connection selection screen:

query-cli — Connection Select
query-cli
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
  • ↑/↓ or j/k — Navigate connections
  • Enter — Connect to selected
  • Ctrl+C — Quit

Adding a Connection

Select + New connection to create a new profile:

query-cli — Connection Form
New PostgreSQL connection
Name:My postgres db
Host:localhost
Port:5432
Database:postgres
User:postgres
Password:
tabmove·enternext / connect·escback

PostgreSQL / MySQL Fields

FieldDescriptionDefault
NameDisplay name for this connectionauto-generated
HostDatabase server addresslocalhost
PortServer port5432 (PG) / 3306 (MySQL)
DatabaseDatabase name
UserUsernamepostgres (PG) / root (MySQL)
PasswordPassword (optional)

SQLite Fields

FieldDescription
NameDisplay name
DatabasePath to .sqlite file

Field Navigation

  • Tab — Move between fields
  • Enter — Next field / Connect (on last field)
  • Esc — Go back

Saved Connections

Connections are stored in:

~/.config/query-cli/connections.json

Each 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).

Released under the MIT License.