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

SQLite CLI

$ sqlite3 Official Low Risk
SQLite Consortium · Database & Data · Public Domain (blessing) · macos / linux / windows

The official sqlite3 shell reads and queries local .db/.sqlite files directly with zero server setup. Modern SQLite (>=3.33) includes native -json output, -readonly mode to prevent accidental DB creation or writes, and -bail to stop on errors.

FCRS-1.0 Score
83 /100
Good
Medium Confidence
Zero-Friction Install
brew install sqlite
CLI vs MCP Decision CLI Preferred vs MCP

sqlite3 -readonly -json app.db "SELECT ..." runs in single-digit milliseconds locally with zero MCP server setup.

Agent-Readiness Checklist

Local Probe Evidence
✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md
Version
—
Startup
0 ms
Exit Codes (help / invalid)
— / —
NO_COLOR Clean / Non-TTY Safe
Yes / Safe

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 19 / 25

Supports -json, -csv, -readonly, -bail, and positional one-shot SQL arguments with zero ANSI clutter.

  • Native -json, -readonly, -bail, and positional SQL argument
Trust & Safety 21 / 25

-readonly guarantees no writes and avoids silently creating empty files on typos; local-only blast radius.

  • -readonly prevents writes and accidental file creation
Setup & Portability 15 / 15

Pre-installed on macOS and almost all Linux distros; single tiny C binary everywhere else.

  • Pre-installed on macOS/Linux; official static binaries
Utility & Efficiency 12 / 15

Fastest way to inspect local SQLite databases, though duckdb is stronger for multi-format analytics.

  • Instant local .sqlite inspection without external drivers
Maintenance & Lineage 9 / 10

Official SQLite Consortium tool maintained with legendary reliability.

  • Official SQLite CLI (sqlite.org)
Docs & Verifiability 7 / 10

Exhaustive official documentation at sqlite.org/cli.html.

  • Official CLI documentation at sqlite.org/cli.html

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None; operates directly on local filesystem database files.

Side Effects
Read-Only Local Write Destructive
Cost & Quotas

100% free and Public Domain.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# sqlite3 Agent Rules
- Always pass `-readonly` and `-json` for inspection queries so missing paths don't create empty DB files.
- Always pass the SQL command string as an argument (never launch bare `sqlite3 app.db` REPL).
- Use `-bail` when running scripts so errors halt immediately.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect SQLite schema in JSON safely
sqlite3 -readonly -json app.db "SELECT name, sql FROM sqlite_master WHERE type='table';"

Opens the database read-only and emits table definitions as clean JSON.

Query rows in read-only JSON mode
sqlite3 -readonly -json -bail app.db "SELECT * FROM events ORDER BY id DESC LIMIT 20;"

Returns recent records as JSON and fails fast on SQL errors.

Controlled Writes & Previews

Create a consistent online backup
sqlite3 app.db ".backup 'app.backup.db'"

Safely copies a live SQLite database using SQLite's online backup API.

Strengths for Agents

  • + -readonly -json is fast, safe, and universally available.
  • + Pre-installed on nearly every developer machine and container.
  • + Online .backup dot-command creates safe snapshots even under WAL concurrency.

Caveats & Pitfalls

  • ! Older system sqlite3 builds (<3.33) may lack the -json output mode.
  • ! Without -readonly, running sqlite3 typo.db silently creates an empty file.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI