Skip to main content

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

bash
drep init

Description

Creates config.yaml in the current directory with template configuration for:

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

bash
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

bash
# 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

bash
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

bash
# 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

bash
drep validate [OPTIONS]

Options

Option Default Description
--config PATH config.yaml Path to configuration file

Example

bash
drep validate

drep serve

Start the FastAPI webhook server to receive and process webhook events from Gitea, GitHub, or GitLab.

Usage

bash
drep serve [OPTIONS]

Options

Option Default Description
--host HOST 0.0.0.0 Host to bind
--port PORT 8000 Port to listen on

Examples

bash
# 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:

drep metrics

Display LLM usage metrics, token consumption, and cost estimation.

Usage

bash
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

bash
# 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

bash
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

bash
# 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

Exit Codes

Code Meaning
0 Success
1 General error
2 Configuration error
3 LLM connection error

Next Steps