Metadata-Version: 2.4
Name: branchclean
Version: 0.1.0
Summary: CLI tool to analyze and clean up stale, merged, and orphaned Git branches
Project-URL: Homepage, https://github.com/shaheerkj/branchclean
Project-URL: Repository, https://github.com/shaheerkj/branchclean
Project-URL: Issues, https://github.com/shaheerkj/branchclean/issues
Author: Syed Shaheer Khalid
License-Expression: MIT
License-File: LICENSE
Keywords: branches,cleanup,cli,git,stale
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.10
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.9.0
Description-Content-Type: text/markdown

# GitClean

A CLI tool that analyzes Git repositories for stale, merged, and orphaned branches, then helps you clean them up interactively.

## Install

```bash
pip install branchclean
```

## Usage

### Scan branches

```bash
# Scan current repo
gitclean scan

# Custom staleness threshold
gitclean scan --stale-days 30

# JSON output
gitclean scan --json

# Scan all repos in a directory
gitclean scan --dir ~/projects --multi
```

### Clean branches

```bash
# Interactive cleanup
gitclean clean

# Preview what would be deleted
gitclean clean --dry-run

# Skip prompts (use with caution)
gitclean clean --force
```

### Configuration

Create a `.gitcleanrc` file in your repo root or home directory:

```json
{
  "trunk": "main",
  "stale_days": 60,
  "protected_patterns": ["release/*", "hotfix/*"],
  "include_remote": true
}
```

View resolved config:

```bash
gitclean config
```

## Branch Categories

| Category    | Meaning                              | Color  |
| ----------- | ------------------------------------ | ------ |
| **merged**  | Already merged into trunk            | Green  |
| **orphaned**| Upstream tracking branch is gone     | Yellow |
| **stale**   | No commits in N days (default: 90)   | Red    |
| **active**  | Everything else                      | Dim    |

## Requirements

- Python 3.10+
- Git

## License

MIT
