Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

DuckDB CLI

$ duckdb Foundation Low Risk
DuckDB Foundation · Database & Data · MIT · macos / linux / windows

DuckDB's standalone CLI lets AI agents run standard SQL queries directly over local CSV, Parquet, JSON, or SQLite files without spinning up a database server. Supports -json, -readonly, and non-interactive -c execution.

FCRS-1.0 Score
95 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install duckdb
CLI vs MCP Decision CLI Preferred vs MCP

duckdb -json -c "SELECT ..." runs analytical SQL over gigabytes of CSV/Parquet locally in one command without loading data into agent memory or an MCP process.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

Provides -json / -jsonlines, -c non-interactive one-shot execution, -readonly, and clean tabular/JSON switching.

  • Supports -json, -c, and -readonly CLI flags
Trust & Safety 23 / 25

In-process sandboxed analytical engine with -readonly mode and :memory: default; optional httpfs / file writes are explicit SQL statements.

  • Defaults to ephemeral :memory: DB and supports -readonly
Setup & Portability 15 / 15

Single standalone C++ binary via Homebrew or direct download with zero runtime dependencies.

  • Zero-dependency static CLI binary
Utility & Efficiency 15 / 15

Gives agents instant SQL superpowers over CSV, Parquet, JSON, and SQLite without writing throwaway Python scripts.

  • Direct SQL querying on CSV/Parquet/JSON files
Maintenance & Lineage 10 / 10

Backed by DuckDB Foundation (duckdb/duckdb) under MIT license.

  • Official duckdb/duckdb repository
Docs & Verifiability 9 / 10

Clear CLI reference and SQL documentation.

  • Official CLI overview at duckdb.org/docs/api/cli/overview

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required for local files; optional S3/HTTP secrets configured via SQL CREATE SECRET or env vars.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free and MIT open-source; local execution incurs zero API fees.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# DuckDB CLI Agent Rules
- Always pass `-json` and `-c "<sql>"` (never start interactive REPL without `-c`).
- Pass `-readonly` when querying existing `.duckdb` database files.
- Always `LIMIT` row-level `SELECT` queries and inspect schemas first with `DESCRIBE`.

Agent-Ready Command Recipes

Safe Read-Only Queries

Summarize a CSV or Parquet file in JSON
duckdb -json -c "DESCRIBE SELECT * FROM 'data.parquet';"

Inspects column names and types as clean JSON without reading all rows.

Aggregate large logs in read-only mode
duckdb -readonly -json -c "SELECT status, count(*) AS n FROM 'events.ndjson' GROUP BY 1 ORDER BY 2 DESC LIMIT 10;"

Runs fast analytical aggregation locally and outputs compact JSON.

Controlled Writes & Previews

Convert CSV to compressed Parquet locally
duckdb -c "COPY (SELECT * FROM 'input.csv') TO 'output.parquet' (FORMAT PARQUET);"

Performs a deterministic local file format conversion.

Strengths for Agents

  • + Replaces brittle ad-hoc Python/awk parsing with standard SQL + -json output.
  • + Single binary runs in-process over CSV, Parquet, and NDJSON in milliseconds.
  • + -readonly and :memory: make exploratory data analysis safe by default.

Caveats & Pitfalls

  • ! Invoking duckdb without -c opens an interactive SQL shell—always pass -c or pipe SQL via stdin.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI