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)
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 jsonManage 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 "developer@example.com" \
--alias "dev@personal.com" \
--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 "alice@company.com" \
--alias "alice@gmail.com" \
--alias "Alice Smith"
# Preview changes before writing
gfa add-alias -c config.yaml \
--canonical "alice@company.com" \
--alias "alice@gmail.com" \
--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: "alice@company.com" aliases: ["alice@gmail.com", "Alice Smith"]
-
Flat YAML list — a list of
{canonical, aliases}objects:- canonical: "alice@company.com" aliases: - alice@gmail.com - Alice Smith - canonical: "bob@company.com" aliases: - bob@personal.com
-
JSON array — equivalent structure in JSON:
[ {"canonical": "alice@company.com", "aliases": ["alice@gmail.com", "Alice Smith"]}, {"canonical": "bob@company.com", "aliases": ["bob@personal.com"]} ]
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
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)"