Command-Line Interface
The Querri CLI (querri) is a command-line tool for working with Querri from your terminal. It does everything the web app does — upload files, run analyses, manage dashboards, share resources, manage users — and outputs results in a format that’s easy to pipe into other tools or scripts.
What’s a CLI good for?
Section titled “What’s a CLI good for?”A CLI (command-line interface) is a program you run from a terminal by typing commands. You’d use the Querri CLI when you want to:
- Automate Querri — run the same analysis on a schedule, drop a CSV into a project nightly, refresh a dashboard from a cron job.
- Script onboarding — provision users, create access policies, and seed data in one command.
- Stay in the terminal — ask your data a question without switching to the browser.
- Pipe results into other tools — JSON output flows into
jq, spreadsheets, dashboards, alerting systems.
If you’d rather embed Querri in a Python application or build a backend that calls Querri’s API, you probably want the Python SDK — same package, importable as a library.
Installation
Section titled “Installation”Install with pip — the [cli] extra pulls in the dependencies the CLI needs (Typer, Rich, Pillow):
pip install "querri[cli]"Verify the install:
querri --versionIf you only need the Python library — not the command-line tool — install the bare package instead:
pip install querriSee the Python SDK page for library usage.
Upgrading
Section titled “Upgrading”pip install --upgrade "querri[cli]"First-time setup
Section titled “First-time setup”Authenticate
Section titled “Authenticate”The fastest way to log in is browser-based SSO:
querri auth loginThis opens a browser, you complete your normal Querri login, and a refresh token is saved to ~/.querri/tokens.json. The CLI auto-refreshes tokens, so you usually only do this once per machine.
Confirm who you’re logged in as:
querri whoamiUse an API key instead (for scripts and CI)
Section titled “Use an API key instead (for scripts and CI)”For non-interactive environments — CI jobs, cron, automation servers — use an API key. Create one in the Querri web app under Settings → API Keys, then export:
export QUERRI_API_KEY=qk_your_api_keyexport QUERRI_ORG_ID=org_your_org_idThe CLI uses these automatically. The API key takes precedence over a stored login token.
Quick start
Section titled “Quick start”Upload a file, create a project, and ask a question:
querri file upload sales.csvquerri project new "Q3 Sales Analysis"querri project add-source <file_id_from_upload>querri project chat -m "What are the top 5 products by revenue?"The CLI keeps an “active” project once you create or select one, so subsequent commands don’t need a project ID. Switch active projects with querri project select.
Scripting
Section titled “Scripting”For automation, two flags matter:
--json— machine-readable JSON output instead of formatted tables.--no-interactive— never prompt for input; fail fast if something is missing.
Both are global flags and must come before the subcommand:
querri --json --no-interactive file upload data.csv # correctquerri file upload data.csv --json # WRONG — flag in wrong positionPipe JSON into jq to extract IDs:
FILE_ID=$(querri --json --no-interactive file upload data.csv | jq -r .id)PROJECT_ID=$(querri --json --no-interactive project new "Nightly" | jq -r .id)querri --json --no-interactive --project "$PROJECT_ID" project add-source "$FILE_ID"querri --json --no-interactive --project "$PROJECT_ID" project chat -m "Summarize the data"Command reference
Section titled “Command reference”The CLI is self-documenting. Run querri --help for the full list, and querri <command> --help for any subcommand.
Authentication
Section titled “Authentication”querri auth login # browser-based loginquerri auth logout # clear stored tokensquerri whoami # show current user, org, and hostProjects
Section titled “Projects”querri project new "Name" # create + auto-selectquerri project list # list projects you have access toquerri project select <name|id> # set the active projectquerri project get [id] # detail view (defaults to active)querri project show [id] # render the analysis step DAGquerri project run [id] --wait # execute the project's pipelinequerri project run-status [id] # check execution statusquerri project add-source <file_id> # attach an uploaded file to a projectquerri project delete <id> # delete a projectquerri file upload data.csv # upload a single filequerri file upload "data/*.csv" # glob uploadquerri file list # list uploaded filesquerri file get <file_id> # detail + column infoquerri file delete <file_id>Supported formats: CSV, Excel (.xlsx/.xls), JSON, Parquet, and others.
Chat — talk to your data
Section titled “Chat — talk to your data”querri project chat -m "Question" # send a message in the active projectquerri project chat -m "..." --new # force a new chat sessionquerri project chat -m "..." --reasoning # include reasoning tracesquerri project chat show # show conversation historyTo manage chats across projects:
querri chat list [project_id]querri chat get [project_id] [chat_id]querri chat new [project_id]querri chat delete [project_id] [chat_id]Sources
Section titled “Sources”A source is a connected dataset — either ingested from an uploaded file or synced from a connector.
querri source list # list all sourcesquerri source get <source_id> # detailquerri source describe <source_id> # schema + row countquerri source data <source_id> # preview rows (paginated)querri source query --source-id ID --sql "SELECT * FROM data LIMIT 10"querri source ask <source_id> "How many rows do we have?"querri source sync <source_id> # trigger a syncquerri source delete <source_id>querri source connectors # list available connector typesIn source query, the source is always exposed as a view named data. Always write FROM data, never the source’s display name.
A view is a named SQL query over your sources. Views can be authored either by writing SQL directly or by describing what you want to an AI agent.
querri view new --prompt "monthly revenue by product line" # AI authors SQLquerri view new --name "Orders" --sql "SELECT * FROM orders" # write SQL directlyquerri view chat <uuid> -m "filter to active customers only" # iterate via chatquerri view listquerri view get <uuid>querri view preview <uuid>querri view run # materialize all viewsquerri view delete <uuid>Dashboards
Section titled “Dashboards”querri dashboard listquerri dashboard new --name "Sales" --project <id>querri dashboard refresh <dashboard_id>querri dashboard delete <dashboard_id>Sharing
Section titled “Sharing”querri share project add <project_id> --user-id <user_id>querri share project list <project_id>querri share project remove <project_id> <user_id>
querri share dashboard add <dashboard_id> --user-id <user_id>querri share source add <source_id> --user-id <user_id>querri share source org <source_id> # share with the entire orgquerri user listquerri user new --email user@example.com --first-name Alice --last-name Smithquerri user update <user_id> --role adminquerri user delete <user_id>Access policies (row-level security)
Section titled “Access policies (row-level security)”querri policy listquerri policy new --name "APAC Only" --source-ids <id> --row-filters '[{"column":"region","values":["APAC"]}]'querri policy assign <policy_id> --user-ids <user_id>querri policy resolve --user-id <user_id> --source-id <source_id>querri policy delete <policy_id>API keys
Section titled “API keys”querri key listquerri key new --name "CI" --scopes "admin:projects:read,admin:projects:write"querri key delete <key_id>Embedded analytics sessions
Section titled “Embedded analytics sessions”For white-label embedding workflows:
querri session new --user-id <user_id> --ttl 3600querri session refresh --token <token>querri session revoke --session-id <session_id>Usage and audit
Section titled “Usage and audit”querri usage org # org-wide usage reportquerri usage user <user_id> # per-user usagequerri audit list # audit log eventsquerri audit list --action "project.create"Environment variables
Section titled “Environment variables”| Variable | Purpose |
|---|---|
QUERRI_API_KEY | API key (preferred for scripting; takes precedence over stored login tokens) |
QUERRI_ORG_ID | Organization ID |
QUERRI_HOST | Server host (default: https://app.querri.com; for local dev: http://localhost) |
QUERRI_PROJECT_ID | Active project override (same as --project) |
QUERRI_CHAT_ID | Active chat override (same as --chat) |
- Add
--helpto anything.querri project --help,querri view chat --help, etc. --quietoutputs IDs only. Useful inside scripts where you want a single value.--verboseprints request details. Helpful when something isn’t working as expected.- Don’t pass
--api-keyon the command line. It can land in shell history. Use theQUERRI_API_KEYenv var instead.
Talking to your data from an AI assistant
Section titled “Talking to your data from an AI assistant”If you’d rather ask Querri questions from inside Claude, ChatGPT, Cursor, or another AI tool — without scripting — use the MCP Server. It exposes the same data through the Model Context Protocol so AI assistants can analyze your data on your behalf.