LinuxCommandLibrary

gh-skyline

Visualize your GitHub profile's contribution graph

TLDR

Generate a skyline STL file for the current year and authenticated user

$ gh skyline
copy

Generate a skyline for a specific user and year
$ gh skyline [[-u|--user]] [username] [[-y|--year]] [year]
copy

Generate a skyline for a range of years
$ gh skyline [[-u|--user]] [username] [[-y|--year]] [first_year]-[last_year]
copy

Generate a full skyline (from the user's join year to the current year)
$ gh skyline [[-u|--user]] [username] [[-f|--full]]
copy

Enable debug logging
$ gh skyline [[-d|--debug]]
copy

Generate a skyline and specify the output file path
$ gh skyline [[-o|--output]] [path/to/output_file.stl]
copy

Open the GitHub profile for a specific user
$ gh skyline [[-u|--user]] [username] [[-w|--web]]
copy

Display help
$ gh skyline [[-h|--help]]
copy

SYNOPSIS

gh skyline [--days <days>] [--theme <theme>] [--user <login>]

PARAMETERS

--days <days>
    Days of history to render (int, default: 365, max ~730)

--theme <theme>
    Visual style: blue, dark, gray, green, light, pink, purple (default: dark)

--user <login>
    Target GitHub username (default: authenticated user)

DESCRIPTION

The gh skyline command, part of the GitHub CLI, creates an SVG image visualizing a user's GitHub contribution graph as a stylized city skyline. Each 'building' height corresponds to daily commit counts, echoing GitHub's annual Skyline feature but available year-round. Ideal for personal sites, portfolios, or READMEs to highlight coding activity.

Defaults to 365 days for the authenticated user in dark theme. Customize with --days for timeframe (1-730 typically), --theme for colors, and --user for others' profiles. Fetches data via GitHub API, respecting rate limits.

Output is SVG to stdout—redirect to save: gh skyline > profile.svg. Requires gh auth login and internet. Only public repos/contributions shown; private activity excluded. Themes enhance shareability across dark/light modes.

CAVEATS

Public contributions only; redirect output (> file.svg).
API rate limits apply; auth required via gh auth login.
Days beyond ~2 years may lack data.

EXAMPLE

gh skyline --theme blue --days 180 --user torvalds > linux-skyline.svg
Saves Linus Torvalds' 180-day blue skyline.

EMBEDDING

Include SVG in Markdown/HTML: <img src="skyline.svg" alt="Contributions">
Resize with width/height attrs.

HISTORY

Added in GitHub CLI v0.11.0 (Sep 2020). Themes expanded in v1.x; full set by v2.0.0 (2022). Mirrors GitHub's 2016 Skyline experiment.

SEE ALSO

gh(1), git(1)

Copied to clipboard