whichlangs
whichlangs shows the programming-language breakdown of a user's or
organization's repositories on a Gitea or Forgejo instance.
It aggregates the byte counts returned by the instance's language API. The result is therefore weighted toward larger repositories, rather than counting repositories equally.
Install
go install foundry.fsky.io/kruno/whichlangs@latest
Usage
whichlangs [flags] <url>
Examples:
whichlangs https://foundry.fsky.io/kruno
whichlangs https://codeberg.org/forgejo
whichlangs https://foundry.fsky.io/fsky -no-forks -top 10
whichlangs https://foundry.fsky.io/fsky -json -sort name
whichlangs https://foundry.fsky.io/fsky -exclude HTML,CSS
whichlangs https://foundry.fsky.io/fsky -exclude Go -exclude Rust
The URL should contain the instance host and the user or organization name.
Authentication
Public repositories can usually be queried without a token. For private or
restricted repositories, set GITEA_TOKEN or FORGEJO_TOKEN:
GITEA_TOKEN=your-token whichlangs https://codeberg.org/kruno
The -token flag is also available, but environment variables avoid exposing
the token in shell history or process listings.
Flags
-no-forksexcludes forked repositories.-top Nlimits the displayed languages after exclusions are applied.-sort bytes|namesorts by byte count or language name.-exclude NAME[,NAME...]removes languages case-insensitively from the result. The option can also be repeated. Excluded languages are removed from the total bytes and percentages.-jsonemits machine-readable JSON on stdout; progress messages go to stderr.
Repositories that are inaccessible or unavailable are reported separately in the output. Language percentages describe the repositories that were successfully analyzed, after any exclusions.
License
0BSD. See LICENSE.