Gain insights into your GitHub repos, public or private — powered by Rust and token auth.
  • Rust 95.5%
  • CSS 4.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-08-10 14:56:58 -03:00
.github/workflows Update release.yml 2025-06-29 20:34:15 +09:00
dist feat: make Rust CLI executable as a standalone binary and support GITHUB_TOKEN via CLI argument 2025-06-29 18:58:30 +09:00
output update: language stats svg 2025-07-21 07:19:09 +00:00
src fix: improve language exclusion logic to be case insensitive 2025-08-10 14:56:58 -03:00
.gitignore Update .gitignore 2025-06-08 00:15:26 +09:00
Cargo.lock feat: make Rust CLI executable as a standalone binary and support GITHUB_TOKEN via CLI argument 2025-06-29 18:58:30 +09:00
Cargo.toml feat: make Rust CLI executable as a standalone binary and support GITHUB_TOKEN via CLI argument 2025-06-29 18:58:30 +09:00
LICENSE chore: add license and update Cargo.toml details 2025-06-08 16:58:51 +09:00
readme.md doc: update usage section 2025-06-29 22:20:22 +09:00

Self-Reposcope 🔍

Badge Rust License

stats

  • GitHub の 言語使用量を SVG で可視化する CLI ツールRust 製)
    A lightweight CLI tool built with Rust to visualize your GitHub language stats as SVG charts.
  • プライベートリポジトリにも対応
    Supports private repositories

できること / Features

  • GitHub API を用いて、自分のリポジトリを網羅的に集計
    Aggregates all your repositories using the GitHub API

  • 各言語の使用量(バイト数)を積み上げ棒グラフで SVG 出力
    Outputs an SVG stacked bar chart based on language usage (in bytes)

  • プライベートリポジトリも対象(アクセストークン使用)
    Supports private repositories (with access token)

  • GitHub Actions での自動集計&更新
    Automatically updates via GitHub Actions

背景 / Background

GitHub の使用言語統計を可視化する「Stats 系」リポジトリは多く存在します。
しかし、その多くは public リポジトリ限定だったり、導入手順が複雑だったりと、気軽に使えるものが少ないと感じていました。

たとえば、会社アカウントと個人アカウントを使い分けている開発者にとっては、
private リポジトリ中心の活動が可視化されないという課題があります。
自分の技術スタックをもっとアピールしたいけど、それができない ——

そこで、private リポジトリにも対応し、安全かつ「1 クリックで導入できる」ような体験を提供することを目指して、このツールself-reposcopeを開発しました。


There are many "GitHub Stats" repositories out there that visualize language usage in your repositories.
However, most of them are limited to public repositories or have complex installation steps,
which makes them less accessible for casual use.

For developers who use both personal and company accounts,
activity in private repositories often goes unrepresented
even though thats where most of their work happens.
You might want to showcase your real tech stack — but you simply cant.

So I built self-reposcope,
a tool that supports private repositories and offers a safe, one-click setup experience.

使い方 / Usage

Repository にて、下記のように設定すると./outputを生成し、SVG を出力します。
By setting up the following workflow in your GitHub repository, self-reposcope will automatically generate SVG files in the ./output directory.

  1. Repository の Settings > Secrets and variables > Actions > [Repository secrets] > [New repository secret]
    Name: REPOSCOPE_TOKEN, Secret: ghp_XXXXXXXXXXXXXXX
    (repo 権限付き GitHub Token) を追加
    Go to Settings > Secrets and variables > Actions > [Repository secrets],
    then add a new secret with:

    • Name: REPOSCOPE_TOKEN
    • Value: your personal access token (with repo scope)
  2. .github/workflows/reposcope.yml を作成し、以下のように記述:
    Create a workflow file at .github/workflows/reposcope.yml with the following content:

name: Update Language Stats

on:
    schedule:
        - cron: "0 0 * * 1" # Every Monday
    workflow_dispatch:

jobs:
    build:
        runs-on: ubuntu-latest
        permissions:
            contents: write

        steps:
            - name: Checkout target repo
              uses: actions/checkout@v3

            - name: Download self-reposcope binary from GitHub Release
              shell: bash
              run: |
                  curl -L https://github.com/4okimi7uki/self-reposcope/releases/latest/download/self-reposcope -o self-reposcope
                  chmod +x ./self-reposcope

            - name: Run self-reposcope CLI
              shell: bash
              run: |
                  mkdir -p output
                  ./self-reposcope --token ${{ secrets.REPOSCOPE_TOKEN }}

            - name: Commit and Push updated SVGs
              shell: bash
              env:
                  GH_PAT: ${{ secrets.REPOSCOPE_TOKEN }}
              run: |
                  git config --global user.name 'github-actions[bot]'
                  git config --global user.email 'github-actions[bot]@users.noreply.github.com'
                  git add output/*.svg
                  if git diff --cached --quiet; then
                    echo "No changes to commit"
                  else
                    git commit -m "update: language stats svg"
                    git push https://x-access-token:${GH_PAT}@github.com/${{ github.repository }} HEAD:main
                  fi
  1. 手動実行(Actions > Update Language Stats > Run workflow) または 自動で毎週更新されます。差分がなければ新規出力されません。

    You can run the workflow manually (Actions > Update Language Stats > Run workflow), or it will automatically run every Monday. If there are no changes in the output, nothing will be committed.

🧪 ローカルで試す / Try It Locally (Rust CLI)

実行環境 / Requirements

  • Rust 1.87.0+ (with cargo)
  1. リポジトリに対してアクセス権のある GitHub token を用意
    Prepare a GitHub personal access token with access to your repositories
  2. このリポジトリをクローン
    Clone this repo
  3. .envファイルを作成して、GitHub token を設定:
    Add your GitHub token to .env
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxx
  1. 下記コマンドで実行:
    Run with:
cargo run --release
  1. ./output*.svgファイルが出力されていることを確認
    Check that the *.svg files are generated in the ./output directory

2025 Aoki Mizuki Developed with 🍭 and a sense of fun.