GH Repo Cartographer
Quick Start
Use the bundled script for deterministic inventory work. From this skill or repository directory:
python scripts\gh_repo_cartographer.py --include-pages --include-releases --output github-repo-map.md --json-output github-repo-map.json
The script:
- Reads managed account aliases from
gh-account-routerwhen available. - Resolves each alias to its canonical GitHub login with
gh api user. - Lists repositories owned by each resolved login, with a REST API fallback when
gh repo listGraphQL calls time out. - Resolves router URL aliases such as
https://github.com/just-agent, saihaoto the canonical GitHub login. - Optionally fetches GitHub Pages status/URL and latest release metadata for every repository.
- Scans local Git repositories under configured roots.
- Matches local remotes to
github.com/owner/repo. - Fetches remotes by default, then compares
HEADwith@{u}to reportsynced,behind,ahead,diverged,no-upstream, orno-local-copy.
Common Options
- Add scan roots with repeated
--scan-root <path>. If omitted, the script usesGH_REPO_CARTOGRAPHER_ROOTSwhen set, otherwise the current directory. - Add account aliases with repeated
--account <alias>. If omitted, aliases are discovered fromgh-account-router. - Set
GH_ACCOUNT_ROUTERwhengh-account-routeris installed somewhere other than~/.codex/skills/gh-account-router/scripts/gh_account_router.py. - Use
--no-fetchonly when the user explicitly wants a faster offline check; mark results as based on stale local remote refs. - Use
--include-pageswhen building a Pages matrix or homepage preview index. - Use
--include-releaseswhen building a release hub or project matrix with release badges. - Use
--max-depth <n>to widen or narrow local scanning. - Use
--output <file>for a Markdown report and--json-output <file>for downstream README automation.
Reporting Guidance
Summarize the Markdown report in the final answer:
- Number of remote repositories found.
- Number of repositories with GitHub Pages.
- Number of repositories with releases.
- Number matched to local folders.
- Repositories that are
behind,ahead,diverged, dirty, or missing local copies. - Local repositories with GitHub remotes outside the managed accounts.
- The report paths created.
Never print raw tokens or access-file contents. If authentication fails, report the account alias/login and the GitHub error after token redaction.
README Optimization Workflow
After generating the map, use it to prioritize README work:
- Start with repositories that have local matches and are
synced. - For
behindordivergedrepos, ask before editing README content unless the user clearly asked to update local branches. - For
no-local-copyrepos, recommend cloning before README optimization. - Use the JSON report when batching README audits or generating dashboards.