Skip to content

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.

Terminal window
repopo check

check 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:

Terminal window
repopo check --fix

Failures that can’t be fixed automatically print the policy’s guidance for a manual fix.

Use --stdin to check only the files whose paths you pipe in, for example only the changed files:

Terminal window
git diff --name-only main | repopo check --stdin

Only 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.

Use RequireCompanionChanges to require a related update, such as a documentation change when source files change:

Terminal window
repopo check --change-mode pr --change-base main

This 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.

Read-only checks process up to 8 files at a time. Change the limit with --concurrency:

Terminal window
repopo check --concurrency 16

Use --concurrency 1 if a custom policy needs files processed one at a time. With --fix, files are always processed one at a time.

Terminal window
repopo list

Prints the policies that check would run.

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.

Terminal window
repopo check-native
repopo check-native --runtime bun

It accepts --fix, --stdin, and --concurrency, and adds:

  • --config to use a configuration file at another path.
  • --runtime (auto, node, or bun) to choose the sidecar runtime.
  • --binary-path and --sidecar-path to override the engine binary and sidecar script.

See the CLI reference for every command and flag.