@cvr/repo
v1.0.0
Published
Multi-registry source code cache manager. Fetch and cache source code from GitHub, npm, PyPI, and Crates.io.
Downloads
50
Readme
repo
Multi-registry source code cache manager. Fetch and cache source code from GitHub, npm, PyPI, and Crates.io.
Inspired by vercel-labs/opensrc.
Features
- Source-first: Package registries (npm, PyPI, Crates) resolve to source git repos when possible, with tarball fallback
- Multi-registry: GitHub, npm, PyPI, Crates.io support
- Shallow clones: Default depth of 100 commits for fast fetching
- Auto-update: Re-fetching updates existing git repos
- Global cache: All repos cached at
~/.cache/repo/
Installation
# Clone and build
git clone https://github.com/cevr/repo.git
cd repo
bun install
bun run build
# Link globally
bun linkQuick Start
# Fetch a GitHub repo
repo fetch vercel/next.js
# Fetch an npm package (resolves to source repo)
repo fetch npm:[email protected]
# Get the cached path
repo path vercel/next.js
# List all cached repos
repo list
# Search across all cached repos
repo search "createServer"Spec Formats
| Format | Example |
|--------|---------|
| GitHub | owner/repo, owner/[email protected] |
| npm | npm:lodash, npm:@effect/[email protected] |
| PyPI | pypi:[email protected] |
| Crates | crates:[email protected] |
Commands
| Command | Description |
|---------|-------------|
| repo fetch <spec> | Fetch/update repository |
| repo path <spec> | Get cached path |
| repo info <spec> | Show repository metadata |
| repo list | List cached repos |
| repo search <query> | Search across cached repos |
| repo stats | Cache statistics |
| repo remove <spec> | Remove from cache |
| repo prune | Remove old/large repos |
| repo clean | Clear entire cache |
| repo open <spec> | Open in editor |
See SKILL.md for detailed usage.
Storage
~/.cache/repo/
├── metadata.json # Index
├── {owner}/{repo}/ # GitHub repos
└── {package}/{version}/ # Package registriesTech Stack
- Bun - Runtime
- Effect - Functional TypeScript
- @effect/cli - CLI framework
Credits
Inspired by vercel-labs/opensrc - a tool for exploring open source projects.
License
MIT
