Registries

opensrc resolves packages from multiple registries. The registry is detected automatically from the input format.

For private repositories, see Authentication.

npm

The default registry. Pass a package name directly:

rg "ZodType" $(opensrc path zod)
cat $(opensrc path next)/package.json
opensrc path @vercel/ai

PyPI

Use the pypi: prefix for Python packages:

find $(opensrc path pypi:requests) -name "*.py"
cat $(opensrc path pypi:flask)/src/flask/app.py
opensrc path pypi:pydantic

crates.io

Use the crates: prefix for Rust crates:

ls $(opensrc path crates:serde)/src/
rg "derive" $(opensrc path crates:clap)
opensrc path crates:tokio

GitHub

Pass owner/repo to fetch from GitHub directly:

rg "Router" $(opensrc path vercel/next.js)/packages/next/src/
cat $(opensrc path facebook/react)/packages/react/src/React.js
opensrc path tokio-rs/tokio

GitLab

Use the gitlab: prefix:

opensrc path gitlab:owner/repo

Bitbucket

Use the bitbucket: prefix:

opensrc path bitbucket:owner/repo

Summary

| Registry | Prefix | Example | |----------|--------|---------| | npm | (none) | opensrc path zod | | PyPI | pypi: | opensrc path pypi:requests | | crates.io | crates: | opensrc path crates:serde | | GitHub | owner/repo | opensrc path vercel/ai | | GitLab | gitlab: | opensrc path gitlab:owner/repo | | Bitbucket | bitbucket: | opensrc path bitbucket:owner/repo |