Skip to main content

Overview

The repair command scans for projects with corrupted or broken dependencies and automatically fixes them by removing and reinstalling. This is safer than sweep because it only touches projects that are actually broken. Use this command when:
  • Dependencies are corrupted or incomplete
  • Package installations failed midway
  • You suspect missing packages causing runtime errors
  • You want to verify and fix dependency health across multiple projects

Usage

pumu repair [flags]

Flags

-p, --path
string
default:"."
Root path to scan. Defaults to the current directory. Scans recursively through all subdirectories.
--verbose
boolean
default:"false"
Show details for all projects, including healthy ones. By default, only broken projects are shown.
-h, --help
boolean
default:"false"
Display help information for the repair command.

Examples

Repair Current Directory

Scan and fix broken dependencies:
pumu repair
Example Output:
🔧 Scanning for projects with broken dependencies in '.'...
⏱️  Found 3 projects. Checking health...

📁 ./webapp (npm)
   ❌ Missing: react, react-dom
   🗑️  Removing node_modules...
   📦 Reinstalling...
   ✅ Repaired!

📁 ./api (pnpm)
   ✅ Healthy, skipping.

📁 ./rust-cli (cargo)
   ❌ Compilation errors detected
   🗑️  Removing target...
   📦 Rebuilding...
   ✅ Repaired!

-----
🔧 Repair complete! Fixed 2/3 projects.

Repair with Verbose Output

Show details for healthy projects too:
pumu repair --verbose
Example Output:
🔧 Scanning for projects with broken dependencies in '.'...
⏱️  Found 5 projects. Checking health...

📁 ./webapp (npm)
   ❌ Missing: react, react-dom, lodash
   🗑️  Removing node_modules...
   📦 Reinstalling...
   ✅ Repaired!

📁 ./api (pnpm)
   ✅ Healthy: All dependencies installed correctly
   ✅ Dependency tree verified

📁 ./old-project (npm)
   ❌ Corrupted package: express (invalid checksum)
   🗑️  Removing node_modules...
   📦 Reinstalling...
   ✅ Repaired!

📁 ./rust-cli (cargo)
   ✅ Healthy: cargo check passed

📁 ./python-app (pip)
   ✅ Healthy: pip check passed

-----
🔧 Repair complete! Fixed 2/5 projects.

Repair Specific Directory

Scan a specific path:
pumu repair --path ~/projects

Check All Projects Verbosely

Audit all projects and show their health status:
pumu repair -p ~/dev --verbose

Health Check Methods

Pumu uses different health check strategies per package manager:
EcosystemHealth Check MethodWhat It Detects
npmnpm ls --jsonMissing packages, version mismatches, corrupted installations
pnpmpnpm ls --jsonMissing packages, integrity issues, broken symlinks
yarnyarn check --verify-treeDependency tree corruption, checksum mismatches
bunbun install --dry-runMissing packages, version conflicts
cargocargo checkCompilation errors, missing dependencies
gogo mod verifyModule integrity, checksum verification
pippip checkBroken dependencies, incompatible versions

How Repair Works

  1. Scans recursively - Finds all project directories by detecting package manager files
  2. Runs health checks - Uses package manager-specific commands to detect issues
  3. Identifies broken projects - Determines which projects need fixing
  4. Removes corrupt folders - Deletes the dependency folder (node_modules, target, etc.)
  5. Reinstalls fresh - Runs the package manager’s install command
  6. Verifies repair - Checks if the project is now healthy
  7. Reports results - Shows which projects were fixed and which were already healthy

Common Use Cases

Fix Runtime Errors

When you get “module not found” errors:
cd ~/projects/webapp
pumu repair

Audit All Projects

Check health across all projects:
pumu repair --path ~/projects --verbose

Fix After Failed Installation

When npm install or similar commands fail:
pumu repair
npm run dev  # Now it should work

Verify Environment After Updates

After updating Node.js, Rust, or other tools:
pumu repair -p ~/dev

Batch Repair Multiple Projects

Fix all broken projects in your workspace:
cd ~/workspace
pumu repair

Pre-deployment Check

Verify all dependencies before deploying:
pumu repair --verbose
# If all healthy, proceed with deployment

Repair vs. Sweep

Featurerepairsweep
PurposeFix broken dependenciesFree up disk space
DetectionHealth checksSize calculation
ActionOnly repairs broken projectsDeletes selected folders
SafetyVery safe - only touches broken projectsRequires explicit selection
SpeedSlower (runs health checks)Faster (just calculates sizes)
Use caseFix errorsClean up space
Use repair when things are broken. Use sweep when you need disk space.

Performance Considerations

  • Health checks can be slow - Package manager verification commands (especially cargo check and npm ls) can take time on large projects
  • Concurrent execution - Multiple health checks run in parallel for speed
  • Smart caching - Some package managers cache verification results
  • Graceful failures - If a health check times out, the project is skipped
The --verbose flag is useful for auditing, but can produce a lot of output on large workspaces. Use it selectively.

Output Interpretation

Symbols and Colors

  • Green checkmark - Project is healthy or was successfully repaired
  • Red X - Project has broken dependencies
  • 📁 Folder icon - Project path and detected package manager
  • 🗑️ Trash icon - Removing corrupted dependency folder
  • 📦 Package icon - Reinstalling dependencies

Exit Codes

  • 0 - All projects healthy or successfully repaired
  • 1 - One or more projects could not be repaired

Limitations

Repair requires the package manager to be installed. If npm, cargo, pip, etc. are not available, repair will skip those projects.
  • Requires package managers - The tool must be able to run npm, cargo, etc.
  • Network dependent - Reinstalling requires internet access
  • Time consuming - Health checks and reinstalls can take minutes on large projects
  • Not all errors detected - Some subtle corruption may not be caught by standard health checks
  • Default mode - Refresh a single project (similar to repair but for one project)
  • sweep - Delete dependency folders to free space
  • list - View all dependency folders without action
  • prune - Smart cleanup based on staleness

Build docs developers (and LLMs) love