The DuckDB CLI is the reference way to open a DuckDB database: a single binary, no setup, the latest DuckDB features as soon as they are released. Type SQL, get nicely formatted tables back.
It is also what the other tools build on: the DuckDB UI and the Claude integration both start from it.
Pick the command for your system.
# macOS
brew install duckdb
# Windows
winget install DuckDB.cli
# Linux
curl https://install.duckdb.org | shFrom the folder holding your database. -readonly guarantees nothing gets modified.
duckdb -readonly selfsync-db.duckdb.tables lists the tables, DESCRIBE their columns. Every column carries a comment explaining what it holds.
.tables
DESCRIBE z_fit_session_mesgs;
SELECT column_name, comment
FROM duckdb_columns()
WHERE table_name = 'z_fit_session_mesgs';Every statement ends with a semicolon.
SELECT z_sport AS sport,
count(*) AS sessions,
round(sum(z_total_distance) / 1000, 1) AS km
FROM z_fit_session_mesgs
GROUP BY ALL
ORDER BY km DESC;Need the data in a spreadsheet? Export any query to CSV, Parquet or JSON.
COPY (FROM z_fit_session_mesgs) TO 'sessions.csv';.help to list the dot commands and .mode line to display wide rows one column per line..quit to exit.Wondering what a table or a column holds? Browse the FIT file reference.