CLI tools, REST API, and AI assistants for your workflow
Open any repo on github.gg directly from your terminal. Just type gg in any git repository.
ggOpen repo on GitHub.ggggsOpen ScorecardggdOpen DiagramAdd to ~/.bashrc or ~/.zshrc:
# GitHub.gg CLI shortcuts - Add to ~/.bashrc or ~/.zshrc
# gg - Open current repo on github.gg
alias gg="open_github"
# ggs - Open scorecard for current repo
alias ggs="open_github_scorecard"
# ggd - Open diagram for current repo
alias ggd="open_github_diagram"
open_github() {
local remote_url=$(git remote get-url origin 2>/dev/null)
if [ -z "$remote_url" ]; then
echo "Not in a git repository"
return 1
fi
local branch=$(git branch --show-current 2>/dev/null)
local github_url=$(echo "$remote_url" | sed "s|[email protected]:|https://github.gg/|" | sed "s|https://github.com/|https://github.gg/|" | sed "s|\.git$||")
if [ -n "$branch" ] && [ "$branch" != "master" ] && [ "$branch" != "main" ]; then
github_url="$github_url/tree/$branch"
fi
echo "Opening: $github_url"
xdg-open "$github_url" 2>/dev/null || open "$github_url" 2>/dev/null || echo "Open: $github_url"
}
open_github_scorecard() {
local remote_url=$(git remote get-url origin 2>/dev/null)
if [ -z "$remote_url" ]; then echo "Not in a git repository"; return 1; fi
local github_url=$(echo "$remote_url" | sed "s|[email protected]:|https://github.gg/|" | sed "s|https://github.com/|https://github.gg/|" | sed "s|\.git$||")
github_url="$github_url/scorecard"
echo "Opening: $github_url"
xdg-open "$github_url" 2>/dev/null || open "$github_url" 2>/dev/null || echo "Open: $github_url"
}
open_github_diagram() {
local remote_url=$(git remote get-url origin 2>/dev/null)
if [ -z "$remote_url" ]; then echo "Not in a git repository"; return 1; fi
local github_url=$(echo "$remote_url" | sed "s|[email protected]:|https://github.gg/|" | sed "s|https://github.com/|https://github.gg/|" | sed "s|\.git$||")
github_url="$github_url/diagram"
echo "Opening: $github_url"
xdg-open "$github_url" 2>/dev/null || open "$github_url" 2>/dev/null || echo "Open: $github_url"
}source ~/.bashrc or restart your terminal to activate.