API Reference
Complete command-line interface reference for drep. All commands, options, and usage examples.
Command Overview
| Command | Description |
|---|---|
drep init |
Initialize configuration file |
drep scan |
Scan repository for issues |
drep review |
Review pull request |
drep validate |
Validate configuration |
drep serve |
Start webhook server |
drep metrics |
Show LLM usage statistics |
drep lint-docs |
Lint markdown files |
drep init
Initialize drep configuration by creating a config.yaml file with sensible defaults.
Usage
drep init
Description
Creates config.yaml in the current directory with template configuration for:
- Platform adapter (Gitea by default)
- LLM settings (LM Studio endpoint)
- Documentation analyzer settings
- Database configuration (SQLite)
If config.yaml already exists, you'll be prompted to confirm overwrite.
Example
$ drep init
✓ Created config.yaml
Edit config.yaml to add your Gitea token.
Set GITEA_TOKEN environment variable before running scans.
drep scan
Scan a repository for documentation issues, code quality problems, and create issues in your Git platform.
Usage
drep scan OWNER/REPO [OPTIONS]
Arguments
| Argument | Description |
|---|---|
OWNER/REPO |
Repository in format owner/repository |
Options
| Option | Default | Description |
|---|---|---|
--config PATH |
config.yaml |
Path to configuration file |
--show-metrics |
false |
Display LLM token usage after scan |
--show-progress |
true |
Show progress during scan |
Examples
# Basic scan
drep scan myorg/myrepo
# Scan with metrics
drep scan myorg/myrepo --show-metrics
# Use custom config
drep scan myorg/myrepo --config /path/to/config.yaml
drep review
Review a specific pull request and post inline comments with findings.
Usage
drep review OWNER/REPO PR_NUMBER [OPTIONS]
Arguments
| Argument | Description |
|---|---|
OWNER/REPO |
Repository in format owner/repository |
PR_NUMBER |
Pull request number |
Options
| Option | Default | Description |
|---|---|---|
--config PATH |
config.yaml |
Path to configuration file |
--post / --no-post |
true |
Post comments to PR (use --no-post for dry run) |
Examples
# Review and post comments
drep review myorg/myrepo 42
# Dry run (no comments posted)
drep review myorg/myrepo 42 --no-post
drep validate
Validate configuration file and check that all environment variables are set.
Usage
drep validate [OPTIONS]
Options
| Option | Default | Description |
|---|---|---|
--config PATH |
config.yaml |
Path to configuration file |
Example
drep validate
drep serve
Start the FastAPI webhook server to receive and process webhook events from Gitea, GitHub, or GitLab.
Usage
drep serve [OPTIONS]
Options
| Option | Default | Description |
|---|---|---|
--host HOST |
0.0.0.0 |
Host to bind |
--port PORT |
8000 |
Port to listen on |
Examples
# Start on default port
drep serve
# Custom port
drep serve --port 3000
# Bind to localhost only
drep serve --host 127.0.0.1
Webhook endpoints:
- Gitea:
http://your-server:8000/webhooks/gitea - GitHub:
http://your-server:8000/webhooks/github - GitLab:
http://your-server:8000/webhooks/gitlab - Health check:
http://your-server:8000/health
drep metrics
Display LLM usage metrics, token consumption, and cost estimation.
Usage
drep metrics [OPTIONS]
Options
| Option | Default | Description |
|---|---|---|
--days DAYS |
30 |
Days of history to show |
--export PATH |
- | Export metrics to JSON file |
--detailed |
false |
Show detailed breakdown by analyzer |
Examples
# Summary metrics (last 30 days)
drep metrics
# Detailed breakdown
drep metrics --detailed
# Last 7 days only
drep metrics --days 7
# Export to JSON
drep metrics --export metrics.json
drep lint-docs
Lint markdown documentation files for style and formatting issues without using LLM.
Usage
drep lint-docs PATH [OPTIONS]
Arguments
| Argument | Description |
|---|---|
PATH |
Path to directory or file to lint |
Options
| Option | Default | Description |
|---|---|---|
--output FORMAT |
text |
Output format: text or json |
Examples
# Lint docs directory
drep lint-docs ./docs
# Lint specific file
drep lint-docs README.md
# JSON output for CI/CD
drep lint-docs ./docs --output json
Checks Performed
- Trailing whitespace
- Tabs instead of spaces
- Empty or malformed headings
- Unclosed code fences
- Long lines (>120 characters)
- Multiple consecutive blank lines
- Bare URLs (not in links)
- Broken link syntax
Exit Codes
| Code | Meaning |
|---|---|
0 |
Success |
1 |
General error |
2 |
Configuration error |
3 |
LLM connection error |
Next Steps
- See examples for real-world usage patterns
- Learn about advanced configuration
- Set up local LLM for AI-powered analysis