Loading...
Loading...
Fetch source code for npm, PyPI, or crates.io packages and GitHub/GitLab repos to provide AI agents with implementation context beyond types and docs. Use when needing to understand how a library works internally, debug dependency issues, or explore package implementations.
npx skill4agent add deloreyj/.dotfiles opensrc# Install globally or use bunx
bun add -g opensrc
# Fetch npm package (auto-detects installed version from lockfile)
bunx opensrc zod
# Fetch from other registries
bunx opensrc pypi:requests # Python/PyPI
bunx opensrc crates:serde # Rust/crates.io
# Fetch GitHub repo directly
bunx opensrc vercel/ai # owner/repo shorthand
bunx opensrc github:owner/repo # explicit prefix
bunx opensrc https://github.com/colinhacks/zod # full URL
# Fetch specific version/ref
bunx opensrc zod@3.22.0
bunx opensrc owner/repo@v1.0.0| Command | Description |
|---|---|
| Fetch source for packages/repos |
| List all fetched sources |
| Remove specific source |
| Remove all sources |
opensrc/opensrc/
├── settings.json # User preferences
├── sources.json # Index of fetched packages/repos
└── repos/
└── github.com/
└── owner/
└── repo/ # Cloned source code.gitignoreopensrc/tsconfig.jsonopensrc/AGENTS.md--modify--modify=falsenode_modulespackage-lock.jsonpnpm-lock.yamlyarn.lockrepository.directory--depth 1.gitv{version}{version}# Agent needs to understand zod's implementation
bunx opensrc zod
# → Detects version from lockfile
# → Finds repo URL from npm registry
# → Clones at matching git tag
# → Source available at opensrc/repos/github.com/colinhacks/zod/# Re-run same command to update to currently installed version
bunx opensrc zod
# → Checks if version changed
# → Re-clones if needed# Fetch multiple at once
bunx opensrc react react-dom next
bunx opensrc zod pypi:pydantic vercel/ai