sqlite3

CLI

Command-line shell for SQLite databases. Preinstalled on macOS; apt install sqlite3 on Linux.

Query a .db/.sqlite file non-interactively with SQL or dot-commands

5 of 5 recipes verified by execution · 2026-09-17#sqlite#sql#database#csv#json

Verified commands

Executed by our harness on the platforms shown; the assertion checked the actual result, not just the exit code.

List tables

Verified macOS · Linux · 2026-09-17
sqlite3 app.db '.tables'

Show a table's schema

Verified macOS · Linux · 2026-09-17
sqlite3 app.db '.schema users'

Run a query with column headers

Verified macOS · Linux · 2026-09-17
sqlite3 -header -column app.db 'SELECT * FROM users LIMIT 5'

Run a query and get JSON

Verified macOS · Linux · 2026-09-17
sqlite3 -json app.db 'SELECT id, name FROM users WHERE active = 1'

Import a CSV (with header row) into an existing table

Verified macOS · Linux · 2026-09-17
sqlite3 app.db '.import --csv --skip 1 users.csv users'
Common failures (1)
  • header row inserted as dataadd --skip 1 when the table already exists; omit it only when letting .import create the table

Install

Homebrewbrew install sqlite
aptsudo apt install sqlite3

Agent notes

When to use
Inspecting an app's local database, checking migrations, loading CSV fixtures
Quick examples
  • sqlite3 app.db '.tables'
  • sqlite3 -json app.db 'SELECT * FROM users'

Use from an agent

curl -s https://clihub.com/api/tools/sqlite3 | jq '.agentHints.provenRecipes[] | {task, command, verified}'

Or call get_tool with slug sqlite3 on the MCP server at https://clihub.com/mcp.

Homepage ↗Public Domain0 views