opensrc
ModelFreeFetch source code for npm packages to give AI coding agents deeper context
Capabilities14 decomposed
multi-registry package discovery and resolution
Medium confidenceAutomatically resolves package names across npm, PyPI, and Crates.io registries by querying their respective APIs (registry.npmjs.org, pypi.org, crates.io) to discover the authoritative Git repository URL for a given package and version. Uses registry-specific parsing logic to extract repository metadata from package manifests, handling version pinning and tag/commit matching to ensure the cloned source corresponds exactly to the installed dependency version.
Unified registry abstraction layer supporting npm, PyPI, and Crates.io with version-aware tag/commit matching, rather than requiring separate tools per ecosystem or manual URL lookup
Faster than manual GitHub searches and more reliable than regex-based repository URL extraction because it queries authoritative registry APIs and matches exact installed versions to Git commits
version-aware git repository cloning with tag matching
Medium confidenceClones Git repositories (from GitHub, GitLab, or direct URLs) and checks out the specific Git tag or commit corresponding to the installed package version. Uses simple-git library for Git operations and implements a version-to-tag resolution strategy that handles semantic versioning, pre-release tags, and commit hashes. Stores cloned repositories in a local opensrc/ directory structure with metadata tracking to enable incremental updates and deduplication.
Implements version-aware tag/commit resolution that matches installed package versions to exact Git commits, with metadata-driven incremental updates, rather than always cloning latest main or requiring manual version specification
More reliable than simple git clone + git checkout because it queries registry metadata to find the correct tag before cloning, avoiding failed checkouts on version mismatches
pypi registry integration for python package source code
Medium confidenceQueries the PyPI registry (pypi.org) to resolve Python package names to Git repository URLs and match installed versions to Git tags. Parses package metadata from PyPI's JSON API to extract the Home-page or Project-URL fields, handles version specifiers, and resolves them to specific Git commits. Supports the pypi: prefix syntax to distinguish Python packages from npm packages in the CLI.
Extends opensrc to Python ecosystem via PyPI registry integration with pypi: prefix syntax, enabling unified source code fetching across npm and Python dependencies
Enables polyglot projects to use a single tool for dependency source code fetching instead of separate npm and Python-specific tools; more convenient than manual PyPI lookups because it automates repository discovery
crates.io registry integration for rust package source code
Medium confidenceQueries the Crates.io registry to resolve Rust crate names to Git repository URLs and match installed versions to Git tags. Parses crate metadata from Crates.io's API to extract the repository field, handles semantic versioning, and resolves versions to specific Git commits. Supports the crates: prefix syntax to distinguish Rust crates from npm packages in the CLI.
Extends opensrc to Rust ecosystem via Crates.io registry integration with crates: prefix syntax, enabling unified source code fetching across npm, Python, and Rust dependencies
Enables polyglot projects to use a single tool for all dependency source code instead of separate tools per language; more convenient than manual Crates.io lookups because it automates repository discovery and version matching
direct git repository url support with version pinning
Medium confidenceAccepts direct Git repository URLs (https://github.com/user/repo or git+ssh://git@github.com/user/repo) as package specifiers, bypassing registry lookup. Allows developers to fetch source code from arbitrary Git repositories and pin specific versions via Git tags or commit hashes. Useful for private repositories, forks, or packages not published to standard registries.
Supports direct Git URLs as first-class package specifiers, bypassing registry lookup entirely and enabling private repository support, rather than requiring registry-published packages only
More flexible than registry-only tools because it supports private repositories and custom forks; more convenient than manual git clone because it integrates with opensrc's metadata and cleanup workflows
github and gitlab repository resolution with shorthand syntax
Medium confidenceSupports shorthand syntax for GitHub and GitLab repositories (e.g., 'facebook/react', 'github:vercel/next.js', 'gitlab:gitlab-org/gitlab') that automatically constructs the full Git URL and resolves to the appropriate Git host API. Handles GitHub and GitLab API queries to discover repository metadata and version tags without requiring full HTTPS URLs. Supports both public and private repositories with appropriate authentication.
Provides GitHub/GitLab shorthand syntax (owner/repo) that automatically resolves to full Git URLs and queries host APIs for metadata, rather than requiring full HTTPS URLs or manual repository lookup
More convenient than full Git URLs because it uses familiar GitHub/GitLab shorthand; more discoverable than direct URLs because it queries host APIs for available versions and metadata
ai agent context injection via agents.md generation
Medium confidenceAutomatically generates and updates an AGENTS.md file in the project root that documents all fetched source code locations, versions, and directory structures. This metadata file is designed to be consumed by AI coding agents (like Claude, GPT-4, or custom LLM-based tools) to understand what source code is available locally and how to reference it in prompts. The file is updated incrementally as packages are fetched or removed, maintaining a single source of truth for agent context.
Generates a dedicated AGENTS.md metadata file specifically designed for AI agent consumption, rather than relying on agents to discover source code via filesystem scanning or requiring manual context injection in prompts
More efficient than manually documenting dependency source locations in prompts because it centralizes metadata in a file that agents can reference, reducing token usage and improving consistency across multiple agent interactions
incremental package fetch with deduplication and update detection
Medium confidenceImplements a fetch command that intelligently manages local source code by detecting previously cloned packages, comparing installed versions against cached metadata, and only cloning new or updated packages. Uses a metadata index (stored as JSON in opensrc/.opensrc.json or similar) to track package names, versions, clone timestamps, and repository URLs. Supports batch fetching of multiple packages in a single command with progress reporting and error handling for failed clones.
Implements metadata-driven incremental fetching with deduplication that skips already-cloned packages and only updates changed versions, rather than always performing full clones or requiring manual tracking of what's been fetched
Faster than running git clone for every package because it maintains a metadata index and skips clones for unchanged versions; more reliable than filesystem-based detection because metadata is explicit and version-aware
package removal and cleanup with metadata synchronization
Medium confidenceProvides remove and clean commands that delete cloned source code from the opensrc/ directory and synchronize the metadata index. The remove command deletes specific packages by name, while the clean command removes all fetched source code and resets the metadata index. Both commands update AGENTS.md to reflect removed packages, ensuring the agent context file stays in sync with actual available source code.
Provides both granular (remove specific packages) and bulk (clean all) cleanup operations with automatic metadata and AGENTS.md synchronization, rather than requiring manual directory deletion and metadata updates
More reliable than manual rm -rf because it updates metadata and agent context atomically, preventing orphaned metadata entries or stale agent references
list and inspect fetched packages with metadata reporting
Medium confidenceImplements a list command that displays all currently fetched packages with their versions, repository URLs, clone timestamps, and local directory paths. Reads the metadata index to provide a structured view of available source code without scanning the filesystem. Supports filtering and formatting options to help developers understand what's available and when it was last updated.
Provides metadata-driven listing that reads from an index rather than filesystem scanning, enabling fast queries and structured output without I/O overhead
Faster than ls -la opensrc/ because it reads pre-computed metadata; more reliable than filesystem-based detection because it reflects the actual state tracked by opensrc
typescript configuration integration for source code indexing
Medium confidenceIntegrates with project TypeScript configuration (tsconfig.json) to optionally index fetched source code paths and make them resolvable by TypeScript compiler and IDEs. Manages path mappings or baseUrl settings to enable developers and AI agents to import from fetched source code using standard module resolution, rather than relative paths to opensrc/ directories. Handles tsconfig.json parsing, modification, and restoration to avoid conflicts with existing configurations.
Automatically manages TypeScript path mappings to make fetched source code resolvable via standard module resolution, rather than requiring manual tsconfig.json edits or relative path imports
More convenient than manual path mapping because it automatically generates entries for all fetched packages; more reliable than relative imports because it uses TypeScript's standard resolution mechanism
gitignore management for opensrc directory
Medium confidenceAutomatically manages .gitignore entries to exclude the opensrc/ directory and its contents from version control. Detects existing .gitignore files, appends opensrc/ entry if not already present, and handles edge cases like missing .gitignore files or existing opensrc entries. Ensures that fetched source code is not committed to the repository, reducing repository size and avoiding merge conflicts when dependencies are updated.
Automatically manages .gitignore entries for opensrc/ directory as part of the fetch workflow, rather than requiring manual .gitignore edits or relying on developers to remember to exclude the directory
More reliable than manual .gitignore edits because it's integrated into the fetch command and prevents accidental commits; more convenient than post-hoc git rm --cached because it prevents the problem before it occurs
command-line interface with commander.js argument parsing
Medium confidenceProvides a CLI built with Commander.js that exposes four primary commands (fetch, list, remove, clean) with argument parsing, option flags, and help documentation. Handles command dispatch, error handling, and user feedback through console output. Supports both global installation (npm install -g opensrc) and npx usage without installation, making the tool accessible to developers without setup overhead.
Uses Commander.js for declarative command routing and argument parsing, providing a standard CLI interface with built-in help and error handling, rather than custom argument parsing logic
More maintainable than custom argument parsing because Commander.js handles edge cases and provides consistent help formatting; more user-friendly than raw Node.js process.argv because it validates arguments and provides clear error messages
npm registry integration with version resolution
Medium confidenceQueries the npm registry (registry.npmjs.org) to resolve package names to Git repository URLs and match installed versions to Git tags. Parses package.json metadata from the registry to extract the repository field, handles version specifiers (exact versions, ranges, pre-releases), and resolves them to specific Git tags or commit hashes. Supports both public npm packages and scoped packages (@org/package), with fallback logic for packages with non-standard repository metadata.
Implements npm-specific registry integration with version-aware tag resolution and scoped package support, rather than generic Git URL lookup or requiring manual repository specification
More reliable than GitHub API searches because it uses authoritative npm registry metadata; more efficient than cloning and inspecting package.json because it queries the registry API directly
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with opensrc, ranked by overlap. Discovered automatically through the match graph.
Package Registry Search
** - Search and get up-to-date information about NPM, Cargo, PyPi, and NuGet packages.
these
instructions to install `uv` / `uvx` and [these](https://pip.pypa.io/en/stable/installation/) to install `pip`.
octocode-mcp
MCP server for semantic code research and context generation on real-time using LLM patterns | Search naturally across public & private repos based on your permissions | Transform any accessible codebase/s into AI-optimized knowledge on simple and complex flows | Find real implementations and live d
mcp-gateway-registry
Enterprise-ready MCP Gateway & Registry that centralizes AI development tools with secure OAuth authentication, dynamic tool discovery, and unified access for both autonomous AI agents and AI coding assistants. Transform scattered MCP server chaos into governed, auditable tool access with Keycloak/E
SWE-bench
AI coding agent benchmark — real GitHub issues, end-to-end evaluation, the standard for code agents.
Best of AI
Like Michelin Guide for AI
Best For
- ✓AI coding agents needing implementation context beyond type definitions
- ✓teams building LLM-powered development tools that require dependency source code
- ✓developers integrating opensrc into polyglot projects with npm, Python, and Rust dependencies
- ✓projects with pinned dependency versions requiring reproducible source code snapshots
- ✓AI agents that need consistent, version-matched context across multiple runs
- ✓teams managing large dependency trees where incremental updates reduce clone time
- ✓Python projects or polyglot projects with Python dependencies
- ✓teams using pip or poetry for dependency management
Known Limitations
- ⚠Registry API rate limits may throttle bulk package resolution (npm: 1000 requests/hour for unauthenticated)
- ⚠Private packages on npm require authentication tokens; PyPI private indexes not supported
- ⚠Monorepo packages with non-standard repository URLs may fail discovery if metadata is incomplete
- ⚠Version matching relies on Git tags/commits; packages without semantic versioning tags may resolve to wrong commits
- ⚠Cloning large repositories (e.g., React, Next.js) may consume significant disk space (100MB+) and network bandwidth
- ⚠Git tag resolution fails if a package version has no corresponding Git tag (requires fallback to commit hash lookup)
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
Repository Details
Last commit: Apr 18, 2026
About
Fetch source code for npm packages to give AI coding agents deeper context
Categories
Alternatives to opensrc
Are you the builder of opensrc?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →