Examples
Current local workflows for a Rust binary that reviews staged files and pushed diffs.
Native pre-push setup
This is the default path. The interactive wizard configures a provider and installs a pre-push hook.
cd your-repo
drep init
drep doctor
git pushCheck commits and pushes
drep init --hooks bothThe pre-commit hook checks staged files. The pre-push hook checks the actual range being pushed and uses the cache-warming reconnect handshake for cold reviews.
Existing pre-commit repository
repos:
- repo: https://github.com/slb350/drep
rev: v3.1.0
hooks:
- id: drep-check
- id: drep-check-push
- id: drep-lint-docsThe v3.1.0 published manifest automatically selects code hooks only for Python, JavaScript/JSX, TypeScript/TSX, Go, and Rust file types. Use native drep hooks when commits or pushes containing only another registered language, including Lua, must trigger the gate.
drep init --hooks none
pre-commit install
pre-commit install --hook-type pre-pushLocal-first provider failover
Prefer a local server when it is running and use a hosted provider when it is unavailable.
[[llm]]
endpoint = "http://localhost:1234/v1"
model = "qwen3-30b-a3b"
[[llm]]
endpoint = "https://openrouter.ai/api/v1"
model = "deepseek/deepseek-v4-pro-0813"
api_key = "${OPENROUTER_API_KEY}"Mint a short-lived gateway token
[[llm]]
endpoint = "https://gateway.example/v1"
model = "m"
api_key_command = ["gcloud", "auth", "print-access-token"]drep runs the argv directly once per process, trims its stdout, and never stores the result. A helper failure exits 2 instead of silently using another provider.
Send gateway request headers
[[llm]]
endpoint = "https://gateway.example/v1"
model = "m"
[llm.headers]
"Authorization" = "Bearer ${GATEWAY_TOKEN}"
"X-Tenant-ID" = "${TENANT_ID}"Configured names replace protocol defaults, values can expand environment variables, and drep never prints them. The endpoint is an exact origin: a redirect is reported instead of receiving the configured headers.
Protect repositories at the machine level
Install this as /Library/Application Support/drep/site.toml on macOS or /etc/drep/site.toml elsewhere, then commit the named marker in any repository whose source must not reach an LLM.
max_concurrent_ceiling = 4
refuse_markers = [".drep-no-llm"]Use ChatGPT-backed Codex
codex login
drep init --provider codex
drep doctorManual checks
drep check --staged
drep check --diff origin/main
drep check src/ main.go
drep check --fail-on errorAuthorize a longer remediation cycle
Authoritative staged and diff checks allow three fresh, finding-producing semantic-review rounds by default. Raise the limit for one run or remove it explicitly when a longer cycle is warranted.
drep check --staged --max-review-rounds 5
drep check --diff origin/main --unlimited-reviewsMachine-readable output
JSON includes both findings and an unanalyzed collection so automation can distinguish a clean run from analysis that did not happen.
drep check --staged --format jsonMarkdown-only gate
drep lint-docs --staged --fail-on errorThis command is rule-based. It does not load an LLM provider or contact the network.
Acknowledge a false positive
drep acknowledge <fingerprint>The finding returns automatically when its surrounding source changes.