No credit cardStart free

CLI

Query rawquery from your terminal. Single binary, zero dependencies.

Installation

Shell installer (recommended)

bash
curl -sSL rawquery.dev/install.sh | sh

Direct download

bash
# macOS (Apple Silicon)
curl -L https://dl.rawquery.dev/cli/latest/rq-darwin-arm64 -o rq
chmod +x rq && mv rq /usr/local/bin/
# macOS (Intel)
curl -L https://dl.rawquery.dev/cli/latest/rq-darwin-amd64 -o rq
chmod +x rq && mv rq /usr/local/bin/
# Linux
curl -L https://dl.rawquery.dev/cli/latest/rq-linux-amd64 -o rq
chmod +x rq && mv rq /usr/local/bin/

Verify the install: rq version

Quick start

New user? Sign up, list tables, run your first query:

bash
# 1. Create an account (interactive prompts)
rq signup
# 2. See what data is available
rq tables
# 3. Query it
rq query "SELECT 1"

Already have an account? Use rq login instead - it opens your browser.

Authentication

rq signup

Create an account directly from the terminal. Prompts for email and password, creates your account, logs you in, and auto-creates a workspace.

bash
$ rq signup
Email: alice@example.com
Password: ********
Confirm: ********
Creating account... done
Logging in... done
Creating workspace 'alice'... done
You're all set! Try:
rq query "SELECT 1"

rq login

Opens your browser to authenticate. The CLI starts a temporary local server, receives the token via callback, and saves it. For headless environments (SSH), the CLI prints a URL to copy-paste.

bash
# Interactive (opens browser)
rq login
# Token-based (CI/scripts)
rq login --token rq_xxx
# Clear credentials
rq logout

Token is saved to ~/.rawquery/config.json. Workspace is auto-selected (or auto-created if none exists).

Running queries

bash
# Table output (default)
rq query "SELECT * FROM my_stripe.customers LIMIT 5"
# JSON output
rq query -f json "SELECT count(*) FROM events"
# CSV output (pipe to file)
rq query -f csv "SELECT * FROM my_stripe.customers" > customers.csv

Output formats

Table (default) - human-readable ASCII table:

text
┌─────────────┬─────────────────────┬────────┐
│ id │ email │ name │
├─────────────┼─────────────────────┼────────┤
│ cus_abc123 │ alice@example.com │ Alice │
│ cus_def456 │ bob@example.com │ Bob │
└─────────────┴─────────────────────┴────────┘
2 rows (45ms)

JSON - machine-readable, one object:

json
{"columns":["id","email","name"],"rows":[["cus_abc123","alice@example.com","Alice"]]}

CSV - for piping to files or other tools:

csv
id,email,name
cus_abc123,alice@example.com,Alice
cus_def456,bob@example.com,Bob

Tables

bash
# List all tables
rq tables
# Show schema and columns for a table
rq tables describe my_stripe.customers

rq tables describe shows columns, types, row count, and size:

text
$ rq tables describe my_stripe.customers
Table: my_stripe.customers (2,847 rows, 1.2 MB)
┌──────────────┬───────────┐
│ COLUMN │ TYPE │
├──────────────┼───────────┤
│ id │ varchar │
│ email │ varchar │
│ name │ varchar │
│ created_at │ timestamp │
└──────────────┴───────────┘
4 columns

Connections

bash
# List all connections
rq connections
# Trigger a sync
rq connections sync my-stripe

Configuration

Configuration is stored in ~/.rawquery/config.json:

json
{
"endpoint": "https://api.rawquery.dev",
"token": "rq_xxx...",
"workspace": "alice",
"default_format": "table"
}
bash
rq config # Show current config
rq config set endpoint <url> # Set API endpoint (self-hosted)
rq config set workspace <slug> # Set default workspace
rq config set format <format> # Set default output format
KeyDescriptionDefault
endpointAPI base URLhttps://api.rawquery.dev
tokenAPI token (set by rq login or rq signup)-
workspaceDefault workspace ID-
default_formatOutput format (table, json, csv)table

Error handling

Errors are clear and actionable.

text
$ rq query "SELECT * FROM nonexistent"
Error: Table 'nonexistent' not found
$ rq query "SELEC * FROM my_stripe.customers"
Error: Syntax error at line 1: expected SELECT, got SELEC
$ rq connections
Error: Not logged in. Run 'rq login' first.

CI/CD usage

For automated pipelines, pass the token directly. No browser flow needed.

bash
# GitHub Actions example
- name: Install rq
run: curl -sSL rawquery.dev/install.sh | sh
- name: Query data
run: |
rq login --token ${{ secrets.RAWQUERY_TOKEN }}
rq query -f csv "SELECT * FROM my_stripe.customers" > customers.csv

Need help? Email us at hello@rawquery.dev.