@mkrz/cocon
v0.0.4
Published
Clone npm package source code for agentic coding tool context
Downloads
451
Readme
Cocon
cocon is a Bun + TypeScript tool that fetches npm package source code repositories into a shared cache to give agentic coding tools better context.
It has two runtime surfaces:
- A terminal CLI (
cocon) - An MCP server binary (
cocon-mcp)
Package sources are always stored in ~/.cocon/packages.
When you pull for a project, cocon also creates symlinks in ./node_modules/.cocon so the project has local entry points into the shared cache.
CLI commands
pull
Pull and cache package repository source.
cocon pull <packages...>sync
Prefetch and cache repository sources for all dependencies in package.json in parallel.
Uses resolved project versions (installed version when available).
cocon syncstatus
Show installed vs cached versions, missing targets, and the version each package should pull.
cocon statusprune
Remove old/unused cached versions while honoring keep rules.
cocon prune [--keep-latest <count>] [--no-keep-project-dependencies] [--keep <package@version...>] [--dry-run]list
List all cached package versions in the shared cache.
cocon listget
Get cached source info for one package in the shared cache (without downloading).
If multiple versions are cached, all matches are returned unless --version is supplied.
cocon get [--version <version>] <packageName>MCP tools
get_package_source: resolve installed version from a project and fetch source if neededsync_project_dependencies: prefetch cache for all project dependencies in parallelget_cache_status: show installed vs cached versions and missing target cache entriesprune_cache: prune old/unused cache versions with keep ruleslist_cached_package_sources: list all package cache entries in the shared cacheget_cached_package_source: inspect existing cached package entries in the shared cache
