https://github.com/vercel-labs/opensrc
Fetch source code for npm packages to give AI coding agents deeper context
https://github.com/vercel-labs/opensrc
ai ai-coding cli coding-agents developer-tools llm nodejs npm source-code typescript
Last synced: 9 days ago
JSON representation
Fetch source code for npm packages to give AI coding agents deeper context
- Host: GitHub
- URL: https://github.com/vercel-labs/opensrc
- Owner: vercel-labs
- License: apache-2.0
- Created: 2026-01-06T17:54:03.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-04-17T20:43:31.000Z (9 days ago)
- Last Synced: 2026-04-17T22:36:51.155Z (9 days ago)
- Topics: ai, ai-coding, cli, coding-agents, developer-tools, llm, nodejs, npm, source-code, typescript
- Language: Rust
- Homepage: https://opensrc.sh
- Size: 391 KB
- Stars: 1,822
- Watchers: 7
- Forks: 91
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# opensrc
Give coding agents access to any package's source code.
## Quick Start
```bash
npm install -g opensrc
```
```bash
# 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](packages/opensrc/README.md) for full usage.
## Packages
| Package | Description |
|---------|-------------|
| [`opensrc`](packages/opensrc) | CLI — fetch and cache source code from npm, PyPI, crates.io, and GitHub |
| [`@opensrc/docs`](apps/docs) | Documentation site |
## Development
This is a [Turborepo](https://turbo.build) monorepo using [pnpm](https://pnpm.io) workspaces.
```bash
pnpm install
turbo build
turbo dev
```
### CLI (Rust)
```bash
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)
```bash
cd apps/docs
pnpm dev
```
## License
Apache-2.0