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

SQLFluff

$ sqlfluff Community Low Risk
SQLFluff · Code & DevOps · MIT · macos / linux / windows

Modular SQL linter and formatter supporting over 25 dialects including Postgres, BigQuery, Snowflake, DuckDB, and Jinja/dbt templated models. Offers sqlfluff lint --format json for structured diagnostics and sqlfluff fix --force for non-interactive formatting.

FCRS-1.0 Score
85 /100
Good
Medium Confidence
Zero-Friction Install
brew install sqlfluff
CLI vs MCP Decision CLI Only

Parses and formats local .sql and dbt models offline; CLI execution is direct and deterministic.

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 21 / 25

Supports lint --format json, --nocolor, --nofail, and --dialect, though sqlfluff fix prompts interactively unless --force is passed.

  • sqlfluff lint --format json outputs structured violation arrays
  • sqlfluff fix prompts [Y/n] when unfixable violations exist unless --force is supplied
Trust & Safety 21 / 25

Strictly local file operations; lint is read-only and fix checks before prompting unless --force is set.

  • Read-only lint subcommand and explicit fix subcommand
Setup & Portability 12 / 15

Available via Homebrew, PyPI, and uvx, though dbt-templated projects require sqlfluff-templater-dbt and dbt dependencies.

  • Easy brew/pip/uvx install; dbt projects need extra templater packages
Utility & Efficiency 14 / 15

Unmatched SQL dialect coverage and Jinja/dbt awareness across modern data stacks.

  • Supports 25+ SQL dialects plus Jinja/dbt templates
Maintenance & Lineage 8 / 10

Well-maintained community standard (sqlfluff/sqlfluff) under MIT license.

  • Active sqlfluff/sqlfluff repository
Docs & Verifiability 9 / 10

Comprehensive rule catalog, CLI reference, and dialect docs at docs.sqlfluff.com.

  • Official docs at docs.sqlfluff.com

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Offline local SQL parser/linter; no credentials stored unless optional dbt adapters read local profiles.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source Python package; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# SQLFluff (sqlfluff) Agent Rules
- Always run `sqlfluff lint --format json --nocolor` first; pass `--dialect` if `.sqlfluff` is absent.
- Pass `--force` (`-f`) on `sqlfluff fix` so it does not hang waiting on an interactive `[Y/n]` prompt.

Agent-Ready Command Recipes

Safe Read-Only Queries

Lint SQL files with JSON diagnostics
sqlfluff lint --dialect postgres --format json --nocolor models/

Emits JSON violation arrays per SQL file without editing files.

Controlled Writes & Previews

Auto-fix SQL formatting non-interactively
sqlfluff fix --dialect postgres --force models/orders.sql

Applies SQLFluff fixes to the target file without blocking on confirmation prompts (--force).

Strengths for Agents

  • + Native lint --format json --nocolor returns exact line, position, and rule code metadata.
  • + Handles 25+ SQL dialects and Jinja/dbt templating natively.

Caveats & Pitfalls

  • ! Omitting --force on sqlfluff fix can trigger an interactive confirmation prompt and hang headless agents.
  • ! Requires --dialect (or .sqlfluff config) before linting will run.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI