Skip to content

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
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
query-cli — Connection Form
New PostgreSQL connection
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
drizzle.__drizzle_migrations
pgboss.bam
pgboss.job
pgboss.job_common
pgboss.queue
pgboss.schedule
pgboss.subscription
New query
SELECT * FROM users WHERE active = true
FROM
WHERE
Result
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
Commands
Search by name or description...
↑/↓navigate·enterrun·escclose
Execute the current query
/run
Open the command palette
/commands
Show keyboard shortcuts
/help
Pick an AI adapter and model
/ai-config
Insert @ai: at the cursor
/ask-ai

Keyboard Shortcuts

Everything is keyboard-driven. Press F1 or Ctrl+H to see the full shortcut reference.

query-cli — Help
Keyboard shortcuts
F5 / Ctrl+RF5 / ⌃RRun query
F9 / Ctrl+PF9 / ⌃PCommand palette
Ctrl+S⌃SSave query
Ctrl+N⌃NNew query
Ctrl+D⌃DDelete query
Ctrl+Y⌃YCopy selection
Ctrl+H / F1⌃H / F1This help
Ctrl+C⌃CQuit
Ask AI
@ai: …Ask AI in the editor
/ask-aiInsert @ai: at the cursor
/ai-configConfigure AI adapter

Slash Commands

Type / in the editor to access quick commands:

CommandDescription
/runExecute the current query
/commandsOpen the command palette
/helpShow keyboard shortcuts
/ai-configConfigure AI adapter
/ask-aiInsert @ai: at cursor
/save-querySave the current query
/new-queryStart a new query
/rename-queryRename the active query
/delete-queryDelete the active query
/switch-querySwitch to another query
/exitDisconnect and return to connection select

Released under the MIT License.