The extension uses your existing GitHub CLI authentication. If you haven't authenticated yet:
gh auth login# View help and available commands
gh repo-stats-plus --help
# Gather repository statistics for an organization
gh repo-stats-plus repo-stats --org-name my-org
# Find repositories missing from a CSV file
gh repo-stats-plus missing-repos --org-name my-org --file my-repos.csv
# Count ProjectsV2 linked to repositories
gh repo-stats-plus project-stats --org-name my-orggh repo-stats-plus repo-stats --org-name my-orggh repo-stats-plus repo-stats --org-name my-org --resume-from-last-savegh repo-stats-plus repo-stats \
--org-name my-org \
--app-id YOUR_APP_ID \
--private-key-file key.pem \
--app-installation-id INSTALLATION_IDgh repo-stats-plus missing-repos --org-name my-org --file output.csv
gh repo-stats-plus repo-stats --org-name my-org --auto-process-missing# Count ProjectsV2 linked to repositories via issues
gh repo-stats-plus project-stats --org-name my-org
# Process specific repos from a list
gh repo-stats-plus project-stats --org-name my-org --repo-list repos.txt
# Multiple organizations
gh repo-stats-plus project-stats --org-list orgs.txt --continue-on-error# Process multiple organizations sequentially
# Each organization automatically maintains its own state file
gh repo-stats-plus repo-stats --org-name org1
gh repo-stats-plus repo-stats --org-name org2
gh repo-stats-plus repo-stats --org-name org3
# Use custom output directory (state files are stored here too)
gh repo-stats-plus repo-stats \
--org-name my-org \
--output-dir ./reports
# Clean up state files after successful completion
gh repo-stats-plus repo-stats \
--org-name my-org \
--clean-stategh repo-stats-plus repo-stats --org-name myorg --output-format jsongh repo-stats-plus missing-repos --org-name myorg --file expected-repos.csvgh repo-stats-plus repo-stats --org-name myorg --resume-from-last-save# Create a file with repositories to process
echo "owner/repo1
owner/repo2
owner/repo3" > repos-to-process.txt
# Run the command
gh repo-stats-plus repo-stats --org-name myorg --repo-list repos-to-process.txtgh repo-stats-plus repo-stats --org-name myorg --auto-process-missingThe extension supports multiple authentication approaches:
When using GitHub CLI authentication, you can use your personal access token. The extension will automatically use the token configured with gh auth login.
For GitHub App authentication, you can pass additional parameters:
gh repo-stats-plus repo-stats \
--org-name myorg \
--app-id 12345 \
--private-key-file /path/to/key.pem \
--app-installation-id 67890For organizations with many repositories, consider these best practices:
Always use the resume functionality for large organizations:
gh repo-stats-plus repo-stats --org-name large-org --resume-from-last-saveThe extension provides detailed logging. Check the logs directory for progress updates and any issues:
ls -la logs/The extension automatically handles GitHub API rate limits, but you can adjust the behavior:
gh repo-stats-plus repo-stats \
--org-name myorg \
--rate-limit-check-interval 30 \
--retry-max-attempts 5The extension generates several output files:
- CSV file: Contains the repository statistics (saved in
./output/by default) - State file (
last_known_state_<org>.json): Tracks processing progress for each organization (saved in output directory) - Log files: Detailed logging information in the
logs/directory
- Each organization has its own state file (e.g.,
last_known_state_myorg.json) - State files are stored in the output directory alongside CSV files
- State files enable resuming from interruptions
- Use
--output-dirto specify where both output and state files are saved - Use
--clean-stateto automatically remove state files after successful completion - Legacy
last_known_state.jsonfiles (without organization suffix) will trigger a warning
- Start with a test run on a smaller organization first
- Use the resume feature for any interruptions
- Process multiple organizations without conflicts - each maintains its own state
- Organize files using
--output-dirfor cleaner workspace (both CSV and state files go here) - Clean up state files with
--clean-stateafter successful runs - Check logs if you encounter issues
- Verify authentication before running large jobs
- Keep backups of important CSV output files