Inrepo
Documentation

Quickstart

Quickstart

Run from a project that wants to vendor upstream packages:

Or install the CLI globally with Homebrew if you'd rather have inrepo on your $PATH:

brew install inrepo and npx inrepo install the same npm-published artifact, so the rest of this guide works either way. Substitute inrepo for npx inrepo when you have it installed locally.

Initialize config explicitly, or let the first sync or add prompt for where config should live:

Add and pin a package:

If the npm registry package does not expose a GitHub repository URL, pass the git URL:

Use -D when the generated local package should be wired into devDependencies:

The normal collaboration loop is:

  1. Run npx inrepo sync to rebuild generated modules from inrepo.lock.json and inrepo_patches/.
  2. Edit files under inrepo_modules/<package>/.
  3. Run npx inrepo patch <package> to capture those edits into inrepo_patches/<package>/.
  4. Commit config, lockfile changes, and patch files.
  5. Teammates pull and run npx inrepo sync.

Commit these files:

  • inrepo.json or package.json#inrepo
  • inrepo.lock.json
  • inrepo_patches/

Keep these generated files out of git:

  • inrepo_modules/
  • .inrepo/

Before merging, run:

verify checks that generated module trees still match the lockfile plus committed overlay.

Safety checks

inrepo tries not to silently destroy local work.

If inrepo_modules/ changed but inrepo_patches/ did not, sync treats that as uncaptured work and asks you to run npx inrepo patch. If both changed, sync reports a conflict.

Use npx inrepo sync --force only when you want to discard generated edits. Before doing that, inrepo saves a backup under .inrepo/backups/.