A command-line wrapper around Supabase's splinter
database linter. rek scans your Postgres/Supabase database for security and
performance issues, prints them, and then generates a fix prompt you can copy
or open directly in an installed AI coding agent — with exact commands.
$ rek scan
ERROR RLS Disabled in Public (rls_disabled_in_public)
Table `public.profiles` is public, but RLS has not been enabled.
SECURITY · https://supabase.com/docs/guides/database/database-linter?lint=0013_...
WARN Function Search Path Mutable (function_search_path_mutable)
Function `public.handle_new_user` has a role mutable search_path.
...
────────────────────────────────────────────────
3 issue(s): 1 error 1 warn 1 info
What next? ↑/↓ move · enter select · q cancel
❯ Copy fix prompt to clipboard
Open in Claude Code
Open in Codex CLI
Open in opencode
# install script (macOS/Linux) — downloads the right binary, no Go/brew needed
curl -fsSL https://raw.githubusercontent.com/rexadbapp/rek/main/scripts/install.sh | sh
# Homebrew
brew install rexadbapp/tap/rek
# or build from source (Go 1.25+)
go install github.com/rexadbapp/rek@latest
# or download a binary from the Releases pageKeep it current with rek update (or brew upgrade rek for Homebrew installs).
# 1. Point it at your database (saved & verified for future runs)
rek connect "postgresql://postgres:[PASSWORD]@db.[REF].supabase.co:5432/postgres"
# 2. Scan and act on the findings
rek scanNo connect needed if you pass --db, set $SUPABASE_DB_URL / $DATABASE_URL,
or run inside a linked local Supabase project.
Tip: try
rek scan --demoto see the whole flow with sample findings — no database required.
Runs the lints, prints findings, then offers actions on a generated fix prompt.
| Flag | Description |
|---|---|
--db <url> |
Connection string (overrides env/saved config) |
--use <name|local|env> |
Pick a source without the chooser prompt |
--bundled |
Use the lint query embedded in this binary instead of fetching the latest |
--level error,warn,info |
Only show these severities |
--category security|performance |
Only show one category |
--json |
Output findings as JSON and exit |
--copy |
Copy the fix prompt to the clipboard and exit |
--open <id> |
Open the prompt in a harness (claude, codex, …) or all to print every command |
--save <path> |
Write the fix prompt to a file |
--print-prompt |
Print the fix prompt to stdout and exit |
--no-prompt |
Only report findings; skip the fix step |
-y, --yes |
Non-interactive (defaults to copying the prompt) |
--demo |
Use built-in sample findings (no database) |
Save one or more named connections (each is tested before saving):
rek connect "<CONNECTION_STRING>" # saves as "default"
rek connect prod "<CONNECTION_STRING>" # saves as "prod"
rek connect staging "<CONNECTION_STRING>" # saves as "staging"
rek connect --list # list all (passwords redacted, * = default)
rek connect --default prod # set the default
rek connect --clear staging # remove one
rek connect --clear # remove allSaved to ~/.config/rek/config.json with 0600 permissions.
Lists every supported AI agent and whether it's installed (detected via PATH).
Updates rek to the latest release (in-place binary swap; falls back to
brew upgrade rek for Homebrew installs). rek also checks for a newer release
at most once a day and prints a notice; disable with --no-update-check.
rek scan gathers every available source. When more than one exists, it asks
which to scan (arrow keys + Enter); with a single source it just uses it.
Priority (used to skip the prompt with --db, and as the fallback in non-interactive
runs like --json, -y, or no TTY):
--db <url>— explicit, always wins$SUPABASE_DB_URL, then$DATABASE_URL- A linked Supabase project — a
supabase/config.tomlin the working directory or an ancestor (usessupabase statuswhen the local stack is running) - Saved connections (
rek connect), default first
Pick a source without the menu using --use:
rek scan --use prod # a saved connection by name
rek scan --use local # the detected linked Supabase project
rek scan --use env # $SUPABASE_DB_URL / $DATABASE_URL
rek scan --use saved # the default saved connectionOnly the ones actually installed on your machine are offered. Each opens the
agent's real interactive terminal UI (not a headless/one-shot mode), seeded
with the fix prompt where the CLI supports it. Adding a new one is a single
entry in internal/harness/harness.go.
| id | Tool | Launch (interactive) |
|---|---|---|
claude |
Claude Code | claude "<prompt>" |
codex |
Codex CLI | codex "<prompt>" |
gemini |
Gemini CLI | gemini -i "<prompt>" |
opencode |
opencode | opencode --prompt "<prompt>" |
aider |
Aider | aider (prompt copied to clipboard to paste in) |
cursor |
Cursor | opens the saved prompt file |
kilo |
Kilo Code | opens the saved prompt file |
By default scan fetches the latest
splinter.sql
from upstream and falls back to the bundled copy if offline. Use --bundled
to force the embedded copy for fully offline / reproducible runs. The lint query
is read-only and runs inside a transaction that is always rolled back.
The linter targets Supabase databases (it references Supabase roles such as
anon/authenticated). Running it against a vanilla Postgres without those roles will error.
cmd/ cobra commands (scan, connect, harnesses, update)
internal/
db/ connect + run the lint SQL into findings
lints/ embedded splinter.sql + "fetch latest"
config/ saved connections + connection resolution
harness/ AI-agent registry, detection, command building
promptgen/ build the AI fix prompt
report/ terminal rendering
clipboard/ cross-platform clipboard
selfupdate/ GitHub-release check + in-place self-update
scan/ orchestration + filters + demo findings
ui/ interactive arrow-key selector
scripts/ install.sh (curl | sh) + release.sh (build + publish)
make build # -> bin/rek
make test
make run # demo scan
make release # VERSION=0.1.0 — build binaries, publish a GitHub release, bump the tapMIT. splinter (the lint queries) is © Supabase and distributed under its own license.