Scythe CLI
A SQL code generator with an agent plugin: annotated queries become type-safe database code in ten languages.
- 75 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The CLI creates and overwrites code files in the project, and `inspect` checks connect to a live database.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/scytheDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The CLI creates and overwrites code files in the project, and `inspect` checks connect to a live database.
This is third-party code. Review the repository files before installing.
What it does
Scythe compiles annotated `.sql` files into database access code: row types, query functions and type mappings. Parsing is static, with no database connection or network, so generation can run in a pre-commit hook. Nullability is inferred through `JOIN`s, CTEs and window functions, and generated code carries a provenance header so `scythe check` notices drift from the schema. The toolset includes 59 lint and audit rules: `UPDATE` without `WHERE`, `SELECT *` over personal data, dangerous migrations. For agents the repository ships a plugin with one skill and five SQL development references. It installs into Claude Code and Codex, with ready bundles for other runtimes, while the CLI itself installs separately.
Who it is for. Backend developers who write SQL by hand and want type-safe code generated from it instead of an ORM.
Good fit when
- The database schema changes often and access code has to follow it.
- One service is written in several languages and shares the queries.
- An agent writes migrations and they must be checked for locks and destructive operations.
- A project moves from sqlc and you want to carry the config over with `scythe migrate`.
Not a fit when
- Your users choose the database: an ORM smooths dialect differences, while Scythe targets one engine per config block.
- You need one code path for different databases without editing queries.
- A ready ORM is enough and you do not want to handle SQL by hand.
Example request
Write a user orders query with a `LEFT JOIN` as annotated SQL for Scythe, generate Rust code and run `scythe audit`.Limitations
The plugin carries a skill and references but registers no MCP tools and installs no database drivers: the CLI and application drivers install separately, for example `cargo install scythe-cli`. No separate npm or PyPI package for the plugin has been published yet, so other runtimes use local bundles from the repository. The `scythe audit --cluster-scope` command depends on PostgreSQL parser helpers that the Windows archive lacks, so it fails with an error there.
How to disable. Remove the `scythe` plugin with the plugin manager and the CLI with the command paired to your install, for example `cargo uninstall scythe-cli`. Delete the pre-commit hooks from the repository configuration.
FAQ
How do I install Scythe?
Use `cargo install scythe-cli`, a prebuilt binary with `cargo binstall scythe-cli`, or `brew install Goldziher/tap/scythe`. Without Rust there are `pnpm add --save-dev scythe-cli` and `pip install scythe-sql`.
How do I connect the plugin to Claude Code?
Run `/plugin marketplace add Goldziher/scythe`, then `/plugin install scythe@scythe`. For Codex: `codex plugin marketplace add Goldziher/scythe` and `codex plugin add scythe@scythe`.
Does generation need a database?
No, SQL is read statically and generation works without a connection. Checks against a live database live in a separate `inspect` command.
Which languages and databases are supported?
Ten languages and ten databases, 56 backends in all. See the project documentation for the exact set.
How does it differ from sqlc?
The idea is close, and `scythe migrate` eases the move by turning `sqlc.yaml` into `scythe.toml`. Scythe adds lint rules and migration auditing.
Discussion
No questions or reviews yet.
Related
CLI toolsAn MCP server and plugin for agents that generate web APIs from OpenAPI, AsyncAPI, GraphQL, gRPC and SQL specs on a Rust core.
Skills for Java projects: code review, Spring Boot, JPA, concurrency, Java version migration, Maven audits and security
Supabase's official CLI: local stack, database migrations, Edge Functions deploys and type generation from the terminal
A skill that teaches your agent to run datamodel-codegen and get Pydantic models from OpenAPI, JSON Schema and GraphQL
Plinth
plinth
Skills and agents for Java development: build, tests, profiling and architecture. One-command installation for Claude Code, Cursor, Codex and Copilot
The official Convex plugin for Cursor and Claude Code: rules, commands, MCP access and hooks for TypeScript backends.
README in short
The README explains how Scythe differs from an ORM, lists features, install options and pre-commit hooks. A quick start with an annotated query and a coding-agent plugins section follow.