feat: support for private repositories
is it possible to add support for private repos (by way of token or some other secure auth measure)?
Hi @yucchan and others — great news!
Private-repo support just landed on main via PR #282 (merged 2025-06-15). You can already ingest a private repository from the CLI or Python API:
# PAT needs at least the “repo” (or narrower “repo:read”) scope
export GITHUB_TOKEN=github_pat_********
# any of these work
gitingest https://github.com/my-user/my-private-repo # uses env-var
gitingest https://github.com/my-user/my-private-repo --token <PAT>
gitingest -t <PAT> https://github.com/my-user/my-private-repo
from gitingest import ingest
ingest("https://github.com/my-user/my-private-repo", token="<PAT>")
How it works
- The token (
github_pat_*,ghp_*, etc.) is injected intogitviahttp.https://github.com/.extraheader, so partial clones, sparse-checkout and commit pins behave exactly as they do for public repos. - Public-repo workflows stay unchanged — if there’s no token, no auth header is sent.
What’s next
| Timeline | Scope |
|---|---|
| Later this week | PyPI release of the core library & CLI with PAT support t. |
| Afterwards | A separate follow-up PR will surface a PAT field in the gitingest.com web UI. |
In the meantime you can grab the development build:
pip install --pre --upgrade git+https://github.com/cyclotruc/gitingest.git
To generate a GitHub Personal Access Token (PAT), go to (Profile → Settings → Developer Settings → Personal Access Tokens → Fine-grained Tokens), or click here.
Let me know if you run into any issues — happy to help! 🎉
Great! Is there some way that I am missing to utilize this if I am running gitingest in a docker container?
I tried to pass in an .env file to the docker run:
docker run -d --name gitingest -p 8000:8000 --env-file .env gitingest
, but I am getting the error
From what I can tell, it hasn't attempted to utilize the token that I passed in, as it is showing in github as never used
Great! Is there some way that I am missing to utilize this if I am running gitingest in a docker container?
I tried to pass in an .env file to the docker run:
docker run -d --name gitingest -p 8000:8000 --env-file .env gitingest, but I am getting the error
From what I can tell, it hasn't attempted to utilize the token that I passed in, as it is showing in github as
never used
Hi, the private repo support in the web UI has not yet been merged with main, nor released to PyPI. This pending PR https://github.com/cyclotruc/gitingest/pull/286 will add this. I have asked @cyclotruc to review the PR. Until then, you can try checkout the feature branch https://github.com/cyclotruc/gitingest/tree/feat/private-repo-support-ui.
@yucchan @RyandenOtter It should be working now.
Hi @yucchan and @RyandenOtter!
Private repo support in the web UI has been merged with main and will soon be released to PyPI. The hosted version on gitingest.com has been updated.
When trying that feature on the web UI, I'm getting
Error: invalid literal for int() with base 10: "000HTTP/2 404 \r\ndate: Thu, 03 Jul 2025 14:02:06 GMT\r\ncontent-type: application/json; charset=utf-8\r\nx-github-media-type: github.v3; format=json\r\nx-github-api-version-selected: 2022-11-28\r\na
I created the token using the suggested way in the web UI.