Just a shell script.

Requirements: curl, jq, GNU Coreutils

1
2
3
4
5
6
7
8
9
#!/bin/sh
 
sizeof()
{
    curl -s https://api.github.com/repos/$1 | jq '.size' | numfmt --to=iec --from-unit=1024
}
 
size=$(sizeof $1)
echo $size

Usage

Pass username/repo as argument to the script.