CLI
Query rawquery from your terminal. Single binary, zero dependencies.
Installation
Shell installer (recommended)
curl -sSL rawquery.dev/install.sh | shcurl -sSL rawquery.dev/install.sh | shDirect download
# macOS (Apple Silicon)curl -L https://dl.rawquery.dev/cli/latest/rq-darwin-arm64 -o rqchmod +x rq && mv rq /usr/local/bin/
# macOS (Intel)curl -L https://dl.rawquery.dev/cli/latest/rq-darwin-amd64 -o rqchmod +x rq && mv rq /usr/local/bin/
# Linuxcurl -L https://dl.rawquery.dev/cli/latest/rq-linux-amd64 -o rqchmod +x rq && mv rq /usr/local/bin/# macOS (Apple Silicon)curl -L https://dl.rawquery.dev/cli/latest/rq-darwin-arm64 -o rqchmod +x rq && mv rq /usr/local/bin/
# macOS (Intel)curl -L https://dl.rawquery.dev/cli/latest/rq-darwin-amd64 -o rqchmod +x rq && mv rq /usr/local/bin/
# Linuxcurl -L https://dl.rawquery.dev/cli/latest/rq-linux-amd64 -o rqchmod +x rq && mv rq /usr/local/bin/Verify the install: rq version
Quick start
New user? Sign up, list tables, run your first query:
# 1. Create an account (interactive prompts)rq signup
# 2. See what data is availablerq tables
# 3. Query itrq query "SELECT 1"# 1. Create an account (interactive prompts)rq signup
# 2. See what data is availablerq tables
# 3. Query itrq 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.
$ rq signupEmail: alice@example.comPassword: ********Confirm: ********
Creating account... doneLogging in... doneCreating workspace 'alice'... done
You're all set! Try: rq query "SELECT 1"$ rq signupEmail: alice@example.comPassword: ********Confirm: ********
Creating account... doneLogging in... doneCreating 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.
# Interactive (opens browser)rq login
# Token-based (CI/scripts)rq login --token rq_xxx
# Clear credentialsrq logout# Interactive (opens browser)rq login
# Token-based (CI/scripts)rq login --token rq_xxx
# Clear credentialsrq logoutToken is saved to ~/.rawquery/config.json.
Workspace is auto-selected (or auto-created if none exists).
Running queries
# Table output (default)rq query "SELECT * FROM my_stripe.customers LIMIT 5"
# JSON outputrq query -f json "SELECT count(*) FROM events"
# CSV output (pipe to file)rq query -f csv "SELECT * FROM my_stripe.customers" > customers.csv# Table output (default)rq query "SELECT * FROM my_stripe.customers LIMIT 5"
# JSON outputrq query -f json "SELECT count(*) FROM events"
# CSV output (pipe to file)rq query -f csv "SELECT * FROM my_stripe.customers" > customers.csvOutput formats
Table (default) - human-readable ASCII table:
┌─────────────┬─────────────────────┬────────┐│ id │ email │ name │├─────────────┼─────────────────────┼────────┤│ cus_abc123 │ alice@example.com │ Alice ││ cus_def456 │ bob@example.com │ Bob │└─────────────┴─────────────────────┴────────┘2 rows (45ms)┌─────────────┬─────────────────────┬────────┐│ id │ email │ name │├─────────────┼─────────────────────┼────────┤│ cus_abc123 │ alice@example.com │ Alice ││ cus_def456 │ bob@example.com │ Bob │└─────────────┴─────────────────────┴────────┘2 rows (45ms)JSON - machine-readable, one object:
{"columns":["id","email","name"],"rows":[["cus_abc123","alice@example.com","Alice"]]}{"columns":["id","email","name"],"rows":[["cus_abc123","alice@example.com","Alice"]]}CSV - for piping to files or other tools:
id,email,namecus_abc123,alice@example.com,Alicecus_def456,bob@example.com,Bobid,email,namecus_abc123,alice@example.com,Alicecus_def456,bob@example.com,BobTables
# List all tablesrq tables
# Show schema and columns for a tablerq tables describe my_stripe.customers# List all tablesrq tables
# Show schema and columns for a tablerq tables describe my_stripe.customersrq tables describe shows columns, types, row count, and size:
$ rq tables describe my_stripe.customersTable: my_stripe.customers (2,847 rows, 1.2 MB)
┌──────────────┬───────────┐│ COLUMN │ TYPE │├──────────────┼───────────┤│ id │ varchar ││ email │ varchar ││ name │ varchar ││ created_at │ timestamp │└──────────────┴───────────┘4 columns$ rq tables describe my_stripe.customersTable: my_stripe.customers (2,847 rows, 1.2 MB)
┌──────────────┬───────────┐│ COLUMN │ TYPE │├──────────────┼───────────┤│ id │ varchar ││ email │ varchar ││ name │ varchar ││ created_at │ timestamp │└──────────────┴───────────┘4 columnsConnections
# List all connectionsrq connections
# Trigger a syncrq connections sync my-stripe# List all connectionsrq connections
# Trigger a syncrq connections sync my-stripeConfiguration
Configuration is stored in ~/.rawquery/config.json:
{ "endpoint": "https://api.rawquery.dev", "token": "rq_xxx...", "workspace": "alice", "default_format": "table"}{ "endpoint": "https://api.rawquery.dev", "token": "rq_xxx...", "workspace": "alice", "default_format": "table"}rq config # Show current configrq config set endpoint <url> # Set API endpoint (self-hosted)rq config set workspace <slug> # Set default workspacerq config set format <format> # Set default output formatrq config # Show current configrq config set endpoint <url> # Set API endpoint (self-hosted)rq config set workspace <slug> # Set default workspacerq config set format <format> # Set default output format| Key | Description | Default |
|---|---|---|
endpoint | API base URL | https://api.rawquery.dev |
token | API token (set by rq login or rq signup) | - |
workspace | Default workspace ID | - |
default_format | Output format (table, json, csv) | table |
Error handling
Errors are clear and actionable.
$ 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 connectionsError: Not logged in. Run 'rq login' first.$ 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 connectionsError: Not logged in. Run 'rq login' first.CI/CD usage
For automated pipelines, pass the token directly. No browser flow needed.
# 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# 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.csvNeed help? Email us at hello@rawquery.dev.