{"id":50576515,"url":"https://github.com/tyom/repo-intel","last_synced_at":"2026-06-04T22:30:40.721Z","repository":{"id":359537979,"uuid":"1246122054","full_name":"tyom/repo-intel","owner":"tyom","description":"Generate a contributor-stats dashboard for any git repo — CLI, GitHub Action, and Homebrew.","archived":false,"fork":false,"pushed_at":"2026-05-22T16:11:29.000Z","size":1118,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-22T16:25:52.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tyom.github.io/repo-intel/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tyom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-21T22:31:52.000Z","updated_at":"2026-05-22T16:11:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tyom/repo-intel","commit_stats":null,"previous_names":["tyom/repo-intel"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tyom/repo-intel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyom%2Frepo-intel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyom%2Frepo-intel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyom%2Frepo-intel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyom%2Frepo-intel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyom","download_url":"https://codeload.github.com/tyom/repo-intel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyom%2Frepo-intel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33923173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-04T22:30:36.617Z","updated_at":"2026-06-04T22:30:40.686Z","avatar_url":"https://github.com/tyom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# repo-intel\n\nGenerate a self-contained HTML **contributor-stats dashboard** for any git\nrepo — top contributors, weekly/daily activity, time-of-day patterns,\nper-author commit feeds, plus a **language** breakdown and **framework**\ndetection from dependency manifests.\n\nThe shipped tool is a single file (`dist/repo-intel`) with the HTML template\nand detection data embedded, so it depends only on **Python 3 + `git`**\n(optional [`gh`](https://cli.github.com/) for remote repos and author\nhovercards). No install step, no third-party packages.\n\nUse it four ways:\n\n- **[Homebrew](#homebrew)** — `brew install tyom/tap/repo-intel`.\n- **[curl installer](#install-with-curl)** — drop `repo-intel` on your PATH with\n  one command.\n- **[curl-pipe](#run-without-installing)** — run the script straight from a URL,\n  no install.\n- **[GitHub Action](#github-action--publish-to-github-pages)** — publish a\n  dashboard for your repo to GitHub Pages.\n\n## GitHub Action — publish to GitHub Pages\n\nAdd a workflow (copy [`examples/pages.yml`](examples/pages.yml) to\n`.github/workflows/repo-intel.yml`):\n\n```yaml\nname: Repo Intel\non:\n  push:\n    branches: [main]\n  workflow_dispatch:\npermissions:\n  contents: read\n  pages: write\n  id-token: write\nconcurrency:\n  group: pages\n  cancel-in-progress: true\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0 # required — repo-intel reads full git history\n      - uses: tyom/repo-intel@v1 # moves with v1.x; pin @v1.0.0 to lock a version\n        with:\n          contributors: \"10\" # optional, top N\n          output: public # optional, dir for index.html\n      - uses: actions/upload-pages-artifact@v3\n        with:\n          path: public\n  deploy:\n    needs: build\n    runs-on: ubuntu-latest\n    environment:\n      name: github-pages\n      url: ${{ steps.deployment.outputs.page_url }}\n    steps:\n      - id: deployment\n        uses: actions/deploy-pages@v4\n```\n\nThen enable Pages: **Settings → Pages → Build and deployment → Source: GitHub\nActions**.\n\n\u003e **`fetch-depth: 0` is required.** `repo-intel` reads the full commit history\n\u003e in local mode; the default shallow checkout would show only one commit.\n\n### Action inputs\n\n| Input          | Default  | Description                                                        |\n| -------------- | -------- | ------------------------------------------------------------------ |\n| `contributors` | `10`     | Number of top contributors to include.                             |\n| `output`       | `public` | Directory to write the dashboard into (`index.html` inside).       |\n| `args`         | `\"\"`     | Extra flags forwarded to `repo-intel` (e.g. `--since 2024-01-01`). |\n\nThe action generates the dashboard only — you keep control of the Pages\ndeploy via `upload-pages-artifact` + `deploy-pages` (above), so the workflow's\npermissions and concurrency stay yours.\n\n## Homebrew\n\n```bash\nbrew install tyom/tap/repo-intel\n```\n\n(Resolves to the [`tyom/homebrew-tap`](https://github.com/tyom/homebrew-tap)\ntap.)\n\n## Install with curl\n\nNo Homebrew? Drop the latest release onto your PATH:\n\n```bash\ncurl -fsSL https://tyom.github.io/repo-intel/install.sh | sh\n```\n\nInstalls to `~/.local/bin/repo-intel` (override with\n`REPO_INTEL_BIN=/some/dir`). Needs only `sh`, `curl`/`wget`, and Python 3.\n\n## Run without installing\n\nPipe the artifact straight into Python — no clone, no install:\n\n```bash\ncurl -sSL https://github.com/tyom/repo-intel/releases/latest/download/repo-intel \\\n  | python3 - \u003cowner/repo\u003e\n```\n\nEverything after `python3 -` is forwarded to the script. Replace\n`\u003cowner/repo\u003e` with the GitHub repo you want stats for (e.g. `tyom/repo-intel`),\nor drop it to run against the current directory's git repo. Append `--help`\nfor the full flag reference:\n\n```bash\ncurl -sSL https://github.com/tyom/repo-intel/releases/latest/download/repo-intel \\\n  | python3 - --help\n```\n\nThe `releases/latest/download/` URL always resolves to the newest release; swap\n`latest/download` for a tag (e.g. `download/v1.0.0`) to pin a version.\n\nIn this mode stdin is the script body, so the interactive subset prompt for\nlarge remote repos is auto-skipped and the script fetches all commits — pass\n`--commits N` (or `--since` / `--until`) to trim the fetch on big repos.\n\n## Usage\n\n```\nrepo-intel [N] [REPO] [options]\n```\n\n- `N` — number of top contributors to include (default `10`).\n- `REPO` — `owner/repo`, `https://github.com/owner/repo`, or\n  `remote:owner/repo`. Omit to use the cwd's git repo.\n\nRun `repo-intel --help` for the full flag reference, or `repo-intel --version`\n(`-v`) to print the version.\n\n### Modes\n\n- **Local** — no `REPO`. Reads `git log` from the current working directory.\n- **Remote (GraphQL)** — `REPO` plus a GitHub token from\n  `gh auth token -h github.com` or `$GITHUB_TOKEN`. Fetches via the GitHub\n  GraphQL API.\n- **Remote (bare-clone fallback)** — `REPO` with no token. Clones to\n  `/tmp/repo-intel-\u003cowner\u003e-\u003crepo\u003e.git` and reads locally. Subsequent runs\n  `git fetch` the cached bare clone. Force it with `--clone` even when a token\n  is present (unlocks per-author language churn the GraphQL path can't give).\n\nThe [GitHub CLI (`gh`)](https://cli.github.com/) is optional but recommended:\nwhen authenticated (`gh auth login`), `repo-intel` uses its token to fetch\nremote repos and to enrich author cards with GitHub profile data. Without it,\nthe script falls back to `$GITHUB_TOKEN` or a bare clone.\n\n### Filtering commits\n\n| Flag                 | Meaning                                                                  |\n| -------------------- | ------------------------------------------------------------------------ |\n| `--commits N`        | Last `N` commits (newest)                                                |\n| `--commits A-B`      | Positions `[A, B)` counted from the oldest commit (0-indexed, half-open) |\n| `--since YYYY-MM-DD` | Commits on or after the date (inclusive)                                 |\n| `--until YYYY-MM-DD` | Commits on or before the date (inclusive)                                |\n\nFilters compose: date bounds apply first, then the position slice. The run\nprints `filtered: X/total commits` so you can see what was kept.\n\nWhen a remote repo has more than 1000 commits and no filter flag was passed,\n`repo-intel` prompts interactively for a subset (Last 500, Last 1000, Past\nyear, or All) on the GraphQL path. The prompt is skipped on the bare-clone\nfallback, when stdin/stderr is not a TTY, or when any filter flag is given.\n\n### Output\n\n| Flag                | Default                                                                                        |\n| ------------------- | ---------------------------------------------------------------------------------------------- |\n| `--format LIST`     | `html`. Comma-separated, repeatable: `html`, `json`, `md` (e.g. `--format html,json,md`)       |\n| `-o, --output PATH` | `/tmp/\u003cowner\u003e--\u003crepo\u003e.\u003cext\u003e` (or `/tmp/\u003crepo\u003e.\u003cext\u003e` for a local repo without a GitHub origin) |\n| `--no-open`         | Opens the **HTML** result in your default browser unless given                                 |\n\n`json` is the raw analysis data (the same object the HTML embeds); `md` is a\nMarkdown report — totals, a top-contributors table, language/framework\nbreakdowns, tags, and recent commits — for reading or feeding to an LLM.\n\nWith a single `--format`, `-o PATH` is used verbatim. With several, `-o` is a\nstem and each format appends its own extension (`-o ./stats` → `stats.html`,\n`stats.json`, `stats.md`). Only the HTML artifact is ever opened in a browser.\n`--output` creates parent directories if they don't exist.\n\n### Cache\n\nRemote runs cache commit nodes per repo under `$XDG_CACHE_HOME/repo-intel`\n(default `~/.cache/repo-intel`), one JSON file per repo. The next run\npaginates from HEAD and stops at the first already-cached SHA, so only new\ncommits hit the network.\n\n- `--no-cache` — ignore the cache and re-fetch everything.\n- Delete the relevant `\u003cowner\u003e-\u003crepo\u003e.json` to force a fresh fetch for one repo.\n\n### Examples\n\n```bash\nrepo-intel                                            # cwd, top 10\nrepo-intel 20                                         # cwd, top 20\nrepo-intel tyom/repo-intel                            # remote, top 10\nrepo-intel --commits 100 facebook/react               # last 100 commits\nrepo-intel --commits 0-100 facebook/react             # first 100 commits\nrepo-intel --since 2024-01-01 --until 2024-12-31 .    # all of 2024 in cwd\nrepo-intel --no-open -o ./stats.html tyom/repo-intel  # save without opening\nrepo-intel --format json,md facebook/react            # JSON + Markdown, no HTML\nrepo-intel --format html,json,md -o ./out             # all three: out.{html,json,md}\nrepo-intel facebook/react --clone                     # analyse via bare clone\n```\n\n## Development\n\n| File                      | Purpose                                                                                            |\n| ------------------------- | -------------------------------------------------------------------------------------------------- |\n| `repo-intel.py`           | The script. Holds `TEMPLATE` + `TECHDATA` placeholders until bundled                               |\n| `web/`                    | Frontend app (Svelte 5 + Vite + TypeScript). `bun run build` → `web/dist/index.html`               |\n| `web/src/App.svelte`      | Root component — composes the dashboard from the `lib/components/` pieces                          |\n| `web/src/lib/components/` | Dashboard UI as Svelte components — heatmap, table, charts, cards, popovers (one `.svelte` each)   |\n| `web/src/lib/`            | Shared engine helpers: ECharts registration, the canvas timeline, popover state, theme, formatting |\n| `techdata.json`           | Generated language + framework detection data (committed; embedded at build)                       |\n| `gen_techdata.py`         | Regenerates `techdata.json` from GitHub Linguist + a curated framework map                         |\n| `build.py`                | Substitutes the `TEMPLATE` / `TECHDATA` lines with their data as a `repr()`                        |\n| `dist/repo-intel`         | The built single-file artifact (committed; this is what curl/Action/Homebrew use)                  |\n\nThe frontend is built with [Bun](https://bun.sh). It compiles to a single\nself-contained `web/dist/index.html` (all JS + CSS inlined, Apache ECharts\nbundled, no CDN) that still carries the `/*__DATA_INJECTION__*/` marker; `build.py` embeds\nthat HTML into `repo-intel.py`. Bun/Vite are **build-time only** — the shipped\ntool is still a zero-dependency Python script.\n\n```bash\nmake install-hooks   # one-time per clone: auto-rebuild dist on commit\nmake web-dev         # frontend dev server with HMR (renders web/public/mock-data.json)\nmake build           # rebuild the frontend bundle + dist/repo-intel\nmake techdata        # regenerate techdata.json from Linguist (needs network)\nmake dev ARGS=\"3 facebook/react\"   # build frontend, then run from source live\nmake format          # format the whole repo (Prettier + Ruff)\nmake check           # run all static checks — Prettier + Ruff + svelte-check (mirrors CI)\n```\n\n`make web-dev` runs Vite's dev server with hot-reload against\n`web/public/mock-data.json`, so you can iterate on the UI without the Python\nside. `make dev` builds the frontend then runs the unbundled script (it detects\n`TEMPLATE` is still the placeholder and reads `web/dist/index.html` /\n`techdata.json` from disk).\n\n\u003e Commit `dist/repo-intel` alongside source changes — CI fails if it's stale.\n\u003e Run `make install-hooks` once after cloning: it points `core.hooksPath` at\n\u003e the tracked `.githooks/`, whose `pre-commit` rebuilds the frontend bundle and\n\u003e stages `dist/repo-intel` whenever you commit a change to `repo-intel.py`,\n\u003e `techdata.json`, or anything under `web/`. (This needs Bun installed; the\n\u003e first rebuild after a clone runs `bun install`.) The weekly `refresh-techdata`\n\u003e workflow rebuilds it automatically when Linguist changes.\n\n### Releasing\n\nRun the **Cut release** workflow (Actions → _Cut release_ → _Run workflow_) and\nenter a version like `1.2.3`. It validates main, re-runs the CI gates and a\nsmoke test against that exact commit, and only then tags `vX.Y.Z` — so a tag is\nnever created for a red build. The tag drives the rest automatically: the\n`Release` workflow builds and publishes the GitHub release (with generated\nnotes) + the single-file asset, smoke-tests the published artifact, moves the\nfloating `vX` major tag (skipped for prereleases, and guarded so it can only\npoint at a commit on `main`), and bumps the [`tyom/homebrew-tap`](https://github.com/tyom/homebrew-tap)\nformula. Nothing is manual per release beyond entering the number.\n\nPushing a `vX.Y.Z` tag by hand still works as a fallback and runs the same\n`Release` workflow — but it skips the pre-tag build gate, so prefer _Cut\nrelease_.\n\n**Syncing tags locally.** Because `Release` _force-moves_ the floating `vX`\nmajor tag onto each new release commit, a plain `git fetch --tags` refuses to\nupdate it (`! [rejected] vX -\u003e vX (would clobber existing tag)`). Pull the\nrealigned tags with:\n\n```sh\ngit fetch --tags --force --prune origin\n```\n\nThe `vX.Y.Z` tags are immutable and always fetch cleanly; only the floating\n`vX` tag needs `--force`.\n\n### Detection data (`techdata.json`)\n\nLanguage detection (extension/filename → language, colors, vendored-path noise\nfilter) is generated from [GitHub Linguist](https://github.com/github-linguist/linguist)\n— `languages.yml` (with fine-grained languages folded into their `group`, e.g.\n`TSX`→`TypeScript`) and `vendor.yml`. Frameworks are a small curated\ndependency → framework map maintained in `gen_techdata.py`. `techdata.json` is\ncommitted and embedded into the artifact, so the shipped tool stays offline and\nsingle-file.\n\n### How the embedding works\n\n`build.py` looks for exactly one occurrence each of:\n\n```python\nTEMPLATE = \"__TEMPLATE_PLACEHOLDER__\"\nTECHDATA = \"__TECHDATA_PLACEHOLDER__\"\n```\n\nand replaces them with `TEMPLATE = \u003crepr(template_html)\u003e` and\n`TECHDATA = \u003crepr(techdata_json)\u003e`, producing a valid Python file carrying\nboth as string literals. The runtime substitution of `/*__DATA_INJECTION__*/`\nwith `window.__DATA__ = {...}` still happens inside `main()`.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyom%2Frepo-intel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyom%2Frepo-intel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyom%2Frepo-intel/lists"}