GitHub, GitLab and Bitbucket repos
Put a repository link where a command would go. contextzip downloads one commit, packages it with the usual rules, and can send the AI's answer back as a pull request. No clone, no git.
Package a repository
contextzip asks the host which commit to use, downloads that commit as one archive and unpacks it into a local cache. From there it's an ordinary project: stack detection, exclusion rules and .env redaction all apply, and the ZIP goes on your clipboard.
~/projects/my-app
$ contextzip -n https://github.com/pallets/click/tree/main/src/click
✓ Fetched pallets/click@2247b35 · main · downloaded 505 KB
Only src/click, from the link
✓ Detected Python · medium confidence
✓ Scanned 178 files · 18 included (442 KB), 160 excluded, ≈ 113k tokens
| Host | Accepts | Private repos |
|---|---|---|
| GitHub | github.com/user/repo, …/tree/<branch>/<folder>, gh:user/repo, git@github.com:user/repo.git | GITHUB_TOKEN or your gh auth login |
| GitLab | gitlab.com/group[/subgroup]/project, …/-/tree/<branch>/<folder>, gl:group/project | GITLAB_TOKEN with read_repository |
| Bitbucket | bitbucket.org/team/repo, …/src/<branch>/<folder>, bb:team/repo | BITBUCKET_TOKEN (an access token) |
- Branches, tags, commits:
--refpicks one; a link to a branch's folder packages just that folder, and paths you name withincludeare relative to it. - Cache: each commit is downloaded once and kept in your user cache folder (the newest 3 per repository). Change it with
CONTEXTZIP_CACHE_DIR. - Limits: downloads over 250 MB are refused (
CONTEXTZIP_REMOTE_MAX_MB)..git/,.contextzip/, symlinks and unsafe paths are never unpacked. - Tokens stay put: a token is only sent to its own host's API, never to the download server.
Send the reply back as a pull request
For a GitHub repository, the AI's ZIP doesn't have to go into a clone. apply-zip --pr commits its changes on top of the exact commit you packaged, through GitHub's API, and opens a pull request:
- It finds the commit the reply answers from the snapshot in its
CONTEXTZIP.md. Without one, name the repository with--from github.com/user/repo; it never guesses. - Files are matched exactly as apply-zip matches them, so flattened paths still land in the right folders.
- Only safe changes are committed: new, modified and moved files. Cut-down or unmatched files are listed in the pull request's description instead. Removals need
--remove-moved/--allow-delete. - No push access? It forks the repository first and opens the pull request from your fork. The branch is
contextzip/<snapshot>.
It publishes
A pull request is public on a public repository. In a terminal, contextzip asks before opening it; with--json it needs --yes. Use --dry-run to see what it would contain first.Pull requests are GitHub only for now. For GitLab and Bitbucket, package from a clone and run apply-zip there.