{"id":22918028,"url":"https://github.com/callmegreg/gh-language","last_synced_at":"2026-04-02T12:43:59.310Z","repository":{"id":157671452,"uuid":"633589041","full_name":"CallMeGreg/gh-language","owner":"CallMeGreg","description":"A gh CLI extension to analyze languages in GitHub Organizations.","archived":false,"fork":false,"pushed_at":"2025-03-13T00:27:10.000Z","size":8259,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T01:02:45.649Z","etag":null,"topics":["gh-extension"],"latest_commit_sha":null,"homepage":"","language":"Go","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/CallMeGreg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-27T20:58:33.000Z","updated_at":"2024-11-26T20:09:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"97dd8a4f-8773-4217-ad7e-b518e3ac93db","html_url":"https://github.com/CallMeGreg/gh-language","commit_stats":{"total_commits":33,"total_committers":5,"mean_commits":6.6,"dds":0.5757575757575757,"last_synced_commit":"6ef6f3dd1fcf87b0cf1230d920cd8e04c4d0fd57"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CallMeGreg%2Fgh-language","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CallMeGreg%2Fgh-language/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CallMeGreg%2Fgh-language/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CallMeGreg%2Fgh-language/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CallMeGreg","download_url":"https://codeload.github.com/CallMeGreg/gh-language/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253789834,"owners_count":21964754,"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","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-12-14T06:28:23.842Z","updated_at":"2026-04-02T12:43:59.302Z","avatar_url":"https://github.com/CallMeGreg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Language Analyzer\n\nThis is an extension to the `gh` command-line tool for analyzing the count of programming languages used in repositories across a GitHub enterprise or organization. It retrieves a list of repositories and their associated languages, and then aggregates the data to produce a report of language frequency.\n\n\u003e [!NOTE]\n\u003e If you are looking to compare your language frequency against public trends, you can access quarterly data from 2020 onward [here](https://innovationgraph.github.com/global-metrics/programming-languages) as part of GitHub's [Innovation Graph](https://innovationgraph.github.com/) project.\n\n## Pre-requisites\n\n1. Install the GitHub CLI: https://github.com/cli/cli#installation\n2. Confirm that you are authenticated with an account that has access to the enterprise/org you would like to analyze:\n\n```\ngh auth status\n```\n\nEnsure that you have the necessary scopes. For example, if you are analyzing an organization, you need the `repo` scope and for enterprises you need the `read:enterprise` scope. You can add scopes by running:\n\n```\ngh auth login -s \"repo,read:enterprise\"\n```\n\n\u003e [!IMPORTANT]\n\u003e Enterprise owners do not inherently have access to all of the repositories across their organizations. You must ensure that your account has the necessary permissions to access the repositories you want to analyze.\n\n## Installation\n\nTo install this extension, run the following command:\n```\ngh extension install CallMeGreg/gh-language\n```\n\n## Usage\n\n\u003e [!TIP]\n\u003e Each command has default limits to prevent accidental excessive API usage. You can adjust these limits using the `--org-limit` and `--repo-limit` flags. To analyze all repositories in an organization or enterprise, set these flags to a very high number (e.g., `1000000`).\n\n### Universal Flags\n\nThe following flags are available for all commands:\n- `--org` or `--enterprise` (`-e`): Specify the organization or enterprise slug to analyze. These flags are mutually exclusive, and one of them is required.\n- `--org-limit`: Limit the number of organizations to analyze (default is 5).\n- `--repo-limit`: Limit the number of repositories to analyze per organization (default is 10).\n- `--top`: Return the top N languages (default is 10).\n- `--language`: Filter results by one or more programming languages, specified as a comma-separated list (case-sensitive).\n- `--codeql`: Restrict analysis to CodeQL-supported languages.\n- `--github-enterprise-server-url` (`-u`): GitHub Enterprise Server URL (e.g., github.company.com) (default is \"github.com\").\n\n\u003e [!NOTE]\n\u003e The `--top`, `--language`, and `--codeql` flags are mutually exclusive.\n\nWhen the `--codeql` flag is set, the analysis will only include the following languages:\n- C\n- C++\n- C#\n- Go\n- HTML\n- Java\n- Kotlin\n- JavaScript\n- Python\n- Ruby\n- Swift\n- TypeScript\n- Vue\n\n### Count command\n\nDisplay the count of each programming language used in repos across an enterprise or organization.\n```\ngh language count --org microsoft\n```\n\n![count](demo/count.gif)\n\nWhen the `--codeql` flag is set, the analysis will filter for only CodeQL-supported languages, and also display the number of unique repositories that include at least one CodeQL-supported language:\n```\ngh language count --org microsoft --repo-limit 300 --codeql\n```\n\n![count-codeql](demo/count-codeql.gif)\n\n### Trend command\n\nDisplay the breakdown of programming languages used in repos across an enterprise or organization per year, based on the repo creation date. The output includes:\n\n- **Line Graph** — A multi-series line chart showing how each language's adoption has changed over time.\n- **Year-by-Year Breakdown** — Detailed per-year tables with trend direction and year-over-year deltas compared to the prior year.\n\n```\ngh language trend --org microsoft\n```\n\n![trend](demo/trend.gif)\n\nThe `trend` command also supports optional year range filtering:\n- `--min-year`: Only include years greater than or equal to this value.\n- `--max-year`: Only include years less than or equal to this value (defaults to last year).\n\n```\ngh language trend --org microsoft --repo-limit 500 --max-year 2015\n```\n\n![trend-filtered](demo/trend-filtered.gif)\n\n### Data command\n\nAnalyze languages by bytes of data, rather than count, across repositories in an enterprise or organization.\n```\ngh language data --org microsoft\n```\n\n![data](demo/data.gif)\n\nSpecify the unit for displaying data with the `--unit` flag. Supported units are `bytes`, `kilobytes`, `megabytes`, and `gigabytes`. The default is `bytes`:\n```\ngh language data --org microsoft --unit megabytes\n```\n\n### Targeting enterprises and/or GitHub Enterprise Server\n\nRather than targeting a specific organization, you can analyze across an entire enterprise, which may include multiple organizations. To do this, use the `--enterprise` (`-e`) flag instead of `--org`.\n\nRegardless of whether you are targeting an enterprise or organization, you can also specify a GitHub Enterprise Server URL with the `--github-enterprise-server-url` (`-u`) flag. By default, the tool targets `github.com`.\n\nCombining these into one example, the following command counts languages across all repositories in an enterprise hosted on a GitHub Enterprise Server:\n```\ngh language count --enterprise github -u callmegreg-db6woz.ghe-test.net --org-limit 1000000 --repo-limit 1000000\n```\n\n![ghes](demo/ghes.gif)\n\n### Performance\n\nThe `count` and `trend` commands have been optimized to use GitHub's GraphQL API, which provides significant performance improvements over the REST API. These commands are expected to run ~100x faster than `data`.\n\nThe `data` command continues to use the REST API as it requires detailed byte-level language statistics that are only available through the REST endpoint.\n\n### Help\n\nFor help, run:\n```\ngh language -h\n```\n\n``` \nUsage:\n  language [command]\n\nAvailable Commands:\n  count       Analyze the count of programming languages used in repos across an enterprise or organization\n  data        Analyze the programming languages used in repos across an enterprise or organization based on bytes of data\n  help        Help about any command\n  trend       Analyze the trend of programming languages used in repos across an enterprise or organization over time\n\nFlags:\n      --codeql                                Restrict analysis to CodeQL-supported languages (mutually exclusive with --language, --top)\n  -e, --enterprise string                     GitHub Enterprise slug (e.g., github)\n  -u, --github-enterprise-server-url string   GitHub Enterprise Server URL (e.g., github.company.com) (default \"github.com\")\n  -h, --help                                  help for language\n  -l, --language string                       A comma-separated list of languages to filter on (case-sensitive, mutually exclusive with --codeql, --top)\n  -o, --org string                            Specify the organization\n      --org-limit int                         The maximum number of organizations to analyze for an enterprise (default 5)\n      --repo-limit int                        The maximum number of repositories to analyze per organization (default 10)\n  -t, --top int                               Return the top N languages (mutually exclusive with --language, --codeql) (default 10)\n\nUse \"gh language [command] --help\" for more information about a command.\n```\n\n## License\nThis tool is licensed under the MIT License. See the [LICENSE](https://github.com/CallMeGreg/gh-language/blob/main/LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmegreg%2Fgh-language","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcallmegreg%2Fgh-language","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmegreg%2Fgh-language/lists"}