---
title: Connect from the Queria CLI
description: Find datasets, run SQL and save results to files with the Queria CLI
sidebar:
  label: Queria CLI
---

The Queria CLI is Queria's command-line tool (the command is `queria`). When your SQL names `<dataset>.<schema>.<table>`, the CLI connects to that dataset for you, so you don't write ATTACH yourself.

## Try it

With [uv](https://docs.astral.sh/uv/) installed, you can run it with `uvx` without installing it.

```bash
uvx queria search population
uvx queria sql "
  SELECT DISTINCT area_name, value AS population
  FROM e_stat.ssds.a_pref_population
  WHERE item_name = 'A1101_総人口' AND year = 2024 AND area_name != '全国'
  ORDER BY value DESC LIMIT 10
"
```

To save the results to a file, add `--out`. The file extension sets the format.

```bash
uvx queria sql "SELECT * FROM zipcode.main.mart_zipcode" --out zipcodes.parquet
```

## How it differs from the other connection methods

- With the [DuckDB CLI](/en/connection/duckdb-cli) or [Python](/en/connection/python), you copy the connection URL and write `ATTACH`. The Queria CLI needs neither
- `queria list`, `search`, `schema` and `columns` let you look up datasets, tables and columns in the terminal before writing SQL
- SQL runs on DuckDB, so DuckDB SQL works as is, including JOINs across datasets

## Read next

- [Installation](/en/cli/installation) : install with pip or uv
- [Quickstart](/en/cli/quickstart) : from finding data to saving a file
- [CLI guide](/en/cli) : commands and options
- [Compare with your local data](/en/recipes/local-data): JOIN your CSV or Parquet files with datasets
