gitchamber
v0.1.1
Published
Fetch source code for packages to give coding agents deeper context
Downloads
32
Maintainers
Readme
gitchamber
Fetch source code for packages to give coding agents deeper context.
Downloads the full repository source for npm, PyPI, or crates.io packages (and GitHub/GitLab repos) into node_modules/.gitchamber/ so agents can read the actual implementation, not just type declarations.
Install
npm install -g gitchamberUsage
# npm packages
gitchamber zod
gitchamber @babel/core
gitchamber [email protected]
# PyPI packages
gitchamber pypi:requests
gitchamber pypi:flask==3.0.0
# crates.io
gitchamber crates:serde
gitchamber crates:[email protected]
# GitHub repos
gitchamber vercel/ai
gitchamber facebook/react#main
gitchamber https://github.com/denoland/denoSource code ends up in node_modules/.gitchamber/<host>/<owner>/<repo>/.
Commands
# Fetch one or more packages/repos
gitchamber zod react vercel/ai
# List everything that's been fetched
gitchamber list
gitchamber list --json
# Remove specific packages or repos
gitchamber remove zod
gitchamber rm vercel/ai
# Remove everything
gitchamber clean
gitchamber clean --npm # only npm packages
gitchamber clean --repos # only reposHow it works
- Resolves the package through its registry API (npm registry, PyPI JSON API, crates.io API)
- Extracts the
repositoryURL from the package metadata - Shallow-clones (
git clone --depth 1) the repo at the matching version tag - Strips the
.gitdirectory to save space - Tracks everything in
node_modules/.gitchamber/sources.json
For npm packages, gitchamber detects the installed version from node_modules, lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock), or package.json -- so the source matches what you actually have installed.
Why node_modules/.gitchamber/
Fork of opensrc that stores source code in node_modules/.gitchamber/ instead of opensrc/.
Storing inside node_modules/ is better because:
- Already gitignored. Every project already ignores
node_modules/. No need to modify.gitignoreor prompt the user for permission. - Vitest ignores it. Vitest skips
node_modules/by default. Withopensrc/, test runners could pick up test files from fetched source code and try to run them. - TypeScript ignores it.
tscskipsnode_modules/by default. No need to addopensrctotsconfig.jsonexclude. - Other tools ignore it too. Linters, formatters, bundlers, search indexers -- nearly every tool in the ecosystem already knows to skip
node_modules/. Fetched source code is invisible to your toolchain by default. - No accidental commits. You can't accidentally
git addfetched source code becausenode_modules/is always ignored.
The opensrc/ approach requires modifying .gitignore, tsconfig.json, and potentially other tool configs. node_modules/.gitchamber/ needs zero configuration.
Other changes from opensrc
- Removed all file modification logic (
.gitignore,tsconfig.json,AGENTS.mdediting) - Removed the
--modifyflag and permission prompt - Uses goke instead of commander for the CLI framework
