Using repopo as a command-line tool
After your first check, use these commands to check and fix files from the repository root. The examples use repopo on your command path; for a local pnpm installation, prefix it with pnpm exec.
Check files
Section titled “Check files”repopo checkcheck runs every configured policy against the files in the repository and reports violations. It exits with a non-zero status when any policy fails, so it can run in CI or a Git hook.
Many violations can be fixed automatically:
repopo check --fixFailures that can’t be fixed automatically print the policy’s guidance for a manual fix.
Check selected files
Section titled “Check selected files”Use --stdin to check only the files whose paths you pipe in, for example only the changed files:
git diff --name-only main | repopo check --stdinOnly file policies are limited to the piped paths. Repository policies still run with the full repository file inventory, including when stdin is empty. With --fix, a repository policy can change files outside the piped selection.
Check rules about related changes
Section titled “Check rules about related changes”Use RequireCompanionChanges to require a related update, such as a documentation change when source files change:
repopo check --change-mode pr --change-base mainThis mode compares committed branch changes with the merge base of main. Both engines accept the same change options. Change modes supply path metadata; they do not limit file checks or make policies read committed file contents. See Checking rules about Git changes for configuration, staged and local modes, and the limits on fixes and file selection.
Concurrency
Section titled “Concurrency”Read-only checks process up to 8 files at a time. Change the limit with --concurrency:
repopo check --concurrency 16Use --concurrency 1 if a custom policy needs files processed one at a time. With --fix, files are always processed one at a time.
List policies
Section titled “List policies”repopo listPrints the policies that check would run.
The native engine
Section titled “The native engine”check-native runs the same policies as check with a Rust engine. Rust handles file enumeration, regex matching, and orchestration, and a Node.js or Bun sidecar process runs the policy handlers.
repopo check-nativerepopo check-native --runtime bunIt accepts --fix, --stdin, and --concurrency, and adds:
--configto use a configuration file at another path.--runtime(auto,node, orbun) to choose the sidecar runtime.--binary-pathand--sidecar-pathto override the engine binary and sidecar script.
See the CLI reference for every command and flag.