Dev.to WebDev ๐Ÿ›  Dev ๐Ÿ‘ 0 ๐Ÿ“– 5 min read

I turned my GitHub contribution graph into a Bloomberg-style trading terminal

TL;DR: Your green contribution squares are a heatmap. I wanted a chart. So I built gh-trading-terminal: a GitHub Action that renders your real contribution calendar as a TradingView / Bloomberg-style terminal, as one sel

I turned my GitHub contribution graph into a Bloomberg-style trading terminal

TL;DR: Your green contribution squares are a heatmap. I wanted a chart.
So I built gh-trading-terminal: a GitHub Action that renders your real contribution calendar as a TradingView / Bloomberg-style terminal, as one self-contained SVG you drop into your profile README.

๐Ÿ”— Repo: hanzlabaig-dev/gh-trading-terminal (MIT, Node 18.3+, 0 dependencies)

gh-trading-terminal preview in the dark theme
The preview uses synthetic sample data. Yours uses your real contribution calendar.

๐Ÿงญ What's inside the terminal

Every panel is plain SVG, and you choose which ones to show:

Panel What it draws show name
๐Ÿ•ฏ๏ธ Candlesticks One daily candle per day, with a pulsing candle for the current UTC day (always on)
๐Ÿ”Š Volume Raw contributions per day under the chart volume
๐Ÿ“Š Analytics 10 stats: total, avg/day, active days, current and longest streak, best day, volatility (ฯƒ), Sharpe, max drawdown, best weekday stats
๐ŸŸฉ Heatmap Last 26 weeks, weekday ร— week heatmap
๐Ÿ“ˆ Weekly volume Last 12 weeks, with week-over-week change weekly
๐Ÿ—“๏ธ Monthly close Last 6 months, with month-over-month change monthly
๐Ÿงพ Ticker tape A scrolling strip of your key numbers tape
ใ€ฐ๏ธ SMA A 20-period moving average line sma
๐ŸŒซ๏ธ Bands A ยฑ2ฯƒ band around the same 20-period window bands

Everything is on by default except bands (use show: all to turn it on).

๐Ÿ’ก The header also shows your Developer Index, a fictional 0 to 1000 score, with a sparkline and a pulsing LIVE dot.

โšก Setup in 3 steps (no server, no hosting)

Step 1: Add a workflow

In your profile repo (USERNAME/USERNAME), create .github/workflows/terminal.yml:

name: Update trading terminal
on:
  schedule: [{ cron: '17 */6 * * *' }]
  workflow_dispatch:
permissions:
  contents: write
jobs:
  terminal:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: hanzlabaig-dev/gh-trading-terminal@v1
        with:
          days: 90
          theme: tradingview
          token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}

Step 2: Run it once

Go to the Actions tab โ†’ Update trading terminal โ†’ Run workflow.
It renders and commits two files:

  • assets/terminal-dark.svg
  • assets/terminal-light.svg

Step 3: Embed it in your profile README.md

This <picture> block follows the viewer's light/dark theme:

<picture>
  <source media="(prefers-color-scheme: light)" srcset="assets/terminal-light.svg">
  <img src="assets/terminal-dark.svg" width="100%" alt="GitHub contribution trading terminal">
</picture>

๐Ÿ”’ Want your private contributions included?
  1. Create a token with the read:user scope.
  2. Save it as the repo secret GH_PAT.
  3. Enable "Private contributions" in your GitHub profile settings.

If the default token is rejected, use GH_PAT. That's why the workflow reads secrets.GH_PAT || secrets.GITHUB_TOKEN.

๐ŸŽ›๏ธ Action inputs

input default notes
username repo owner any GitHub login
days 90 14 to 730
theme / light-theme tradingview / light tradingview, bloomberg, midnight, light
output-dir assets where the SVGs are written
show all but bands stats,heatmap,weekly,monthly,volume,tape,sma,bands or all
extra-args (empty) any CLI flag, e.g. --colorblind true --hide tape --up #00ff88
commit true set false to handle commits yourself

๐ŸŽจ The four themes
Theme Look
tradingview the default dark theme (navy background, teal/red candles)
bloomberg amber text on pure black, green/red candles
midnight GitHub-dark style palette
light the default for terminal-light.svg

โ™ฟ Colorblind mode and custom colors

Colorblind mode swaps the candle colors to blue (up) and orange (down):

- uses: hanzlabaig-dev/gh-trading-terminal@v1
  with:
    extra-args: "--colorblind true --hide tape --up #00ff88"

โš ๏ธ Quote the extra-args value. In YAML, an unquoted # starts a comment, so --up #00ff88 would silently get cut off.

Color flags: --up, --down, --bg. The smoothing factor is --alpha (default 0.5, clamped to 0.1 to 0.9).


๐Ÿงฎ How the numbers work

GitHub only exposes daily contribution totals, so real intraday OHLC data does not exist.
Instead, candles are a deterministic mapping of your real counts. Nothing is fabricated.

The "price" is an exponential moving average (EMA) of your daily activity:

level(t) = level(t-1) + alpha * (count(t) - level(t-1))

From that level, each candle is built like this:

open  = level(t-1)
close = level(t)
high  = max(open, close, count(t), count(t-1))
low   = min(open, close, count(t), count(t-1))
  • ๐ŸŸข green when close >= open (the day beat the running level)
  • ๐Ÿ”ด red otherwise

A few details I like:

  • Volume is the raw count per day. Huge spikes are clipped to a sensible axis limit and marked with a small triangle, so one monster day can't flatten the whole chart.
  • An empty in-progress day does not break your current streak yet. The day isn't over.
  • The current UTC day is drawn as a pulsing, translucent candle, because that session is still open.

The Developer Index (0 to 1000)

A rolling 28-day blend of four components. It's fictional, but fully reproducible:

Component Weight How it's computed
Active-day ratio 35% share of days in the window with at least 1 contribution
Intensity 25% log(1 + mean) / log(1 + 10), capped at 1
Streak 20% current streak รท 14 days, capped at 1
Stability 20% 1 - min(1, stdDev / mean / 3)

Two more stats complete the picture:

  • Sharpe = mean รท standard deviation of your daily counts
  • Max drawdown = the worst peak-to-trough fall of the Developer Index

โš ๏ธ It's a joke index with real math behind it. Not financial advice, and not a performance review either.

๐Ÿงฑ The constraint that shaped everything

GitHub serves README images through an image proxy that blocks scripts, CSS and web fonts. So the SVG is built to survive that:

  • โœ… plain SVG attributes only (no <style>, no scripts, no external references)
  • โœ… a system monospace font stack
  • โœ… SMIL for all animation: the pulsing candle, the LIVE dot and the scrolling tape
  • โœ… works in any <img> tag
  • โœ… self-contained: about 38 KB at 90 days, and still under about 100 KB at the 730-day maximum

The test suite even enforces it: every theme is rendered and asserted to contain no <script>, <style>, <foreignObject> or external URLs.

Other things worth knowing:

  • GraphQL allows under a year per query, so longer ranges are chunked automatically (360-day chunks, de-duplicated by date).
  • GitHub caches images, so changes can take a few minutes to show. The SVG prints its own UPDATED time.
  • Commits made by the Action bot don't count as your contributions. (No infinite-green-squares exploit, sorry.)

๐Ÿ› ๏ธ Other ways to run it

CLI (Node 18.3+, zero dependencies):

git clone https://github.com/hanzlabaig-dev/gh-trading-terminal && cd gh-trading-terminal
npm test
npm run demo        # synthetic data, no token needed
GITHUB_TOKEN=xxx node src/cli.js --user YOU --from 2026-01-01 --to 2026-11-22 --theme bloomberg --out terminal.svg

๐Ÿšฉ All CLI flags
--user --days --from --to --theme --show --hide
--animate false --colorblind true
--up --down --bg --alpha --demo --out

Live URL (optional): deploy to Vercel, set GITHUB_TOKEN, and use this as the image URL (served by api/terminal.js, cached for 1 hour):

https://YOUR-APP.vercel.app/api/terminal?user=YOU&theme=bloomberg&days=120

โœ… Tested

npm test runs 6 tests with Node's built-in test runner. They cover candle invariants, streak logic, rendering every theme safely, display toggles and input validation, the chunked GraphQL fetch, and the Action's entrypoint script. CI runs them on Node 18, 20 and 22.

๐Ÿค Contributing

PRs are welcome, and the layout is easy to navigate:

You want to add... Look in
a new theme src/themes.js
layout changes src/render.js
new metrics src/analytics.js

Run npm test before opening a PR.

๐ŸŽฌ Try it

  1. โญ Star the repo: hanzlabaig-dev/gh-trading-terminal
  2. Drop the workflow into your profile repo
  3. Tell me in the comments: what's your Developer Index? ๐Ÿ“ˆ

Which panel or metric should I add next? Let me know below. ๐Ÿ‘‡

๐Ÿ“ฐ Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.