When using opensrc with a GitHub repo that's a monorepo, it currently clones the entire repository. There's no way to specify a subdirectory path and fetch only that subtree.
Proposed syntax:
bashopensrc owner/repo/packages/some-package
opensrc github:owner/repo/path/to/dir
opensrc https://github.com/owner/repo/tree/main/packages/some-package
Why it matters:
Many popular packages live inside monorepos (e.g. vercel/ai, TanStack/query, facebook/react). Fetching the entire repo to get one package's source is wasteful — both in time and in tokens given to the AI agent.
Implementation note:
GitHub's Git Trees API supports fetching a specific path without cloning the full repo, so this could be done efficiently without a full checkout.
When using opensrc with a GitHub repo that's a monorepo, it currently clones the entire repository. There's no way to specify a subdirectory path and fetch only that subtree.
Proposed syntax:
bashopensrc owner/repo/packages/some-package
opensrc github:owner/repo/path/to/dir
opensrc https://github.com/owner/repo/tree/main/packages/some-package
Why it matters:
Many popular packages live inside monorepos (e.g. vercel/ai, TanStack/query, facebook/react). Fetching the entire repo to get one package's source is wasteful — both in time and in tokens given to the AI agent.
Implementation note:
GitHub's Git Trees API supports fetching a specific path without cloning the full repo, so this could be done efficiently without a full checkout.