#10

Command to update all repos

Openaavetiswants to merge intofrom

If you’ve fetched many packages/repos over time, you currently have to re-run opensrc <pkg> or opensrc <owner/repo> for each one. opensrc update refreshes everything in one command while keeping pinned repo refs stable.

Concept

  • Add opensrc update to refresh all previously fetched sources listed in opensrc/sources.json, matching the existing CLI style (list, remove, clean).
  • Preserve repo refs when updating, including refs encoded as URL hashes.

Expected usage

  # Update everything already fetched
  opensrc update

  # Update only repos or specific registries
  opensrc update --repos
  opensrc update --pypi
  opensrc update --crates

Behavior

  • Packages: re-run with registry + name (resolves to installed/latest versions, same as re-running opensrc <package>).
  • Repos: re-run with stored ref (branch/tag/commit) to avoid drifting.

Methodology

  • New update command builds specs from sources.json and reuses fetchCommand for consistent logging/permissions.
  • Repo parser now reads URL hash refs (https://host/owner/repo#ref) to preserve stored refs.

Coverage

  • Added unit tests for update spec building and URL hash ref parsing.
  • Ran npm test, npm run type-check, and npm run format:check.

Activity

10
vercel[bot]9mo ago

@aavetis is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot]reviewed9mo ago
vercel[bot]9mo ago

Additional Suggestion:

URLs from non-standard git hosts (e.g., https://example.com/foo/bar) are incorrectly detected as packages instead of repos because isRepoSpec only recognizes hardcoded hosts (github.com, gitlab.com, bitbucket.org).

ctate9mo ago

Thanks for adding the update command - the core functionality looks good and the tests are solid

Before merging, please scope down the isRepoSpec change. Treating any HTTPS URL with 2+ path segments as a repo is too broad and will cause false positives (e.g., https://cdn.example.com/assets/bundle would be misclassified)

aavetis9mo ago

thanks. happy to adjust

pascalandy7mo ago

I run this via my justfile:

cat opensrc/sources.json | jq -r '.repos[].name' | sed 's|github.com/||' | xargs opensrc

ctate7mo ago

@aavetis Hey! Just a heads up — the CLI was rewritten in Rust (v0.7.0), so this PR can't be merged as-is against the old Node.js codebase. The update command is still a great feature though.

Feel free to re-submit against the Rust CLI (packages/opensrc/cli/), or I'm happy to implement it myself. Let me know!