chowder sql to query data from your terminal or a script. Use the same SQL readers and AI column functions as in Python. Results go to stdout.
Run a query
Follow Installation to set up Chowder, then run a query:Read SQL from a file or stdin
Save a query inquery.sql, then export its results:
query.sql
--file -:
--file, or stdin. SQL input must not be empty.
Choose an output format
The default istable when stdout is a terminal and jsonl otherwise. Set --format explicitly in scripts.
JSON, JSONL, and CSV emit all rows produced by the query. Table previews can shorten long values; use a machine-readable format for complete values. Use SQL
LIMIT to bound the query rather than relying on the preview cap.
Set paths and caching
Use--directory (or -C) to choose the working directory for relative paths. Use --cache-dir to choose the result cache directory:
query.sql, .chowder-cache, and relative data paths resolve from /path/to/project.
Each chowder sql command creates an engine and closes it on exit. Session views do not carry over to a later command. See Caching for result reuse across engines.
Use remote AI compute
Set the engine’s environment variables before launching the command:CHOWDER_API_URL to the endpoint from your Cloud dashboard or self-hosted server operator. A URL and token alone do not enable remote compute. SQL planning and relational execution stay in the CLI process. See Connect to remote AI compute for endpoint settings and Chowder Cloud for account setup.
Handle command failures
The CLI writes query results to stdout and errors to stderr. Scripts can check the exit status:
A query can fail after streaming some output. Check the exit status before treating an export as complete.
Run
chowder --version to check the installed version, or chowder <command> --help for a command’s options. To let an AI agent run queries, see Local MCP server.