CLI Commands Reference
Complete documentation of all Cadence CLI commands with options and examples.
Complete documentation of all Cadence CLI commands with options and examples.
Root Command
cadence --help
Shows available commands:
Cadence analyzes git repositories and websites to detect AI-generated content.
Capabilities:
• Git commits: Detects suspicious commits via patterns, velocity, and anomalies
• Websites: Analyzes page content for AI-generated text patterns
• Optional AI validation: Uses OpenAI GPT-4o-mini for expert analysis
Usage:
cadence [command]
Available Commands:
analyze Analyze repository for suspicious commits
config Manage configuration
web Analyze a website for AI-generated content
webhook Run the Cadence webhook server
version Show version information
help Help about any command
Global Flags:
--config string config file path
-h, --help help for cadence
analyze - Git Repository Analysis
Analyzes Git repositories to detect commits that may have been generated or heavily modified by AI.
Usage
cadence analyze <repository> --output <file>
Arguments
<repository>- Local directory path or GitHub URL to a Git repository
Flags
-o, --output string Output file path (required, .json or .txt)
--suspicious-additions int Flag commits with more than N additions
--suspicious-deletions int Flag commits with more than N deletions
--max-additions-pm float Max additions per minute (0 to disable)
--max-deletions-pm float Max deletions per minute (0 to disable)
--min-time-delta int Min seconds between commits (0 to disable)
--branch string Branch to analyze (default: auto-detect)
--exclude-files strings File patterns to exclude (*.log, *.tmp, etc)
--config string Config file path
Examples
Analyze local repository:
cadence analyze /path/to/repo --output report.json
Analyze GitHub repository:
cadence analyze https://github.com/owner/repo --output report.json
Analyze specific branch:
cadence analyze https://github.com/owner/repo/tree/develop --output report.json
Custom detection thresholds:
cadence analyze /path/to/repo \
--output report.json \
--suspicious-additions 1000 \
--suspicious-deletions 500 \
--max-additions-pm 100 \
--max-deletions-pm 500
Exclude lock files and generated code:
cadence analyze /path/to/repo \
--output report.json \
--exclude-files "package-lock.json,yarn.lock,.gitignore,dist/*"
With configuration file:
cadence analyze /path/to/repo \
--config cadence.yml \
--output report.json
Output
The command creates a report in the reports/ directory. The format is detected from the output file extension:
.json— JSON format.txtor.text— Human-readable text format- No extension — Defaults to text format
[!NOTE] The
analyzecommand currently detects format from the file extension. Only.jsonand.txtare supported. The webhook server and API support all 5 formats (JSON, text, HTML, YAML, BSON).
JSON output contains:
- Flagged commits with suspicion scores
- Per-strategy analysis for each commit
- Repository statistics (total commits, authors, date range)
- Threshold configuration used
Text output contains:
- Human-readable summary
- Flagged commits with scores
- Analysis breakdown
- Recommendations
How It Works
- Repository loading - Reads Git history and commit metadata
- Analysis - Applies 18 detection strategies to each commit
- Scoring - Combines strategy results into suspicion scores
- Detection - Flags commits exceeding configured thresholds
- AI validation (optional) - OpenAI or Anthropic validation if enabled in config
- Reporting - Generates formatted report with findings
web - Website Content Analysis
Analyzes website content to detect AI-generated text ("slop").
Usage
cadence web <url> [flags]
Arguments
<url>- URL of website to analyze (e.g., https://example.com)
Flags
-o, --output string Output file path (saved in reports/ directory)
-v, --verbose Show detailed analysis with specific findings
-j, --json Output in JSON format (default: human-readable text)
--config string Config file path
Examples
Analyze website:
cadence web https://example.com
Save to JSON report:
cadence web https://example.com --json --output example-analysis.json
Verbose output with details:
cadence web https://example.com --verbose --output example-detailed.json
Text format report:
cadence web https://example.com --output example-report.txt
With AI validation:
cadence web https://example.com \
--config cadence.yml \
--json \
--output analysis.json
Output
Verbose mode shows:
- Word count and heading count
- Content quality score
- Detected patterns with confidence scores
- Specific text examples from the page
JSON format includes:
- URL and fetch timestamp
- Content metadata (words, headings, structure)
- Analysis results with scores
- Detected patterns and reasoning
- AI validation (if enabled)
Text format provides:
- Human-readable analysis summary
- List of detected patterns
- Confidence scores
- Recommendations
How It Works
- Fetching - Downloads page HTML with proper HTTP headers
- Extraction - Parses HTML and extracts meaningful content (body text, headings, metadata)
- Filtering - Removes navigation, boilerplate, code blocks
- Analysis - Examines text for 20 AI-generation patterns
- AI validation (optional) - Uses configured AI provider (OpenAI or Anthropic) for analysis
- Reporting - Generates formatted report with findings
config - Configuration Management
Creates and manages Cadence configuration files.
Usage
cadence config [init]
Subcommands
cadence config - Show default configuration
Prints sample configuration to stdout:
cadence config
cadence config > cadence.yml
cadence config init - Create configuration file
Creates .cadence.yaml in current directory:
cadence config init
Configuration File Format
Cadence uses YAML format for configuration:
# Cadence Configuration - AI-Generated Code Detection
# Analyzes git repositories to detect potential AI-generated code patterns
thresholds:
# SIZE-BASED DETECTION
suspicious_additions: 500
suspicious_deletions: 1000
# VELOCITY-BASED DETECTION
max_additions_per_min: 100
max_deletions_per_min: 500
# TIMING-BASED DETECTION
min_time_delta_seconds: 60
# FILE DISPERSION DETECTION
max_files_per_commit: 50
# RATIO-BASED DETECTION
max_addition_ratio: 0.95
min_deletion_ratio: 0.95
min_commit_size_ratio: 100
# PRECISION ANALYSIS
enable_precision_analysis: true
# Exclude specific files from analysis
exclude_files:
- package-lock.json
- yarn.lock
- "*.min.js"
- "*.min.css"
- "node_modules/**"
- "dist/**"
- "build/**"
- "vendor/**"
- ".git/**"
- "*.png"
- "*.jpg"
- "*.svg"
- "*.woff"
- "*.woff2"
# Optional: AI analysis configuration
ai:
enabled: false
provider: "openai" # or "anthropic"
model: "" # Leave empty for provider default
api_key: "" # Or set CADENCE_AI_API_KEY env var
# Optional: Webhook configuration
webhook:
port: 8000
host: 0.0.0.0
secret: "${CADENCE_WEBHOOK_SECRET}"
max_workers: 4
read_timeout: 30
write_timeout: 30
# Optional: Strategy toggles (all enabled by default)
strategies:
# commit_message_analysis: true
# naming_pattern_analysis: true
# structural_consistency: true
# burst_pattern: true
# error_handling_pattern: true
# template_pattern: true
# file_extension_pattern: true
# statistical_anomaly: true
# timing_anomaly: true
Usage Workflow
-
Generate configuration:
Bashcadence config init -
Customize thresholds in
.cadence.yamlfor your use case -
Use in analysis:
Bashcadence analyze /path/to/repo --config .cadence.yaml --output report.json
[!NOTE] The
config initcommand creates.cadence.yaml, but the auto-detection inanalyzeandweblooks forcadence.ymlin the current directory. If you want auto-detection without--config, rename the file:mv .cadence.yaml cadence.yml
Configuration Examples
Sensitive/Strict Analysis:
thresholds:
suspicious_additions: 300
suspicious_deletions: 500
max_additions_per_min: 50
max_files_per_commit: 20
Quick/Fast Analysis:
thresholds:
suspicious_additions: 1000
suspicious_deletions: 2000
max_additions_per_min: 200
max_files_per_commit: 100
Enable AI Validation:
ai:
enabled: true
provider: "openai" # or "anthropic"
# Set CADENCE_AI_KEY env var
webhook - Webhook Server
Runs a webhook server for Git platform integration. The server listens for push events and triggers analysis.
Usage
cadence webhook [flags]
Flags
-p, --port int Webhook server port (default: 8000)
--host string Host to listen on (default: 0.0.0.0)
--secret string Webhook secret for signature verification (required)
--workers int Number of concurrent workers (default: 4)
--read-timeout int Request read timeout in seconds (default: 30)
--write-timeout int Request write timeout in seconds (default: 30)
--config string Config file path
Examples
Start webhook server (default port 8000):
cadence webhook --secret "your-webhook-secret"
Custom port:
cadence webhook --port 8080 --secret "your-webhook-secret"
With configuration file:
cadence webhook --config cadence.yml
Custom worker configuration:
cadence webhook \
--port 8000 \
--secret "webhook-secret" \
--workers 8 \
--read-timeout 60 \
--write-timeout 60
Setup Instructions
1. Start the webhook server:
cadence webhook --port 8080 --secret "my-secret-key"
2. Configure GitHub webhook:
- Go to Repository Settings → Webhooks → Add webhook
- Payload URL:
https://your-server.com:8080/webhook - Content type:
application/json - Secret: Same as
--secretabove - Events: Select "Push events"
- Active: Check enabled
3. Server processes events:
- Receives push notifications
- Clones repository automatically
- Runs analysis on new commits
- Stores results in
reports/directory
How It Works
- Server startup - Listens on configured host and port
- Webhook received - Git platform sends push event
- Verification - Validates webhook signature using secret
- Cloning - Automatically clones the repository
- Analysis - Runs detection analysis on new commits
- Results - Saves analysis report to
reports/directory
version - Version Information
Display Cadence version and build information.
Usage
cadence version
Output
Cadence v0.3.0 (abc123de) built at 2026-02-12T10:30:00Z
help - Command Help
Get help about any command.
Usage
cadence help # Show all commands
cadence help analyze # Help for analyze command
cadence help web # Help for web command
cadence help config # Help for config command
cadence help webhook # Help for webhook command
Global Flags
These flags work with any command:
--config string Path to configuration file (looks for cadence.yml in current directory)
-h, --help Show help for command
[!NOTE] Use
cadence versionto see version information. There is no--versionglobal flag.
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Analysis or runtime error |
Environment Variables
Cadence uses the CADENCE_ prefix with viper's automatic env binding. Environment variables map to config keys with dots replaced by underscores:
# AI provider credentials
CADENCE_AI_API_KEY=sk-... # maps to ai.api_key
CADENCE_AI_PROVIDER=openai # maps to ai.provider (or "anthropic")
CADENCE_AI_ENABLED=true # maps to ai.enabled
CADENCE_AI_MODEL=gpt-4o-mini # maps to ai.model
# Webhook settings
CADENCE_WEBHOOK_PORT=8080 # maps to webhook.port
CADENCE_WEBHOOK_SECRET=webhook-secret # maps to webhook.secret
CADENCE_WEBHOOK_HOST=0.0.0.0 # maps to webhook.host
CADENCE_WEBHOOK_MAX_WORKERS=8 # maps to webhook.max_workers
# Threshold overrides
CADENCE_THRESHOLDS_SUSPICIOUS_ADDITIONS=300
CADENCE_THRESHOLDS_MAX_ADDITIONS_PER_MIN=50
[!NOTE] There is no
CADENCE_CONFIGenvironment variable. Use--configflag to specify a config file path.
Common Workflows
Quick Repository Analysis
# Create default config
cadence config init
# Run analysis
cadence analyze /path/to/repo --output report.json
# View results
cat reports/report.json
GitHub Repository Analysis
# Analyze directly from GitHub (no clone needed)
cadence analyze https://github.com/owner/repo --output repo-analysis.json
Website Content Analysis
# Analyze single website
cadence web https://blog.example.com --output blog-analysis.json
# Verbose output with details
cadence web https://blog.example.com --verbose --output detailed.json
# Batch analyze multiple sites
for url in site1.com site2.com site3.com; do
cadence web "https://$url" --output "reports/${url}_analysis.json"
done
Continuous Monitoring with Webhook
# Start webhook server
cadence webhook --port 8080 --secret "my-secret"
# Configure GitHub webhook
# (Settings → Webhooks → Add webhook pointing to your server)
# Server automatically analyzes on push events
Batch Repository Analysis
# Create list of repositories
repos=(
"https://github.com/org/repo1"
"https://github.com/org/repo2"
"https://github.com/org/repo3"
)
# Analyze each
for repo in "${repos[@]}"; do
name=$(echo "$repo" | rev | cut -d'/' -f1 | rev)
cadence analyze "$repo" --output "reports/analysis_${name}.json"
done
Tips and Tricks
Save Multiple Configurations
Create different configs for different scenarios:
# Generate default config
cadence config init
# This creates .cadence.yaml in the current directory
# Copy and customize for different scenarios
cp .cadence.yaml cadence-strict.yml
# Edit cadence-strict.yml to lower thresholds
cp .cadence.yaml cadence-fast.yml
# Edit cadence-fast.yml to raise thresholds
# Use as needed
cadence analyze /repo --config cadence-strict.yml -o strict.json
cadence analyze /repo --config cadence-fast.yml -o fast.json
Filter JSON Results
# Analyze and save as JSON
cadence analyze /repo -o report.json
# Then filter with jq
jq '.suspicious_commits' reports/report.json
# Count flagged commits
jq '.suspicious_commits | length' reports/report.json
Scheduled Analysis
Create a cron job for automated analysis:
# Run daily at 2 AM
0 2 * * * cadence analyze /repo \
--config /etc/cadence/cadence.yml \
--output /var/log/cadence/$(date +\%Y-\%m-\%d).json
Troubleshooting
Command Not Found
Ensure Cadence is in your PATH:
export PATH="$(pwd)/bin:$PATH"
cadence --help
Or use full path:
./bin/cadence --help
Config File Not Found
Specify config explicitly or place in current directory:
cadence analyze /repo --config /path/to/cadence.yml --output report.json
Permission Denied
Make the binary executable:
chmod +x ./bin/cadence
./bin/cadence --help
Webhook Not Receiving Events
- Check firewall allows port (default 8000)
- Verify webhook secret matches GitHub configuration
- Check server logs for connection issues
- Ensure public URL is accessible from GitHub
Next Steps
- Detection Strategies - Learn how each strategy works
- Repository Analysis - Real-world analysis examples
- Configuration Guide - Advanced settings