StargazeSign in
STStargaze Editorial

opensrc

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

Open sourceai-toolRust1.9k
Share on X

★ Embed badge

Paste it in your README. Updates live as you collect right-swipes.

Markdown[![Stargaze](https://stargaze.ashlr.ai/api/badge/opensrc-0e85a3.svg)](https://stargaze.ashlr.ai/p/opensrc-0e85a3)
HTML<a href="https://stargaze.ashlr.ai/p/opensrc-0e85a3"><img src="https://stargaze.ashlr.ai/api/badge/opensrc-0e85a3.svg" alt="Stargaze" /></a>
URLhttps://stargaze.ashlr.ai/api/badge/opensrc-0e85a3.svg

From the README

opensrc

Give coding agents access to any package's source code.

Quick Start

npm install -g opensrc
# Search a package's source
rg "parse" $(opensrc path zod)

# Read a specific file
cat $(opensrc path zod)/src/types.ts

# Works with any registry
find $(opensrc path pypi:requests) -name "*.py"

opensrc path fetches on first use, then returns the cached path instantly. See the CLI readme for full usage.

Packages

Package Description
opensrc CLI — fetch and cache source code from npm, PyPI, crates.io, and GitHub
@opensrc/docs Documentation site

Development

This is a Turborepo monorepo using pnpm workspaces.

pnpm install
turbo build
turbo dev

CLI (Rust)

cargo build --manifest-path packages/opensrc/cli/Cargo.toml
cargo test --manifest-path packages/opensrc/cli/Cargo.toml
cargo fmt --manifest-path packages/opensrc/cli/Cargo.toml
cargo clippy --manifest-path packages/opensrc/cli/Cargo.toml -- -D warnings

Docs (Next.js)

cd apps/docs
pnpm dev

License

Apache-2.0

Like what you see?

Star this on Stargaze — auto-stars on GitHub when you swipe right.

Star this on Stargaze