Skip to documentation content
Branchcut
Getting started

Quick start

Install Branchcut, run a useful query, inspect the plan, and check its work.

1. Install

Use the complete platform command from Installation. The recommended Windows and Unix commands run the checked-in installer and verify the resulting executable.

Confirm the command before searching:

branchcut --version
branchcut --help

From a project directory:

branchcut config

config is a literal filename search. Hidden paths are excluded by default. Repeated terms match with OR:

branchcut readme license

Use an explicit glob when path structure matters:

branchcut --glob 'src/**/*.{rs,toml}' --type file

3. Exclude generated trees

branchcut \
  --glob '**/*.{rs,ts}' \
  --exclude '**/target/**' \
  --exclude '**/node_modules/**' \
  --exclude '**/dist/**' \
  --type file

Positive patterns form a union. Exclusions remove matches and can prune a safely excluded subtree.

4. Explain before walking

branchcut \
  --glob 'packages/**/src/**/*.{rs,ts}' \
  --exclude '**/{target,node_modules,dist}/**' \
  --limit 100 \
  --explain

The plan shows the root, shared pattern structure, exclusions, metadata requirement, and termination rule. --explain does not traverse.

5. Measure actual work

branchcut \
  --glob '**/*.rs' \
  --exclude '**/target/**' \
  --limit 100 \
  --stats

Statistics are written to standard error so stdout remains suitable for a pipeline. Results stream while useful directories are traversed.

6. Keep paths machine-safe

branchcut --glob '**/*.rs' --json
branchcut --glob '**/*.rs' --print0

JSON Lines preserves unusual Windows names through a companion path_utf16 field. NUL output preserves native Unix path bytes and pairs with xargs -0.

Where next

On this page