Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2025-05-09 18:49:36 +02:00
commit 47a45d72a9
14 changed files with 739 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
package main
import (
"context"
"flag"
"fmt"
"os"
"github.com/charmbracelet/log"
"github.com/google/go-github/v72/github"
)
func main() {
var username string
var token string
flag.StringVar(&username, "username", "", "Target username")
flag.StringVar(&token, "token", "", "Github token")
flag.Parse()
if username == "" {
fmt.Println("Please provide a username with the --username flag")
os.Exit(1)
}
err := parseUsername(username)
if err != nil {
log.Error("Invalid username", "err", err)
os.Exit(1)
}
client := github.NewClient(nil)
if token == "" {
log.Info(
"It's recommended to set a Github token for better rate limits. You can set it using the --token flag.",
)
} else {
client = client.WithAuthToken(token)
}
ctx := context.Background()
header()
userInfo(client, ctx, username)
orgs(client, ctx, username)
keys(client, ctx, username)
socials(client, username)
commits(client, ctx, username)
}