Dual-version application for streamlining cleanup of merged branches in git repositories
A professional monorepo featuring a CLI tool and web interface for managing git branch cleanup with an elegant, minimalist design.
- β Analyze merged branches in any git repository
- β Interactive branch selection (multi-select with checkboxes)
- β Pattern-based filtering (regex support)
- β Date-based filtering (branches older than X)
- β Dry-run mode (preview without deleting)
- β Batch branch deletion with confirmation
- β Comprehensive error handling
- π Interactive terminal prompts (inquirer)
- π¨ Color-coded output (chalk)
- π Formatted branch tables (cli-table3)
- βοΈ Command-line options (pattern, exclude, dry-run)
- π Fast and lightweight
- π¨ Refined minimalist UI (shadcn-vue + Tailwind CSS)
- π΅ Professional blue theme with Poppins & Open Sans fonts
- π± Responsive design (mobile-first)
- βΏ WCAG AA accessibility compliant
- β‘ Fast Vite build (270KB JS, 28KB CSS gzipped)
- π Smooth animations (200ms transitions)
branch-cleanup-monorepo/
βββ packages/
β βββ core/ # Shared library (TypeScript)
β βββ src/
β β βββ git-operations.ts # Git command wrappers
β β βββ branch-analyzer.ts # Merge detection logic
β β βββ branch-manager.ts # Deletion operations
β β βββ validators.ts # Input validation
β β βββ types.ts # TypeScript interfaces
β βββ tests/ # 79 tests, 100% passing
βββ apps/
β βββ cli/ # CLI application (Node.js)
β β βββ src/
β β β βββ index.ts # Entry point
β β β βββ cli.ts # Main flow
β β β βββ prompts.ts # Inquirer prompts
β β β βββ display.ts # Terminal formatting
β β βββ dist/ # Built executable
β βββ api/ # Backend API (Express)
β β βββ src/
β β βββ index.ts # Server setup
β β βββ routes.ts # API endpoints
β β βββ middleware.ts # CORS, validation
β β βββ schemas.ts # Zod schemas
β βββ web/ # Web frontend (Vue 3 + Vite)
β βββ src/
β β βββ components/ # Vue components
β β β βββ ui/ # shadcn-vue components
β β β βββ repository-form.vue
β β β βββ branch-table.vue
β β β βββ delete-dialog.vue
β β βββ composables/ # Vue composables
β β βββ views/ # Pages
β β βββ types/ # TypeScript types
β βββ dist/ # Production build
βββ pnpm-workspace.yaml
- Node.js 22+
- pnpm 9+
- Git repository to clean up
# Clone repository
git clone <repo-url>
cd branch-cleanup
# Install dependencies
pnpm install
# Build all packages
pnpm build# Run CLI interactively
pnpm dev:cli
# Or use built binary
cd apps/cli
./dist/index.js
# With options
./dist/index.js --pattern "feature/*" --dry-runCLI Options:
--pattern <regex>- Filter branches by pattern--exclude <regex>- Exclude branches matching pattern--older-than <date>- Only branches older than date--dry-run- Preview without deleting--help- Show help--version- Show version
# Start backend API
pnpm dev:api
# API runs at http://localhost:3000
# Start web frontend
pnpm dev:web
# Web app runs at http://localhost:5173Web Interface:
- Enter repository path
- Select target branch
- (Optional) Apply filters
- Analyze merged branches
- Select branches to delete
- Confirm deletion (or dry-run preview)
# Run all tests
pnpm test
# Run specific package tests
pnpm test:core # Core library (79 tests)
pnpm test:cli # CLI tests
pnpm test:api # API tests
# Type checking
pnpm typecheck
# Coverage report
pnpm test:core --coverageTest Results:
- β 79/79 tests passing (100%)
- β >70% code coverage
- β Real git repositories (no mocks)
- β All type checks passing
# Development
pnpm dev:cli # Run CLI in watch mode
pnpm dev:api # Run API in watch mode
pnpm dev:web # Run web app in dev mode
# Building
pnpm build # Build all packages
pnpm build:core # Build core library only
pnpm build:cli # Build CLI only
pnpm build:api # Build API only
pnpm build:web # Build web app only
# Testing
pnpm test # Run all tests
pnpm test:core # Test core library
pnpm typecheck # Type check all packages
# Cleaning
pnpm clean # Remove all dist/ and node_modules/- Primary:
#2563EB(Trust Blue) - Background:
#F8FAFC(Light Slate) - Text:
#1E293B(Dark Slate) - Border:
#E2E8F0(Light Slate Border) - Destructive:
#DC2626(Red)
- Headings: Poppins (400, 500, 600, 700)
- Body: Open Sans (300, 400, 500, 600, 700)
- Hierarchy: text-sm β text-base β text-lg β text-2xl β text-4xl
- shadcn-vue components (Card, Table, Button, Input, Select, etc.)
- Lucide Vue icons
- 200ms transitions
- Subtle shadows
- WCAG AA compliant
- Language: TypeScript 5.7
- Package Manager: pnpm 9.15
- Monorepo: pnpm workspaces
- Node: 22+
- simple-git 3.27 (Git operations)
- Zod 3.23 (Runtime validation)
- Vitest 2.1 (Testing)
- @inquirer/prompts 7.2 (Interactive prompts)
- Commander 12.1 (CLI framework)
- chalk 5.4 (Terminal colors)
- cli-table3 0.6 (Tables)
- Express 4.21 (REST API)
- CORS 2.8 (Cross-origin)
- Zod 3.23 (Validation)
- Vue 3.5 (Framework)
- Vite 6.0 (Build tool)
- shadcn-vue (Component library)
- Tailwind CSS 3.4 (Styling)
- Axios 1.7 (HTTP client)
- Lucide Vue 0.469 (Icons)
- Plan:
plans/260106-2239-git-branch-cleanup-dual-app/plan.md - Design Guidelines:
docs/design-guidelines.md - Test Reports:
plans/reports/tester-*.md - Implementation Reports:
plans/reports/fullstack-developer-*.md
- Follow YAGNI, KISS, DRY principles
- Keep files under 200 lines
- Use kebab-case for file names
- Add JSDoc comments to public APIs
- Write tests for new features
- Ensure type safety (no
any) - Run
pnpm typecheckbefore committing
MIT
Built with:
Designed with refined minimalism principles.