Hey folks!
If you maintain multiple repositories or work with organizations on GitHub, you probably know the pain: closing stale PRs, deleting merged branches, managing Dependabot alerts, archiving old repos... It's tedious, repetitive, and takes time away from actual coding. And it's not possible to do that in bulk, I don't know why, and it bothers me.
So I built GitHub AutoMaintainer, a CLI tool in Go that automates all of this.
What it does
Close stale PRs automatically
automaintainer close-prs --org my-org --days 30
- Closes PRs older than X days
- Adds a comment explaining why
- Supports
--dry-runto preview changes
Delete merged branches
automaintainer delete-branches --org my-org --exclude main,develop
- Cleans up branches already merged into default
- Exclude specific branches from deletion
Close inactive issues
automaintainer close-issues --org my-org --days 90
- Grace period with "stale" label before closing
- Option to lock issues after closing
- Filter by labels
Manage repositories in bulk
automaintainer repos list --org my-org --inactive 365
automaintainer repos archive --org my-org -i
automaintainer repos delete --org my-org -i
- List repos with filters (inactive, archived)
- Archive or delete in bulk
- Interactive mode (
-i) for visual selection
Handle Dependabot alerts
automaintainer security list --org my-org --severity high
automaintainer security dismiss --org my-org --severity low --days 180
- List alerts by severity and state
- Dismiss old low-priority alerts
Nice terminal UI
I used the Charmbracelet libraries to make the output actually pleasant:
Styled tables
┌────────────────────────┬───────────────┬────────────┐
│ REPOSITORY │ LAST ACTIVITY │ STATUS │
├────────────────────────┼───────────────┼────────────┤
│ my-org/api │ 2024-01-15 │ ● active │
│ my-org/legacy │ 2022-03-10 │ ○ archived │
└────────────────────────┴───────────────┴────────────┘
Progress bars for long-running operations
Scanning repos [████████████████░░░░] 42/100 my-org/current-repo
Preview mode - select before executing
automaintainer close-prs --org my-org --preview
Opens an interactive TUI where you navigate with arrows, toggle with space, and confirm only what you want.
Other features
GitHub URLs as arguments
# Both work
automaintainer close-prs --org my-org
automaintainer close-prs https://github.com/my-org
Dry run mode - preview everything before making changes
Colored output - green for active, gray for archived, red for critical alerts
Installation
brew install olucasandrade/automaintainer/automaintainer
Or download the binary from releases.
Why Go?
- Single binary, no dependencies
- Cross-platform (Linux, macOS, Windows)
- Great performance for bulk operations
- Excellent CLI ecosystem (Cobra, Bubble Tea)
What's next
- Full interactive dashboard
- Label sync between repos
- Exportable reports
- GitHub Enterprise support
The code is fully open source: github.com/olucasandrade/homebrew-automaintainer
If you maintain repos, work with open source, or just want to automate boring GitHub tasks, give it a try and let me know what you think.
Issues, PRs, and suggestions are always welcome. The goal is simple: make life easier for those who already make life easier for others through code.
Top comments (0)