CLI tool that fetches dependency source code for LLM context.
LLM coding agents have outdated training data and can't read documentation in real-time. When they help you use a library, they work from memory, which leads to hallucinated APIs and incorrect usage patterns.
dotdeps solves this by cloning dependency source code to .deps/ where your agent can read it. Repositories are cached globally and symlinked into projects, so fetching is fast after the first clone.
-
Install:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/davidturnbull/dotdeps/releases/latest/download/dotdeps-installer.sh | sh
-
Initialize in your project:
dotdeps init
This creates .deps/, updates .gitignore, and adds usage instructions to AGENTS.md (or CLAUDE.md if it exists).
Run dotdeps update periodically to get the latest version:
dotdeps updateUse dotdeps update --check to check for updates without installing.
Initialize dotdeps in the current directory.
dotdeps init [OPTIONS]--skip-gitignore- Skip adding.deps/to.gitignore--skip-instructions- Skip adding usage instructions toAGENTS.md/CLAUDE.md--dry-run- Preview actions without making changes--json- Output results as JSON
Add a dependency to .deps/.
dotdeps add [OPTIONS] <ecosystem>:<package>[@<version>]<ecosystem>- Package ecosystem:python,node,rust,go,ruby,swift<package>- Package name@<version>- Optional version (defaults to lockfile version)
--dry-run- Preview actions without making changes--json- Output results as JSON
dotdeps add python:requests # version from lockfile
dotdeps add python:[email protected] # explicit version
dotdeps add node:lodash
dotdeps add node:@types/node # scoped packages
dotdeps add rust:serde
dotdeps add go:github.com/gin-gonic/gin
dotdeps add ruby:rails
dotdeps add swift:AlamofireRemove a dependency from .deps/.
dotdeps remove [OPTIONS] <ecosystem>:<package>--dry-run- Preview actions without making changes--json- Output results as JSON
dotdeps remove python:requestsList all dependencies in .deps/.
dotdeps list [OPTIONS]--json- Output results as JSON
Output LLM-ready dependency context. This prints instructions that tell your agent which dependencies are available and how to fetch more.
dotdeps context [OPTIONS]--json- Output results as JSON
dotdeps context searches upward from the current directory to find lockfiles. In monorepos or nested project layouts, this means dependencies from a parent directory's lockfile may be included. Run from the specific project directory you want to analyze.
Remove the .deps/ directory.
dotdeps clean [OPTIONS]--dry-run- Preview actions without making changes--json- Output results as JSON
| Ecosystem | Lockfiles | Repo detection |
|---|---|---|
python |
poetry.lock, uv.lock, requirements.txt, pyproject.toml | PyPI API |
node |
pnpm-lock.yaml, yarn.lock, package-lock.json, bun.lock | npm registry |
rust |
Cargo.lock | crates.io API |
go |
go.sum | Module path |
ruby |
Gemfile.lock | RubyGems API |
swift |
Package.resolved | Lockfile URL |
Optional config file at ~/.config/dotdeps/config.json:
{
"cache_limit_gb": 5,
"overrides": {
"python": {
"some-private-lib": {
"repo": "https://github.com/myorg/some-private-lib"
}
}
}
}Maximum cache size in GB. Default: 5. Set to 0 for unlimited.
Cache eviction uses LRU (least recently used) based on filesystem access time.
Per-ecosystem, per-package repository URL overrides.
Use for: private packages, libraries without proper metadata, or forks.
For automatic context injection with Claude Code, add this alias to ~/.bashrc or ~/.zshrc:
alias claude='command claude --append-system-prompt "$(dotdeps context)"'This injects dependency context into every Claude Code session, so Claude automatically knows which dependencies are available and how to fetch more.
dotdeps addresolves the version (explicit or from lockfile)- Checks cache at
~/.cache/dotdeps/<ecosystem>/<package>/<version>/ - If not cached, clones the repository (shallow clone with tag resolution)
- Creates symlink at
.deps/<ecosystem>/<package>/ - LRU cache eviction when limit exceeded
- opensrc - Fetch source for npm packages
- better-context - Query library source with AI
MIT