Skip to content

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.

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.

Install with pip — the [cli] extra pulls in the dependencies the CLI needs (Typer, Rich, Pillow):

Terminal window
pip install "querri[cli]"

Verify the install:

Terminal window
querri --version

If you only need the Python library — not the command-line tool — install the bare package instead:

Terminal window
pip install querri

See the Python SDK page for library usage.

Terminal window
pip install --upgrade "querri[cli]"

The fastest way to log in is browser-based SSO:

Terminal window
querri auth login

This 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:

Terminal window
querri whoami

Use 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:

Terminal window
export QUERRI_API_KEY=qk_your_api_key
export QUERRI_ORG_ID=org_your_org_id

The CLI uses these automatically. The API key takes precedence over a stored login token.

Upload a file, create a project, and ask a question:

Terminal window
querri file upload sales.csv
querri 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.

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:

Terminal window
querri --json --no-interactive file upload data.csv # correct
querri file upload data.csv --json # WRONG — flag in wrong position

Pipe JSON into jq to extract IDs:

Terminal window
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"

The CLI is self-documenting. Run querri --help for the full list, and querri <command> --help for any subcommand.

Terminal window
querri auth login # browser-based login
querri auth logout # clear stored tokens
querri whoami # show current user, org, and host
Terminal window
querri project new "Name" # create + auto-select
querri project list # list projects you have access to
querri project select <name|id> # set the active project
querri project get [id] # detail view (defaults to active)
querri project show [id] # render the analysis step DAG
querri project run [id] --wait # execute the project's pipeline
querri project run-status [id] # check execution status
querri project add-source <file_id> # attach an uploaded file to a project
querri project delete <id> # delete a project
Terminal window
querri file upload data.csv # upload a single file
querri file upload "data/*.csv" # glob upload
querri file list # list uploaded files
querri file get <file_id> # detail + column info
querri file delete <file_id>

Supported formats: CSV, Excel (.xlsx/.xls), JSON, Parquet, and others.

Terminal window
querri project chat -m "Question" # send a message in the active project
querri project chat -m "..." --new # force a new chat session
querri project chat -m "..." --reasoning # include reasoning traces
querri project chat show # show conversation history

To manage chats across projects:

Terminal window
querri chat list [project_id]
querri chat get [project_id] [chat_id]
querri chat new [project_id]
querri chat delete [project_id] [chat_id]

A source is a connected dataset — either ingested from an uploaded file or synced from a connector.

Terminal window
querri source list # list all sources
querri source get <source_id> # detail
querri source describe <source_id> # schema + row count
querri 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 sync
querri source delete <source_id>
querri source connectors # list available connector types

In 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.

Terminal window
querri view new --prompt "monthly revenue by product line" # AI authors SQL
querri view new --name "Orders" --sql "SELECT * FROM orders" # write SQL directly
querri view chat <uuid> -m "filter to active customers only" # iterate via chat
querri view list
querri view get <uuid>
querri view preview <uuid>
querri view run # materialize all views
querri view delete <uuid>
Terminal window
querri dashboard list
querri dashboard new --name "Sales" --project <id>
querri dashboard refresh <dashboard_id>
querri dashboard delete <dashboard_id>
Terminal window
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 org
Terminal window
querri user list
querri user new --email user@example.com --first-name Alice --last-name Smith
querri user update <user_id> --role admin
querri user delete <user_id>
Terminal window
querri policy list
querri 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>
Terminal window
querri key list
querri key new --name "CI" --scopes "admin:projects:read,admin:projects:write"
querri key delete <key_id>

For white-label embedding workflows:

Terminal window
querri session new --user-id <user_id> --ttl 3600
querri session refresh --token <token>
querri session revoke --session-id <session_id>
Terminal window
querri usage org # org-wide usage report
querri usage user <user_id> # per-user usage
querri audit list # audit log events
querri audit list --action "project.create"
VariablePurpose
QUERRI_API_KEYAPI key (preferred for scripting; takes precedence over stored login tokens)
QUERRI_ORG_IDOrganization ID
QUERRI_HOSTServer host (default: https://app.querri.com; for local dev: http://localhost)
QUERRI_PROJECT_IDActive project override (same as --project)
QUERRI_CHAT_IDActive chat override (same as --chat)
  • Add --help to anything. querri project --help, querri view chat --help, etc.
  • --quiet outputs IDs only. Useful inside scripts where you want a single value.
  • --verbose prints request details. Helpful when something isn’t working as expected.
  • Don’t pass --api-key on the command line. It can land in shell history. Use the QUERRI_API_KEY env var instead.

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.