{"id":14069384,"url":"https://github.com/mona-actions/gh-repo-stats","last_synced_at":"2025-07-30T05:32:08.459Z","repository":{"id":37950673,"uuid":"484188777","full_name":"mona-actions/gh-repo-stats","owner":"mona-actions","description":"GH CLI extension to pull statistics on repository metadata used in GitHub migrations","archived":false,"fork":false,"pushed_at":"2025-05-21T02:15:32.000Z","size":1202,"stargazers_count":255,"open_issues_count":9,"forks_count":136,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-05-22T10:21:18.153Z","etag":null,"topics":["gh-extension"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mona-actions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-21T20:02:36.000Z","updated_at":"2025-05-18T11:22:09.000Z","dependencies_parsed_at":"2023-01-28T01:16:10.909Z","dependency_job_id":"a48dc470-4b2f-4058-8110-2c007e71e719","html_url":"https://github.com/mona-actions/gh-repo-stats","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mona-actions/gh-repo-stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-actions%2Fgh-repo-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-actions%2Fgh-repo-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-actions%2Fgh-repo-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-actions%2Fgh-repo-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mona-actions","download_url":"https://codeload.github.com/mona-actions/gh-repo-stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mona-actions%2Fgh-repo-stats/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267815187,"owners_count":24148356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gh-extension"],"created_at":"2024-08-13T07:06:54.888Z","updated_at":"2025-07-30T05:32:07.975Z","avatar_url":"https://github.com/mona-actions.png","language":"Shell","funding_links":[],"categories":["⭐ Most Starred","gh-extension","Shell","Security/Admin"],"sub_categories":[],"readme":"# Get Repository Statistics\n\n`gh repo-stats` scans an organization or list of organizations for all repositories and gathers size statistics, key to understanding how long a migration of the data from one instance of **GitHub** to another will take.\n\n## Quickstart\n\n`gh repo-stats` was designed to work with GitHub.com as well as GitHub Enterprise Server 2.20 or newer.\n\n1. Install [GitHub CLI](https://cli.github.com/)\n1. Install [jq](https://stedolan.github.io/jq/download/)\n1. `gh extension install mona-actions/gh-repo-stats`\n1. `gh repo-stats --org \u003cORG_NAME\u003e`\n1. Profit! 💰 💸 🤑 💸 💰\n\n## Usage\n\n```shell\n$ gh repo-stats --help\n\nUsage: gh repo-stats [options]\n\nOptions:\n     -d, --debug                   : Enable Debug logging\n     -e, --extra-page-size         : Set the pagination size for subsequent, paginated GraphQL queries; reduce if timeout occurs\n                                     Default: 50\n     -h, --help                    : Show script help\n     -H, --hostname                : The GitHub hostname for the request\n                                     Default: github.com\n     -i, --input                   : Set path to a file with a list of organizations to scan, one per line, newline delimited\n     -o, --org                     : Name of the GitHub Organization to be analyzed\n     -O, --output                  : Format of output, can either be \"CSV\" or \"Table\"\n                                     Default: CSV\n     -p, --repo-page-size          : Set the pagination size for the initial repository GraphQL query; reduce if timeout occurs\n                                     Default: 10\n                                     If a timeout occurs, reduce this value\n     -r, --analyze-repo-conflicts  : Checks the Repo Name against repos in other organizations and generates a list\n                                     of potential naming conflicts if those orgs are to be merged during migration\n    -rl, --repo-list               : Path to a file with a list of repositories to scan, one per line, newline delimited\n     -t, --token                   : Set Personal Access Token with repo scope\n                                     Default: token for hostname via gh auth token\n     -T, --analyze-team-conflicts  : Gathers each org's teams and checks against other orgs to generate a list of\n                                     potential naming conflicts if those orgs are to be merged during migration\n     -y, --token-type              : Type of Personal Access, can either be \"user\" or \"app\"\n                                     Default: user\n\nDescription:\n  Scans an organization or list of organizations for all repositories and gathers size statistics for each repository\n\nExample:\n  gh repo-stats -o my-org-name\n  gh repo-stats -o my-org-name -H github.example.com\n```\n\n## Permissions\n\n`gh repo-stats` uses the permissions of the authenticated accounts setup with [`gh auth login`](https://cli.github.com/manual/gh_auth_login) or [environment variables supported by `gh`](https://cli.github.com/manual/gh_help_environment).\n\nThe permissions needed by `gh repo-stats` depends based on `-y, --token-type`:\n\n- `user`: `admin:org`, `user:all`, and `repo:all`\n- `app` with [GitHub App server-to-server token](https://docs.github.com/en/developers/overview/managing-deploy-keys#server-to-server-tokens) with `Read-only` permissions to the following:\n  - Repository Administration\n  - Repository Contents\n  - Repository Issues\n  - Repository Metadata\n  - Repository Projects\n  - Repository Pull requests\n  - Organization Members\n\n## Output\n\n`gh repo-stats` produces either a visual table or `*.csv` file containing detailed information about various records within repositories.\n\n```csv\nOrg_Name,Repo_Name,Is_Empty,Last_Push,Last_Update,isFork,isArchive,Repo_Size(mb),Record_Count,Collaborator_Count,Protected_Branch_Count,PR_Review_Count,Milestone_Count,Issue_Count,PR_Count,PR_Review_Comment_Count,Commit_Comment_Count,Issue_Comment_Count,Issue_Event_Count,Release_Count,Project_Count,Branch_Count,Tag_Count,Discussion_Count,Has_Wiki,Full_URL,Migration_Issue,Created\ntinyfists,actions-experiments,false,2023-03-10T16:15:27Z,2022-10-28T19:38:34Z,false,false,0,19,18,0,0,0,0,1,0,0,0,0,0,0,2,0,0,true,https://github.com/tinyfists/actions-experiments,FALSE,2020-01-01T13:37:00Z\ntinyfists,git-xargs,false,2022-12-09T03:44:39Z,2022-11-01T03:19:49Z,false,false,0,19,18,0,0,0,0,1,0,0,0,0,0,0,2,0,0,true,https://github.com/tinyfists/git-xargs,FALSE,2020-01-01T13:37:00Z\ntinyfists,githubcustomer,false,2022-06-04T17:00:43Z,2022-05-10T03:05:16Z,false,false,0,25,18,0,0,0,4,0,0,0,0,3,0,0,1,0,0,true,https://github.com/tinyfists/githubcustomer,FALSE,2020-01-01T13:37:00Z\ntinyfists,issue-driven-github-admin,false,2022-12-09T03:44:36Z,2022-10-14T22:03:38Z,false,false,2,1644,37,1,1,0,140,4,1,0,897,552,10,1,4,10,1,true,https://github.com/tinyfists/issue-driven-github-admin,FALSE,2020-01-01T13:37:00Z\ntinyfists,multi-runner-poc,false,2022-12-09T03:43:30Z,2022-08-03T12:44:35Z,false,false,0,19,18,0,0,0,0,1,0,0,0,0,0,0,2,0,0,true,https://github.com/tinyfists/multi-runner-poc,FALSE,2020-01-01T13:37:00Z\ntinyfists,pages-demo,false,2022-12-09T03:43:29Z,2022-11-17T23:44:50Z,false,false,0,19,18,0,0,0,0,1,0,0,0,0,0,0,2,0,0,true,https://github.com/tinyfists/pages-demo,FALSE,2020-01-01T13:37:00Z\ntinyfists,publish-packages-to-repo-demo,false,2022-12-09T03:43:31Z,2021-10-11T19:39:32Z,false,false,0,24,18,0,0,0,0,3,0,0,0,3,0,0,2,0,0,true,https://github.com/tinyfists/publish-packages-to-repo-demo,FALSE,2020-01-01T13:37:00Z\n```\n\n**Columns**\n\n- `Org_Name`: Organization login\n- `Repo_Name`: Repository name\n- `Is_Empty`: Whether the repository is empty; only available for GitHub.com and GHES \u003e= 3.0\n- `Last_Push`: Date/time when a push was last made\n- `Last_Update`: Date/time when an update was last made\n- `isFork`: Whether the repository is a fork\n- `isArchive`: Whether the repository is archived\n- `Repo_Size(mb)`: Size of the repository in megabytes\n- `Record_Count`: Number of database records this repository represents\n- `Collaborator_Count`: Number of users who have contributed to this repository\n- `Protected_Branch_Count`: Number of branch protection rules on this repository\n- `PR_Review_Count`: Number of pull request reviews\n- `Milestone_Count`: Number of issue milestones\n- `Issue_Count`: Number of issues\n- `PR_Count`: Number of pull requests\n- `PR_Review_Comment_Count`: Number of pull request review comments\n- `Commit_Comment_Count`: Number of commit comments\n- `Issue_Comment_Count`: Number of issue comments\n- `Issue_Event_Count`: Number of issues\n- `Release_Count`: Number of releases\n- `Project_Count`: Number of v1 projects\n- `Branch_Count`: Number of branches\n- `Tag_Count`: Number of tags\n- `Discussion_Count`: Number of discussions\n- `Has_Wiki`: Whether the repository has wiki feature enabled; unable to tell whether user via API\n- `Full_URL`: Repository URL\n- `Migration_Issue`: Indicates whether the repository might have a problem during migration due to\n  - 60,000 or more number of objects being imported\n  - 1.5 GB or larger size on disk\n- `Created`: Date/time when the repository was created\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmona-actions%2Fgh-repo-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmona-actions%2Fgh-repo-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmona-actions%2Fgh-repo-stats/lists"}