{"_id":"@404-pf/git-broom","name":"@404-pf/git-broom","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@404-pf/git-broom","version":"0.1.0","description":"A safety-first CLI tool to clean up stale branches, prune dangling Git objects, and keep your repositories tidy.","type":"module","bin":{"git-broom":"dist/index.js"},"scripts":{"build":"tsup","dev":"tsx src/index.ts","typecheck":"tsc --noEmit","lint":"eslint src","format":"prettier --write src","test":"vitest run","test:watch":"vitest","prepack":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/404-PF/git-broom.git"},"author":{"name":"404-PF"},"keywords":["git","cleanup","cli","branches","maintenance","prune"],"homepage":"https://github.com/404-PF/git-broom#readme","bugs":{"url":"https://github.com/404-PF/git-broom/issues"},"dependencies":{"@inquirer/prompts":"^7.0.0","chalk":"^5.3.0","commander":"^12.1.0","execa":"^9.3.0","zod":"^3.23.8"},"devDependencies":{"@types/node":"^24.0.0","eslint":"^9.8.0","prettier":"^3.3.3","tsup":"^8.2.0","tsx":"^4.17.0","typescript":"^5.5.4","vitest":"^3.0.0"},"engines":{"node":">=24.0.0"},"license":"MIT","gitHead":"a0371822097dd5503035f7d7cac99519693f057a","_id":"@404-pf/git-broom@0.1.0","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-u1zmeSKnxMgAhhAdrnSUSS9W/bdcQbiw0aq7hYsZM761OKForczFuXcOvKagSC3UeXqzkstlWIZv7bz3jMtZaQ==","shasum":"a070c272be29c79f42ed82216d17964649868e1f","tarball":"https://registry.npmjs.org/@404-pf/git-broom/-/git-broom-0.1.0.tgz","fileCount":5,"unpackedSize":24077,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCbN2vHP9mL1EoQo879ldi0BiQaWMkictkeFyTMBGvKeAIgCX6ySjk1nSyfn+rs8ko46kXGSuA01ol5dYRLRSGOPus="}]},"_npmUser":{"name":"404-page-found","email":"Lucas20220605@gmail.com"},"directories":{},"maintainers":[{"name":"404-page-found","email":"Lucas20220605@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/git-broom_0.1.0_1779354800369_0.6592023616335447"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-21T09:13:20.195Z","0.1.0":"2026-05-21T09:13:20.545Z","modified":"2026-05-21T09:13:20.828Z"},"maintainers":[{"name":"404-page-found","email":"Lucas20220605@gmail.com"}],"description":"A safety-first CLI tool to clean up stale branches, prune dangling Git objects, and keep your repositories tidy.","homepage":"https://github.com/404-PF/git-broom#readme","keywords":["git","cleanup","cli","branches","maintenance","prune"],"repository":{"type":"git","url":"git+https://github.com/404-PF/git-broom.git"},"author":{"name":"404-PF"},"bugs":{"url":"https://github.com/404-PF/git-broom/issues"},"license":"MIT","readme":"# 🧹 Git Broom\n\nA safety-first CLI tool to automatically clean up stale branches, prune dangling Git objects, and keep your repositories tidy.\n\n## Features\n\n- **Dry-run by default** — see what would happen before any changes are made\n- **Protected branches** — never delete `main`, `master`, `develop`, or custom patterns\n- **Safety guards** — current branch is always skipped, confirmation prompts before deletion\n- **Stale branch detection** — configurable inactivity threshold (default: 90 days)\n- **Dangling object pruning** — clean up unreachable commits, trees, and blobs\n- **Repository status report** — quick overview of branch hygiene and `.git` size\n\n## Installation\n\n```bash\nnpm install -g git-broom\n```\n\nOr run locally from the project:\n\n```bash\nnpm run dev -- [command]\n```\n\n## Usage\n\n```bash\ngit-broom status          # Show repository hygiene report\ngit-broom clean           # Clean stale branches (dry-run by default)\ngit-broom branches        # List branches by state\ngit-broom objects         # Inspect dangling objects\n```\n\n### Global Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--repo <path>` | Target repository directory | `cwd` |\n| `--dry-run` | Show what would happen | `true` |\n| `--no-dry-run` | Apply changes | — |\n| `--yes` | Skip confirmation prompts | `false` |\n| `--aggressive` | Deep clean with aggressive GC | `false` |\n| `--verbose` | Show debug output | `false` |\n\n### Commands\n\n#### `status`\n\nShow a quick report of your repository's health:\n\n```\n🧹 Repository Status\n────────────────────────────────────────\nCurrent branch         main\nTotal branches         12\nMerged branches        5\nStale branches (>90d)  3\nDangling objects       47\nRemotes                origin\n.git size              15.2 MB\n```\n\n#### `clean`\n\nOrchestrate a full cleanup:\n\n1. Prune remote tracking branches\n2. Delete merged local branches\n3. Delete stale branches (configurable days)\n4. Run garbage collection\n\n```bash\ngit-broom clean                    # Dry run (default)\ngit-broom clean --no-dry-run       # Apply changes\ngit-broom clean --yes              # Skip confirmation\ngit-broom clean --stale-days 30    # Custom stale threshold\ngit-broom clean --aggressive       # Aggressive GC\n```\n\n#### `branches`\n\nList branches categorized by state:\n\n```bash\ngit-broom branches                 # All branches\ngit-broom branches --merged        # Only merged\ngit-broom branches --stale         # Only stale\ngit-broom branches --stale-days 60 # Custom threshold\n```\n\n#### `objects`\n\nInspect and prune dangling Git objects:\n\n```bash\ngit-broom objects                  # Show dangling objects\ngit-broom objects --prune          # Remove them\ngit-broom objects --prune --aggressive  # Aggressive cleanup\n```\n\n## Configuration\n\nCreate a `.gitbroomrc` file in your repository or home directory:\n\n```json\n{\n  \"protectedBranches\": [\"main\", \"master\", \"develop\", \"release-*\"],\n  \"staleDays\": 60,\n  \"dryRun\": true,\n  \"aggressive\": false,\n  \"skipConfirmation\": false,\n  \"verbose\": false\n}\n```\n\n## Safety\n\nGit Broom is designed with safety as the top priority:\n\n- **Dry-run is the default** — nothing is deleted unless you explicitly use `--no-dry-run`\n- **Protected branches** — `main`, `master`, `develop`, and user-configured patterns are never deleted\n- **Current branch** — the checked-out branch is always skipped\n- **Confirmation prompts** — interactive confirmation before any deletion (skip with `--yes`)\n- **Remote pruning** — remote tracking branches are pruned before evaluating staleness\n\n## Development\n\n```bash\nnpm install          # Install dependencies\nnpm run dev -- help  # Run in development mode\nnpm run build        # Build for production\nnpm run typecheck    # TypeScript type checking\nnpm test             # Run tests\n```\n\n## License\n\nMIT — see [LICENSE](LICENSE)\n","readmeFilename":"README.md","_rev":"1-dfe6ffa3b51728c5be9f5a4ba2bd7ced"}