multi-registry package discovery and resolution
Automatically 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.
Unique: 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
vs alternatives: 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
Clones 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.
Unique: 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
vs alternatives: 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
Queries 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.
Unique: Extends opensrc to Python ecosystem via PyPI registry integration with pypi: prefix syntax, enabling unified source code fetching across npm and Python dependencies
vs alternatives: 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
Queries 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.
Unique: 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
vs alternatives: 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
Accepts 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.
Unique: 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
vs alternatives: 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
Supports 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.
Unique: 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
vs alternatives: 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
Automatically 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.
Unique: 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
vs alternatives: 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
Implements 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.
Unique: 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
vs alternatives: 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
+6 more capabilities