◆ qcp

Query Companion

AI-powered natural language interface for PostgreSQL. Ask questions about your database in plain English. Get safe, read-only SQL, results, and natural language summaries — all in your terminal.
qcp terminal
$ qcp ask
? What were my top revenue
? generating customers
? last month?
Generated SQL:
SELECT customer_id, SUM(amount)
FROM orders
WHERE date_trunc('month', created_at)
= date_trunc('month', NOW())
GROUP BY customer_id
ORDER BY SUM(amount) DESC
LIMIT 10
Results:
Top customers are Acme Corp, TechStart,
and Global Solutions with a combined
revenue of $245,000 last month.

Installation

Choose your preferred installation method
npm / pnpm / bun
npm install -g qcp
Homebrew (macOS/Linux)
brew tap moduna-ai/qcp && brew install qcp
curl (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/Moduna-AI/qcp/main/scripts/install.sh | sh
PowerShell (Windows)
irm https://raw.githubusercontent.com/Moduna-AI/qcp/main/scripts/install.ps1 | iex

Quick Start Guide

Get up and running in minutes after installation
$ qcp auth
Set up your AI provider (Gemini is free and default)
$ qcp connect
Connect to your PostgreSQL database
$ qcp schema scan
Index your schema locally (data never leaves your machine)
$ qcp ask "What were our top customers last month?"
Ask a question in plain English
$ qcp chat
Start an interactive multi-question session

Built on Three Principles

Safety, trust, and privacy are non-negotiable

Safety

Read-only enforcement at the AST level. INSERT, UPDATE, DELETE, and DDL are rejected before execution. Every query runs in a READ ONLY transaction.

Trust

Every generated SQL query is shown before execution. You always know what qcp intends to run against your database.

Privacy

Telemetry never includes SQL, schema metadata, row data, connection URLs, or credentials.

Supported AI Providers

Use your preferred AI model

Gemini

Default
gemini-3.5-flash

OpenAI

Popular
gpt-5.5

Anthropic

Advanced
claude-opus-4-8

Ollama

Private
Local

Ready to query your database with natural language?

Get started now or contribute on GitHub