opensrc

Solid

Fetch dependency source code to give AI agents deeper implementation context. Use when the agent needs to understand how a library works internally, read source code for a package, fetch implementation details for a dependency, or explore how an npm/PyPI/crates.io package is built. Triggers include "fetch source for", "read the source of", "how does X work internally", "get the implementation of", "opensrc path", or any task requiring access to dependency source code beyond types and docs.

AI & Automation 422 stars 38 forks Updated 3 days ago Apache-2.0

Install

View on GitHub

Quality Score: 93/100

Stars 20%
87
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Source Code Fetching with opensrc Fetches dependency source code so agents can read implementations, not just types. Clones repositories at the correct version tag and caches them globally at `~/.opensrc/`. ## Core Pattern ```bash rg "parse" $(opensrc path zod) cat $(opensrc path zod)/src/types.ts find $(opensrc path zod) -name "*.test.ts" ``` `opensrc path <pkg>` prints the absolute path to cached source. If not cached, it fetches automatically. Progress goes to stderr, path to stdout, so `$(opensrc path ...)` works in subshells. ## Fetching Source Code ```bash opensrc path zod opensrc path pypi:requests opensrc path crates:serde opensrc path facebook/react # Multiple packages at once opensrc path zod react next opensrc path pypi:requests pypi:flask opensrc path crates:serde crates:tokio # Specific versions opensrc path zod@3.22.0 opensrc path pypi:flask@3.0.0 opensrc path owner/repo@v1.0.0 opensrc path owner/repo#main ``` ### Version Resolution For npm packages, opensrc auto-detects the installed version from lockfiles (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`). Use `--cwd` to resolve from a different project: ```bash opensrc path zod --cwd /path/to/project ``` For PyPI and crates.io, explicit versions or latest are used. For repos, use `@ref` or `#ref` to pin a branch, tag, or commit. ## Managing the Cache Source is cached globally at `~/.opensrc/` (override with `OPENSRC_HOME`). ```bash opensrc list # show all cached sources ...

Details

Author
mxyhi
Repository
mxyhi/ok-skills
Created
4 months ago
Last Updated
3 days ago
Language
HTML
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category