Discover and explore top open-source AI tools and projects—updated daily.
vercel-labsFetching npm package source code for AI coding agents
Top 80.2% on SourcePulse
Summary
opensrc is a CLI tool that fetches source code for npm packages and public GitHub repositories, providing AI coding agents with deeper implementation context beyond types and documentation. It targets developers using AI assistants, enabling agents to better understand package internals for improved code comprehension and generation.
How It Works
opensrc queries the npm registry for repository URLs, detects installed package versions from lockfiles (e.g., package-lock.json), and clones the corresponding Git repository tag. Sources are stored locally in opensrc/. Optionally, it integrates with the project by adding opensrc/ to .gitignore, excluding it from tsconfig.json, and updating AGENTS.md, simplifying agent access.
Quick Start & Requirements
npm install -g opensrc or npx opensrc <package>..gitignore, tsconfig.json, AGENTS.md); use --modify to bypass.Highlighted Details
list and remove commands.Maintenance & Community
The provided README does not detail specific contributors, community channels, sponsorships, or a roadmap.
Licensing & Compatibility
Limitations & Caveats
Requires user confirmation for project file modifications unless --modify is used. Effectiveness depends on the availability and structure of public npm package repositories and GitHub sources.
1 week ago
Inactive