cargo-broomv0.1.0

Showcase

Each example shows real output produced by cargo-broom itself, from files in the project repository. Input on the left, output on the right.

Dry run over a directory tree

examples/dry-run.txtDetail: Dry run over a directory tree
cargo broom --dry-run ~/code
cargo-broom Summary (Dry Run)
 cargo-broom

  Reclaimable: 2.89 MiBLevel A — Full Target Clean (Coarse) (2)
  - blog-engine (1.86 MiB) at ~/code/blog-engine/target
  - weather-api (1.03 MiB) at ~/code/weather-api/target

Next steps:
  • Run `cargo broom -y` to reclaim 2.89 MiB
    $ cargo broom -y
  • dry-run
  • level-a
  • multi-project

Minimum size

examples/keep-size.txtDetail: Minimum size
cargo broom --dry-run --keep-size 1500KB ~/code
cargo-broom Summary (Dry Run)
 cargo-broom

  Reclaimable: 1.86 MiBLevel A — Full Target Clean (Coarse) (1)
  - blog-engine (1.86 MiB) at ~/code/blog-engine/target

Next steps:
  • Run `cargo broom -y` to reclaim 1.86 MiB
    $ cargo broom -y
  • dry-run
  • policy

Selective cleanup

examples/dry-run-fine.txtDetail: Selective cleanup
cargo broom --dry-run --clean-incremental --clean-doc ~/code
cargo-broom Summary (Dry Run)
 cargo-broom

  Reclaimable: 5.13 MiBLevel A — Full Target Clean (Coarse) (2)
  - blog-engine (1.86 MiB) at ~/code/blog-engine/target
  - weather-api (1.03 MiB) at ~/code/weather-api/targetLevel B — Selective / Experimental Fine Clean (3)
  - invoice-cli (pruned 0 stale fingerprints, 2 files) — 1.90 MiB at ~/code/invoice-cli/target
  - plugin-a (+1 more, shared target) (pruned 0 stale fingerprints, 1 files) — 211.43 KiB at ~/code/plugins/shared-target
  - toolkit-core (pruned 0 stale fingerprints, 1 files) — 131.03 KiB at ~/code/toolkit/target

Next steps:
  • Run `cargo broom -y` to reclaim 5.13 MiB
    $ cargo broom -y
  • dry-run
  • level-b

One project

examples/project.txtDetail: One project
cargo broom project ~/code/weather-api --dry-run
cargo-broom Summary (Dry Run)
 cargo-broom

  Reclaimable: 1.03 MiBLevel A — Full Target Clean (Coarse) (1)
  - weather-api (1.03 MiB) at ~/code/weather-api/target

Next steps:
  • Run `cargo broom -y` to reclaim 1.03 MiB
    $ cargo broom -y
  • dry-run
  • project

Inspect

examples/inspect.txtDetail: Inspect
cargo broom inspect ~/code
cargo-broom Inspect — ~/code
Found 5 Rust target directories occupying 8.86 MiB

 • blog-engine                 1.86 MiB  ~/code/blog-engine/target
 • invoice-cli                 2.83 MiB  ~/code/invoice-cli/target
 • plugin-a (+1 more, shared target)   2.06 MiB  ~/code/plugins/shared-target [Target Override]
 • toolkit-core                1.07 MiB  ~/code/toolkit/target
 • weather-api                 1.03 MiB  ~/code/weather-api/target
  • read-only
  • multi-project

Budget

examples/budget.txtDetail: Budget
cargo broom budget ~/code --limit 5MB
cargo-broom Budget — ~/code
 cargo-broom budget

  Total usage: 8.86 MiB   Budget: 5.00 MiBLargest Contributors (5)
  - invoice-cli (2.83 MiB) at ~/code/invoice-cli/target
  - plugin-a (+1 more, shared target) (2.06 MiB) at ~/code/plugins/shared-target
  - blog-engine (1.86 MiB) at ~/code/blog-engine/target
  ... 2 more finding(s) (use --details to view all)

Next steps:
  • Total usage exceeds the budget by 3.86 MiB; review the largest projects above
  • read-only
  • multi-project

JSON report

examples/dry-run-json.txtDetail: JSON report
cargo broom --dry-run --format json ~/code
{
  "root_path": "~/code",
  "dry_run": true,
  "total_projects_scanned": 5,
  "coarse_cleaned_count": 2,
  "fine_cleaned_count": 0,
  "skipped_count": 3,
  "error_count": 0,
  "total_reclaimed_bytes": 3032952,
  "history_trend": null,
  "results": [
    {
      "project_name": "blog-engine",
      "project_path": "~/code/blog-engine",
      "target_path": "~/code/blog-engine/target",
      "level": "Coarse",
      "original_size_bytes": 1950676,
      "reclaimed_bytes": 1950676,
      "details": "Coarse clean (1.86 MiB)",
      "fingerprint_summary": null,
      "error": null
    },
    {
      "project_name": "weather-api",
      "project_path": "~/code/weather-api",
      "target_path": "~/code/weather-api/target",
      "level": "Coarse",
      "original_size_bytes": 1082276,
      "reclaimed_bytes": 1082276,
      "details": "Coarse clean (1.03 MiB)",
      "fingerprint_summary": null,
      "error": null
    }
  ]
}
  • dry-run
  • json

No confirmation, no cleanup

examples/refused.txtDetail: No confirmation, no cleanup
cargo broom ~/code
Error: refusing to delete without --dry-run, --interactive, or --yes
  • safety
  • error