Features
query-cli packs a powerful set of features into a lightweight terminal application. Here's an overview of everything it can do.
Database Connections
Manage multiple database connections from a single interface. Support for PostgreSQL, MySQL, and SQLite with saved connection profiles.
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
query-cli — Connection Form
Name:My postgres db▌
Host:localhost
Port:5432
Database:postgres
User:postgres
Password:
tabmove·enternext / connect·escback
Query Editor
A full-featured SQL editor inside your terminal with:
- Syntax highlighting for SQL keywords, table names, and columns
- Tabbed queries — work on multiple queries at once
- Auto-save and restore unsaved work
- Slash commands for quick actions
- AI prompts with
@ai:blocks
query-cli — Main Screen
query-cli·docme(postgres)
▶ Run (F5/Ctrl+R)·Ctrl+Ssave·(F9/Ctrl+P)commands·ctrl+cquit
Explorer
DatabaseQueries
▶Search table name...
▶drizzle.__drizzle_migrations
▶pgboss.bam
▶pgboss.job
▶pgboss.job_common
▶pgboss.queue
▶pgboss.schedule
▶pgboss.subscription
SELECT * FROM users WHERE active = true▌
▶FROM
▶WHERE
No results yet.F5 / ctrl+r runs the statement.
Schema Explorer
Browse your database schema without leaving the terminal:
- Table list with pagination
- Expand tables to see columns and indexes
- Schema-aware SQL autocomplete
AI Assistant
Get help writing SQL from leading AI providers:
- Anthropic Claude
- OpenAI GPT
- OpenRouter
- Google Gemini
Type @ai: followed by your request in the editor, press Enter, and watch AI generate SQL for you.
query-cli — AI Assistant
query-cli·myapp(postgres)
▶ Run
New query
@ai: list all active users of this month▌
Result
SELECT * FROM users
WHERE active = true
AND created_at >= DATE_TRUNC('month', NOW())
Command Palette
Access every feature through a searchable command palette (F9 or Ctrl+P).
query-cli — Command Palette
Keyboard Shortcuts
Everything is keyboard-driven. Press F1 or Ctrl+H to see the full shortcut reference.
query-cli — Help
Slash Commands
Type / in the editor to access quick commands:
| Command | Description |
|---|---|
/run | Execute the current query |
/commands | Open the command palette |
/help | Show keyboard shortcuts |
/ai-config | Configure AI adapter |
/ask-ai | Insert @ai: at cursor |
/save-query | Save the current query |
/new-query | Start a new query |
/rename-query | Rename the active query |
/delete-query | Delete the active query |
/switch-query | Switch to another query |
/exit | Disconnect and return to connection select |