vercel-labs/opensrc

Fetch source code for npm packages to give AI coding agents deeper context

What it solves

It provides coding agents with a way to access the actual source code of any package from various registries, allowing them to understand how a library is implemented rather than relying on outdated or incomplete documentation.

How it works

The tool provides a CLI that fetches source code from registries like npm, PyPI, crates.io, and GitHub. When a user or agent requests a path to a package's source, the tool downloads and caches it locally, returning the file path instantly on subsequent requests.

Who it’s for

Developers and AI coding agents that need to programmatically search, read, and analyze the source code of external dependencies.

Highlights

  • Supports multiple registries including npm, PyPI, crates.io, and GitHub.
  • Local caching for instant access after the first fetch.
  • CLI-based interface that integrates easily with shell commands like rg or cat.

Related

  • Project
  • Project
  • Project
  • Project
  • Project