Go CLI that draws the GitHub contribution graph in the terminal — same as the profile calendar, for the authenticated user.
- Go 1.22+
- GitHub Personal Access Token (PAT)
go build -o github-graph .Or run directly:
go run ../github-graphOn first run (no token), the CLI prompts for the token with Charm huh and saves it to:
~/.config/github-graph/token
(directory 0700, file 0600)
On later runs the token is read from that file. If the API returns 401/403, the file is deleted and the prompt appears again.
GITHUB_TOKEN or GH_TOKEN take priority over the file and are not written to disk.
GITHUB_TOKEN=ghp_xxx ./github-graph- Open GitHub → Settings → Developer settings → Personal access tokens
- Create a classic token (or fine-grained with read access to the profile)
- Recommended minimum scope:
read:user(theviewercalendar authenticates with this)
- GraphQL:
viewer.contributionsCollection.contributionCalendar - Prompt: Charm
huh - Spinner: Charm
huh/spinner - Grid styling: Charm
lipgloss
