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

GritQL

$ grit Community Low Risk
Biome · Files & Search · MIT · macos / linux / windows

GritQL (grit) is a declarative structural query and rewrite CLI powered by Tree-sitter across JS/TS, Python, Go, Rust, SQL, and more. It supports --json / --jsonl diagnostics on grit check and --dry-run previews on grit apply.

FCRS-1.0 Score
87 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g @getgrit/cli
CLI vs MCP Decision CLI Preferred vs MCP

grit check --json and grit apply --dry-run execute Tree-sitter rewrites locally on disk with zero MCP latency.

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

Supports --json and --jsonl structured outputs, --dry-run previews on grit apply, and non-interactive execution by default.

  • Global --json / --jsonl flags supported on grit check
  • grit apply --dry-run previews diffs without writing
Trust & Safety 23 / 25

grit check is strictly read-only and grit apply --dry-run prevents file writes; operates locally on workspace files.

  • Explicit --dry-run safety flag before in-place rewrites
Setup & Portability 13 / 15

Distributed via @getgrit/cli on npm/npx and native binaries on GitHub Releases for macOS, Linux, and Windows.

  • Easy npm install -g @getgrit/cli or npx @getgrit/cli install
Utility & Efficiency 13 / 15

Declarative GritQL syntax handles multi-language structural search and complex contextual migrations cleanly.

  • Multi-language Tree-sitter engine with reusable pattern library
Maintenance & Lineage 8 / 10

GritQL core is maintained under the Biome organization (biomejs/gritql) under MIT.

  • Backed by Biome ecosystem (biomejs/gritql)
Docs & Verifiability 8 / 10

Clear pattern playground, CLI quickstart, and language reference at docs.grit.io.

  • Documented CLI commands and GritQL syntax online

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required for local grit check and grit apply execution.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free, offline, and open-source (MIT).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# GritQL (grit) Agent Rules
- Always run `grit apply ... --dry-run` before running `grit apply` without `--dry-run`.
- Pass `--json` or `--jsonl` on `grit check` for structured match parsing.

Agent-Ready Command Recipes

Safe Read-Only Queries

Run configured Grit checks with JSON output
grit check --json

Evaluates .grit/grit.yaml rules across the repo and emits structured JSON diagnostics.

Dry-run an inline GritQL rewrite
grit apply '`console.log($msg)` => `logger.info($msg)`' --dry-run src/

Previews AST rewrite diffs on src/ without modifying any files on disk.

Controlled Writes & Previews

Apply a reviewed GritQL migration non-interactively
grit apply '`var $x = $y` => `const $x = $y`' src/

Writes structural AST rewrites across src/ after verifying the --dry-run diff.

Strengths for Agents

  • + Native --json / --jsonl outputs plus --dry-run on grit apply.
  • + Concise declarative rewrite syntax (=>) across TypeScript, Python, Go, Rust, and more.

Caveats & Pitfalls

  • ! Running grit apply without --dry-run or --interactive mutates matched files immediately.
  • ! Not in Homebrew core; installed via npm (@getgrit/cli) or GitHub release binaries.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI