Complete command-line interface reference for GitFlow Analytics.
# Simplified syntax (analyze is the default command)
gitflow-analytics [OPTIONS]
# Explicit analyze command (backward compatible)
gitflow-analytics analyze [OPTIONS]Examples:
# Basic analysis with configuration file
gitflow-analytics -c config.yaml
# Analyze last 8 weeks
gitflow-analytics -c config.yaml --weeks 8
# Clear cache and re-analyze
gitflow-analytics -c config.yaml --clear-cache-c, --config PATH- Path to YAML configuration file
--weeks INTEGER- Number of weeks to analyze (default: from config)--clear-cache- Clear analysis cache before running--skip-identity-analysis- Skip automatic identity resolution--validate-only- Validate configuration without running analysis
--format [csv,json,markdown,all]- Output format(s) to generate--output-dir PATH- Override output directory from config--quiet- Suppress progress output--verbose- Enable verbose logging
--version- Show version information--help- Show help message and exit
Run comprehensive repository analysis and generate reports.
gitflow-analytics analyze -c config.yaml [OPTIONS]Options:
- All global options apply
--repositories TEXT- Comma-separated list of repositories to analyze (overrides config)--backfill-since YYYY-MM-DD- Hydratepull_request_cachefrom this date forward. Bypasses the incremental fetch gate so historical PRs older than the last-processed checkpoint are fetched. Auto-triggersweekly_pr_metricsrollup for the same date range. Idempotent — safe to re-run. Does not change default behavior (#52).
Examples:
# Analyze specific repositories only
gitflow-analytics analyze -c config.yaml --repositories "repo1,repo2"
# Quick 2-week analysis with JSON output
gitflow-analytics analyze -c config.yaml --weeks 2 --format json
# Backfill all merged PRs back to a specific date
gfa analyze -c config.yaml --backfill-since 2025-01-01Fetch data from external platforms (GitHub PRs, JIRA, ClickUp) and cache it locally.
gfa fetch -c config.yaml [OPTIONS]Options:
-c, --config PATH- Path to YAML configuration file (required)--weeks, -w INTEGER- Number of weeks to fetch (default: 4)--output, -o PATH- Output directory for cache (overrides config)--clear-cache- Clear cache before fetching data--backfill-since YYYY-MM-DD- Hydratepull_request_cachefrom this date forward. Bypasses the incremental fetch gate so historical PRs older than the last-processed checkpoint are fetched. Idempotent — safe to re-run. Does not change default behavior (#52).--backfill-prs-since YYYY-MM-DD- Override the PR-fetch lower bound independently of--backfill-since. When set, PRs are fetched back to this date; commits still use--backfill-since. Takes priority over--backfill-sincefor the PR window. Idempotent. (#55)--log [none|INFO|DEBUG]- Enable logging at the specified level (default: none)
Examples:
# Standard incremental fetch for the last 4 weeks
gfa fetch -c config.yaml
# Fetch the last 8 weeks
gfa fetch -c config.yaml --weeks 8
# Backfill all merged PRs back to a specific date
gfa fetch -c config.yaml --backfill-since 2025-01-01
# Re-run the same backfill safely (idempotent)
gfa fetch -c config.yaml --backfill-since 2025-01-01
# Backfill PRs further back than commits
gfa fetch -c config.yaml --backfill-since 2025-06-01 --backfill-prs-since 2025-01-01Run batch LLM classification on commits already in the cache (Stage 2 of the collect → classify → report pipeline).
gfa classify -c config.yaml [OPTIONS]Options:
-c, --config PATH- Path to YAML configuration file (required)-w, --weeks INTEGER- Number of weeks to classify (default: 4; should match thecollect --weeksvalue)--week YYYY-Www- Target a specific ISO week (e.g.2026-W07). Repeatable for multiple discrete weeks. Mutually exclusive with--weeks N,--from, and--to.--from YYYY-Www- Start of an inclusive ISO week range (e.g.--from 2026-W01). Must be paired with--to. Mutually exclusive with--weeks Nand--week.--to YYYY-Www- End of an inclusive ISO week range (e.g.--to 2026-W18). Must be paired with--from. Mutually exclusive with--weeks Nand--week.--reclassify- Re-classify commits that were already classified--show-jira-signals- Log every commit short-circuited by the JIRA project-key mapping (issue #62). Useful for auditing which commits hit the tier-3 classification path defined injira_project_mappings.--validate-coverage- Warn when the fraction of classified commits falls below the coverage threshold. Exits with a non-zero code if coverage is insufficient (#65).--coverage-threshold FLOAT- Minimum acceptable classification coverage ratio (default: 0.8). Values between 0.0 and 1.0. Used in conjunction with--validate-coverage.--log [none|INFO|DEBUG]- Enable logging at the specified level (default: none)
Examples:
# Standard classification for the last 4 weeks
gfa classify -c config.yaml
# Force re-classification of all commits in range
gfa classify -c config.yaml --reclassify
# Classify a single ISO week
gfa classify -c config.yaml --week 2026-W07 --reclassify
# Classify an inclusive ISO week range
gfa classify -c config.yaml --from 2026-W01 --to 2026-W18 --reclassify
# Classify multiple discrete weeks (--week is repeatable)
gfa classify -c config.yaml --week 2026-W07 --week 2026-W08 --reclassify
# Audit which commits were classified via the JIRA project-key mapping
gfa classify -c config.yaml --show-jira-signals --log INFO
# Warn if fewer than 80% of commits are classified (default threshold)
gfa classify -c config.yaml --validate-coverage
# Warn if fewer than 90% of commits are classified
gfa classify -c config.yaml --validate-coverage --coverage-threshold 0.9Prerequisite: gfa collect -c config.yaml
Next step: gfa report -c config.yaml
Collect commits and pull request data from GitHub into the local cache database (Stage 1 of the collect → classify → report pipeline).
gfa collect -c config.yaml [OPTIONS]Options:
-c, --config PATH- Path to YAML configuration file (required)-w, --weeks INTEGER- Number of weeks to collect (default: 4)--week YYYY-Www- Target a specific ISO week (e.g.2026-W07). Repeatable for multiple discrete weeks. Mutually exclusive with--weeks N,--from, and--to.--from YYYY-Www- Start of an inclusive ISO week range (e.g.--from 2026-W01). Must be paired with--to. Mutually exclusive with--weeks Nand--week.--to YYYY-Www- End of an inclusive ISO week range (e.g.--to 2026-W04). Must be paired with--from. Mutually exclusive with--weeks Nand--week.--log [none|INFO|DEBUG]- Enable logging at the specified level (default: none)
Examples:
# Standard incremental collect for the last 4 weeks
gfa collect -c config.yaml
# Collect a single ISO week
gfa collect -c config.yaml --week 2026-W07
# Collect multiple discrete weeks
gfa collect -c config.yaml --week 2026-W07 --week 2026-W08Next step: gfa classify -c config.yaml
Generate reports from classified commit data already in the local cache (Stage 3 of the collect → classify → report pipeline).
gfa report -c config.yaml [OPTIONS]Options:
-c, --config PATH- Path to YAML configuration file (required)-w, --weeks INTEGER- Number of weeks to include in the report (default: 4)--week YYYY-Www- Target a specific ISO week (e.g.2026-W07). Repeatable for multiple discrete weeks. Mutually exclusive with--weeks N,--from, and--to.--from YYYY-Www- Start of an inclusive ISO week range (e.g.--from 2026-W01). Must be paired with--to. Mutually exclusive with--weeks Nand--week.--to YYYY-Www- End of an inclusive ISO week range (e.g.--to 2026-W04). Must be paired with--from. Mutually exclusive with--weeks Nand--week.--format [csv|json|markdown|all]- Output format(s) to generate--output-dir PATH- Override output directory from config--log [none|INFO|DEBUG]- Enable logging at the specified level (default: none)
Examples:
# Generate a report for the last 4 weeks
gfa report -c config.yaml
# Report for a single ISO week
gfa report -c config.yaml --week 2026-W07
# Report for an inclusive ISO week range
gfa report -c config.yaml --from 2026-W01 --to 2026-W04Prerequisite: gfa classify -c config.yaml
Manage developer identity resolution and consolidation.
gitflow-analytics identities -c config.yaml [OPTIONS]Options:
--interactive- Interactive identity resolution mode--auto-approve- Automatically approve suggested identity mappings--export PATH- Export identity mappings to YAML file--import PATH- Import identity mappings from YAML file
Examples:
# Run interactive identity analysis
gitflow-analytics identities -c config.yaml --interactive
# Export current identity mappings
gitflow-analytics identities -c config.yaml --export identity-mappings.yamlValidate configuration files and system setup.
gitflow-analytics validate -c config.yaml [OPTIONS]Options:
--check-tokens- Validate GitHub API tokens and permissions--check-repos- Verify repository access and cloning--check-ml- Validate ML model availability and setup
Examples:
# Comprehensive validation
gitflow-analytics validate -c config.yaml --check-tokens --check-repos --check-ml
# Quick config validation only
gitflow-analytics validate -c config.yamlManage analysis cache and performance optimization.
gitflow-analytics cache [SUBCOMMAND] [OPTIONS]Subcommands:
clear- Clear all cache databasesstatus- Show cache statistics and disk usageoptimize- Optimize cache databases (VACUUM)
Examples:
# Clear all caches
gitflow-analytics cache clear
# Show cache status
gitflow-analytics cache status
# Optimize cache performance
gitflow-analytics cache optimizeRename a developer's canonical display name in manual mappings.
gitflow-analytics alias-rename -c config.yaml \
--old-name "Current Name" \
--new-name "New Name" \
[OPTIONS]Required Options:
--old-name TEXT- Current canonical name to rename (must exist in manual_mappings)--new-name TEXT- New canonical display name to use in reports
Optional Flags:
--update-cache- Update cached database records with the new name--dry-run- Show what would be changed without applying changes
Examples:
# Preview changes with dry-run
gitflow-analytics alias-rename -c config.yaml \
--old-name "bianco-zaelot" \
--new-name "Emiliozzo Bianco" \
--dry-run
# Apply rename to config file only
gitflow-analytics alias-rename -c config.yaml \
--old-name "bianco-zaelot" \
--new-name "Emiliozzo Bianco"
# Update both config and database cache
gitflow-analytics alias-rename -c config.yaml \
--old-name "bianco-zaelot" \
--new-name "Emiliozzo Bianco" \
--update-cacheWhat It Does:
- Searches
analysis.identity.manual_mappingsfor the old name - Updates the
namefield to the new name - Preserves all other fields (primary_email, aliases)
- Optionally updates
developer_identitiesanddeveloper_aliasestables
Use Cases:
- Fix typos in developer names
- Use preferred names or nicknames
- Update names after marriage or legal name changes
- Standardize name formatting across team
Notes:
- Without
--update-cache, old name persists in cached data until next analysis - Always test with
--dry-runfirst to preview changes - See Managing Aliases Guide for detailed usage
Add alias mappings to a configuration file non-interactively. Suitable for scripting and CI pipelines where interactive prompts are not available.
gfa add-alias -c config.yaml \
--canonical "[email protected]" \
--alias "[email protected]" \
--alias "Dev Name" \
[OPTIONS]Required Options:
-c, --config PATH- Path to YAML configuration file
Mapping Options (mutually exclusive — use one or the other):
--canonical EMAIL- Primary/canonical email for this developer identity; combine with one or more--aliasflags--from-file PATH- YAML or JSON file containing batch alias mappings (cannot be combined with--canonical)--alias EMAIL_OR_NAME- Email address or display name to map to--canonical; repeatable
Behaviour Flags:
--dry-run- Show what would be changed without writing to the config file--apply- Trigger identity re-resolution after updating the config
Examples:
# Map a personal email and display name to a canonical work email
gfa add-alias -c config.yaml \
--canonical "[email protected]" \
--alias "[email protected]" \
--alias "Alice Smith"
# Preview changes before writing
gfa add-alias -c config.yaml \
--canonical "[email protected]" \
--alias "[email protected]" \
--dry-run
# Load batch mappings from a YAML file and re-resolve identities
gfa add-alias -c config.yaml \
--from-file aliases.yaml \
--apply
# Load batch mappings from a JSON file
gfa add-alias -c config.yaml \
--from-file aliases.jsonSupported --from-file Formats:
-
GFA native YAML — a config file with a
developer_aliases:key:developer_aliases: - canonical: "[email protected]" aliases: ["[email protected]", "Alice Smith"]
-
Flat YAML list — a list of
{canonical, aliases}objects:- canonical: "[email protected]" aliases: - [email protected] - Alice Smith - canonical: "[email protected]" aliases: - [email protected]
-
JSON array — equivalent structure in JSON:
[ {"canonical": "[email protected]", "aliases": ["[email protected]", "Alice Smith"]}, {"canonical": "[email protected]", "aliases": ["[email protected]"]} ]
What It Does:
- Reads the existing
analysis.identity.manual_mappings(ordeveloper_aliases) section in the config - Merges new aliases into the matching canonical entry, or creates a new entry if the canonical is not yet present
- Skips duplicates — existing aliases are never written twice (idempotent)
- Writes the updated config back to disk (unless
--dry-runis specified) - Optionally triggers identity re-resolution via
--apply
Use Cases:
- Onboarding automation: script alias setup as part of repo initialisation
- CI pipelines: keep alias mappings in a separate file and apply them on deploy
- Bulk imports: migrate alias lists from another tool's export format
- Safe updates: use
--dry-runto audit changes before committing them
Notes:
--from-fileand--canonicalare mutually exclusive; combining them is an error- The operation is idempotent: running the same command twice produces the same config
- Always verify with
--dry-runbefore running in unattended automation - See Managing Aliases Guide for detailed identity management guidance
Populate NULL ticket_ids and commit_count values on existing cached pull requests using commit messages already stored in cached_commits. No GitHub API calls are made — all data is sourced from the local cache database. The operation is idempotent and safe to re-run.
gfa backfill-ticket-ids -c config.yamlOptions:
-c, --config PATH- Path to YAML configuration file (required)
Examples:
# Backfill ticket IDs and commit counts for all cached PRs
gfa backfill-ticket-ids -c config.yamlWhat It Does:
- Queries
pull_request_cachefor rows whereticket_idsIS NULL orcommit_countIS NULL - For each such PR, joins against
cached_commitsusing commit hashes already in the local database - Extracts JIRA-style ticket IDs matching
[A-Z]+-\d+from each commit message and deduplicates them - Counts commit hashes to produce
commit_count - Writes
ticket_ids(JSON array, e.g.["DUE-1234", "CORE-567"]) andcommit_countback to the row - Makes no outbound GitHub API calls — entirely offline
Use Cases:
- Upgrading an existing installation to v3.14.22 and enriching previously cached PRs
- Recovering
ticket_idsafter a schema migration - Re-running after updating the ticket-ID extraction regex without re-fetching PRs
Notes:
- PRs whose
ticket_idsandcommit_countare already populated are skipped - Commit messages must already be present in
cached_commits; PRs with no associated cached commits will haveticket_idsset to[]andcommit_countset to0 - See Cache System Reference for the full
pull_request_cacheschema
Manage manual classification overrides for individual commits. Overrides take precedence over all automated classifiers (LLM, rule-based, JIRA mapping).
gfa override <subcommand> [OPTIONS]Subcommands:
Manually assign a change_type classification to a specific commit.
gfa override set <commit_sha> <change_type> -c config.yamlArguments:
commit_sha- Full or abbreviated commit SHA to overridechange_type- Classification to apply (e.g.feature,maintenance,bugfix,analytics)
Examples:
# Override a commit to be classified as a feature
gfa override set abc1234 feature -c config.yaml
# Override a commit to be classified as maintenance
gfa override set def5678 maintenance -c config.yamlList all manual classification overrides currently stored in the cache database.
gfa override list -c config.yamlOptions:
-c, --config PATH- Path to YAML configuration file (required)
Examples:
# Show all active overrides
gfa override list -c config.yamlRemove a manual classification override, returning the commit to automated
classification on the next gfa classify run.
gfa override remove <commit_sha> -c config.yamlArguments:
commit_sha- Full or abbreviated commit SHA whose override should be removed
Examples:
# Remove an override and allow automated re-classification
gfa override remove abc1234 -c config.yamlWhat It Does (all override subcommands):
- Reads/writes the
classification_overridestable in the local cache database - On the next
gfa classifyrun, overrides take the highest precedence — the LLM call for overridden commits is skipped entirely override removedeletes the row; the commit reverts to standard classification on the next classify pass
Backfill AI-detection results for commits already stored in cached_commits.
Scans commit footers and trailers for known AI-tool signatures (Cursor, Claude,
GitHub Copilot) and writes results to the cache database. No GitHub API calls
are made — all data is sourced from cached commit messages.
gfa backfill-ai-detection -c config.yamlOptions:
-c, --config PATH- Path to YAML configuration file (required)
Examples:
# Detect AI footers for all cached commits
gfa backfill-ai-detection -c config.yamlWhat It Does:
- Queries
cached_commitsfor all rows - Scans each commit message/body for AI-tool trailer patterns:
Co-authored-by: Claude(Anthropic Claude)Co-authored-by: GitHub Copilot(GitHub Copilot)- Cursor-specific commit footers
- Writes
is_ai_assistedflag and detected tool name back tocached_commits - Operation is idempotent — safe to re-run after adding new AI-tool signatures
Use Cases:
- Upgrading an existing installation and enriching previously cached commits
- Adding AI-tool detection to a repository after the fact
- Re-running after adding new AI-tool signature patterns
Generates structured data files:
weekly_metrics_YYYYMMDD.csv- Weekly development metricsdevelopers_YYYYMMDD.csv- Developer profiles and statisticssummary_YYYYMMDD.csv- Project-wide summary statisticsuntracked_commits_YYYYMMDD.csv- Commits without ticket references
Generates comprehensive data export:
comprehensive_export_YYYYMMDD.json- Complete analysis data
Generates human-readable reports:
narrative_report_YYYYMMDD.md- Executive summary with insights
Generates all available output formats.
GitFlow Analytics uses standard exit codes:
- 0: Success - Analysis completed successfully
- 1: General error - Configuration or processing error
- 2: Configuration error - Invalid YAML or missing required fields
- 3: Authentication error - Invalid or missing GitHub token
- 4: Repository error - Repository access or cloning failed
- 5: Analysis error - Analysis processing failed
- 6: Output error - Report generation failed
GitFlow Analytics recognizes these environment variables:
GITHUB_TOKEN- GitHub personal access tokenJIRA_ACCESS_USER- JIRA username for API accessJIRA_ACCESS_TOKEN- JIRA API token or password
GITFLOW_CONFIG- Default configuration file pathGITFLOW_CACHE_DIR- Override default cache directoryGITFLOW_LOG_LEVEL- Set logging level (DEBUG, INFO, WARNING, ERROR)
GITFLOW_MAX_WORKERS- Maximum parallel processing workersGITFLOW_BATCH_SIZE- Commit processing batch sizeGITFLOW_TIMEOUT- Network request timeout in seconds
# Quick 1-week analysis for daily standup insights
gitflow-analytics -c config.yaml --weeks 1 --format markdown --quiet# 2-week analysis with comprehensive data
gitflow-analytics -c config.yaml --weeks 2 --format all# 4-week analysis with cache clearing for fresh data
gitflow-analytics -c config.yaml --weeks 4 --clear-cache --format all# 12-week comprehensive analysis
gitflow-analytics -c config.yaml --weeks 12 --format all --verbose# Automated analysis with JSON export for dashboard integration
gitflow-analytics -c config.yaml --weeks 4 --format json --quiet# Override output directory
gitflow-analytics -c config.yaml --output-dir /custom/reports/
# Analyze subset of repositories
gitflow-analytics -c config.yaml --repositories "critical-repo,main-app"# Use cached analysis for faster reporting
gitflow-analytics -c config.yaml --weeks 8
# Clear cache for fresh analysis (slower but current)
gitflow-analytics -c config.yaml --weeks 8 --clear-cache# Verbose output for debugging
gitflow-analytics -c config.yaml --verbose
# Validate configuration before running
gitflow-analytics validate -c config.yaml --check-tokens --check-repos
# Test configuration without full analysis
gitflow-analytics -c config.yaml --validate-only# Ensure GitFlow Analytics is installed and in PATH
pip show gitflow-analytics
which gitflow-analytics
# Install if missing
pip install gitflow-analytics# Provide absolute path to configuration
gitflow-analytics -c /full/path/to/config.yaml
# Check current directory for config file
ls -la *.yaml# Check token is set correctly
echo $GITHUB_TOKEN
# Validate token has necessary permissions
gitflow-analytics validate -c config.yaml --check-tokens# Verify repository names and permissions
gitflow-analytics validate -c config.yaml --check-repos
# Check GitHub token has access to repositories- Configuration Guide - Complete YAML configuration reference
- Getting Started - Installation and first steps
- Troubleshooting - Common issues and solutions
- Examples - Real-world usage scenarios
# Add to your .bashrc or .zshrc
alias gfa='gitflow-analytics'
alias gfa-weekly='gitflow-analytics -c config.yaml --weeks 1'
alias gfa-monthly='gitflow-analytics -c config.yaml --weeks 4 --clear-cache'
alias gfa-validate='gitflow-analytics validate -c config.yaml --check-all'GitFlow Analytics supports bash completion for commands and options:
# Enable bash completion (if supported)
eval "$(_GITFLOW_ANALYTICS_COMPLETE=bash_source gitflow-analytics)"