A collection of powerful Rust-based CLI tools for developers.
Analyze code repositories and calculate their monetary value based on development effort, complexity, and various metrics.
-
Comprehensive Code Analysis
- Lines of code (LOC) with breakdown (code, comments, blanks)
- Multiple programming languages with weighted difficulty scores
- Cyclomatic complexity estimation
- Project maturity scoring (tests, documentation, age)
-
Git Repository Analysis
- Commit count and history
- Contributor analysis
- Repository age tracking
-
Monetary Value Calculation
- Estimated development hours
- Customizable hourly rate (default: β©10,030 - 2025 South Korea minimum wage)
- Language difficulty multipliers (Rust: 1.5x, C++: 1.4x, Go: 1.3x, etc.)
- Complexity and maturity bonuses
- Learning time estimation
-
Advanced Analysis Features
- Detailed project metrics (complexity, maturity, code quality)
- Language breakdown with percentages
- AI usage estimation and code quality scoring
- Developer level cost breakdown (Junior to Principal)
- Test coverage statistics
-
Multiple Output Formats
- Beautiful colored table output
- Detailed analysis mode (default) with comprehensive metrics
- Simple mode (--simple) for basic summary
- JSON (compact and pretty-printed)
- CSV export
- HTML report
- Markdown documentation
cargo install --path crates/code-costOr build from source:
cargo build --releaseBasic Analysis (detailed mode is default):
code-costSimple Mode (table only):
code-cost --simpleDeveloper Level Breakdown:
code-cost --dev-levelsAnalyze Multiple Repositories:
code-cost ~/project1 ~/project2 ~/project3JSON Output:
code-cost --format json-prettyExport Results:
# CSV format
code-cost --export report.csv
# HTML format
code-cost --export report.html
# Markdown format
code-cost --export report.mdCustom Hourly Rate:
code-cost --hourly-rate 50000Detailed Mode (default):
π Code Cost Analyzer
βΉ Analyzing: .
β Analysis completed
ββββββββββββββ¬βββββββββββββ¬βββββββββ¬ββββββββββ¬βββββββββββββ¬βββββββββββββββββββ
β Repository β Lines β Files β Commits β Est. Hours β Total Cost (KRW) β
ββββββββββββββͺβββββββββββββͺβββββββββͺββββββββββͺβββββββββββββͺβββββββββββββββββββ‘
β cli-tools β 1658 β 20 β 4 β 237.2 β β© 2,379,027 β
ββββββββββββββ΄βββββββββββββ΄βββββββββ΄ββββββββββ΄βββββββββββββ΄βββββββββββββββββββ
π cli-tools
βΉ Languages:
β’ Rust - 80.9% (1,342 lines, 15 files)
β’ Markdown - 11.9% (198 lines, 1 files)
β’ TOML - 6.2% (102 lines, 3 files)
β’ JSON - 1.0% (16 lines, 1 files)
βΉ Project Metrics:
β’ Complexity Score: 2.84/5.0
β’ Maturity Score: 20.8%
β’ Code Quality: 34.1%
β’ Test Files: 0 (0.0%)
βΉ AI Usage Analysis:
β’ Estimated AI Usage: 25.0%
β’ Indicators:
- Consistent file size distribution
- Use of modern programming languages
π Summary
Total repositories: 1
Total estimated hours: 237.2 hours
Total estimated cost: β©2,379,027
With Developer Level Breakdown (--dev-levels):
βΉ Developer Level Breakdown:
β’ Junior β© 15,000/hr β β©3,557,867
β’ Mid-level β© 25,000/hr β β©5,929,778
β’ Senior β© 40,000/hr β β©9,487,646
β’ Lead β© 60,000/hr β β©14,231,469
β’ Principal β© 100,000/hr β β©23,719,115
The tool uses a sophisticated algorithm to estimate code value:
- Base Calculation: Lines of code Γ· 20 (assumes 20 lines per hour)
- Language Weights: Different languages have different complexity multipliers
- Rust: 1.5x
- C++/C: 1.4x
- Go: 1.3x
- Java/C#/TypeScript: 1.2x
- Python/Ruby: 1.1x
- JavaScript: 1.0x
- Complexity Multiplier: Based on code complexity (1.0 - 2.0x)
- Maturity Bonus: Up to 30% extra for well-maintained projects (tests, docs, multiple contributors)
- Learning Time: Estimated time needed to learn the technologies used
- AI Usage Estimation: Analyzes code patterns to estimate AI-assisted development
- Low comment ratio with high code quality
- Consistent file size distribution
- High complexity with comprehensive testing
- Modern language usage (Rust, TypeScript, Go, etc.)
- Strong test coverage
- Developer Level Rates: Market-based hourly rates for South Korea (2025)
- Junior (1-3 years): β©15,000/hr
- Mid-level (3-5 years): β©25,000/hr
- Senior (5-10 years): β©40,000/hr
- Lead (10+ years, team lead): β©60,000/hr
- Principal (architect, senior engineer): β©100,000/hr
Analyze git commit history and generate meaningful work activity summaries with time estimation and value calculation.
-
Git Commit Analysis
- Complete commit history with diff tracking
- File change statistics per commit
- Author and timestamp information
- Language-specific change tracking
-
Hybrid Time Estimation
- Time-gap based estimation (between commits)
- Code change-based estimation (lines added/deleted with complexity)
- Weighted average of both methods for accuracy
- Configurable maximum session gap (4 hours default)
-
Work Pattern Analysis
- Hourly commit distribution
- Daily commit patterns (weekdays vs weekends)
- Peak working hours identification
- Commit frequency and active days tracking
-
Value Calculation
- Developer level-based estimates (Junior to Principal)
- Base hourly rate: β©10,030 (2025 Korean minimum wage)
- Level multipliers matching code-cost tool
- Complexity-adjusted value estimation
-
Contributor Statistics
- Per-contributor commit counts
- Lines added/deleted per contributor
- Contribution percentage breakdown
- Top contributors ranking
-
Date Filtering
- Date range filters:
--from,--to(YYYY-MM-DD) - Quick filters:
--today,--week,--month - Commit count limit:
--limit N
- Date range filters:
-
Multiple Output Modes
- Simple mode: Basic summary with key metrics
- Detail mode: Comprehensive analysis with all statistics
- JSON export support
- Multiple repository analysis
cargo install --path crates/work-summaryOr build from source:
cargo build --release --package work-summaryBasic Analysis (current directory, detailed mode):
work-summarySimple Summary:
work-summary --simpleAnalyze Recent Commits:
work-summary --limit 10Date Range Filtering:
# Specific date range
work-summary --from 2025-01-01 --to 2025-01-31
# Quick filters
work-summary --today
work-summary --week
work-summary --monthMultiple Repositories:
work-summary ~/project1 ~/project2 ~/project3Export Results:
work-summary --export summary.json --format jsonCustom Hourly Rate:
work-summary --hourly-rate 15000Simple Mode:
Work Summary
v0.1.0
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Total Summary
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Repository: my-project
Period: 2025-01-01 ~ 2025-01-31
Commits: 42
Estimated Hours: 105.5h
Value (Mid-level): β©1,587,232
Detail Mode:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Repository: my-project
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Basic Information
Period: 2025-01-01 ~ 2025-01-31
Total Commits: 42
Contributors: 3
Files Changed: 127
Lines: +2,450 / -856
Estimated Hours: 105.5h
Recent Commits
ββββββββββββββββββββ¬βββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββ
β Time β Author β Message β Changes β
ββββββββββββββββββββͺβββββββββͺββββββββββββββββββββββββββββββββββββββββββββββββββββββββͺβββββββββββββ‘
β 2025-01-31 18:30 β Alice β feat: add new authentication module β +452 / -23 β
β 2025-01-31 15:20 β Bob β fix: resolve memory leak in worker pool β +18 / -34 β
β 2025-01-30 09:15 β Alice β refactor: improve error handling β +89 / -67 β
ββββββββββββββββββββ΄βββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββ
Language Breakdown
ββββββββββββββ¬βββββββββββββ¬ββββββββββββ¬βββββββββββββ¬ββββββββ
β Language β Insertions β Deletions β Net Change β % β
ββββββββββββββͺβββββββββββββͺββββββββββββͺβββββββββββββͺββββββββ‘
β Rust β +1,840 β -456 β +1,384 β 69.5% β
β TypeScript β +445 β -289 β +156 β 22.2% β
β Markdown β +165 β -111 β +54 β 8.3% β
ββββββββββββββ΄βββββββββββββ΄ββββββββββββ΄βββββββββββββ΄ββββββββ
Top Contributors
βββββββββ¬ββββββββββ¬βββββββββββββ¬ββββββββββββ¬βββββββββ
β Name β Commits β Insertions β Deletions β % β
βββββββββͺββββββββββͺβββββββββββββͺββββββββββββͺβββββββββ‘
β Alice β 25 β +1,520 β -450 β 59.5% β
β Bob β 12 β +680 β -289 β 28.6% β
β Carol β 5 β +250 β -117 β 11.9% β
βββββββββ΄ββββββββββ΄βββββββββββββ΄ββββββββββββ΄βββββββββ
Work Patterns
Peak Hours: 14:00, 15:00, 16:00
Most Active Day: Wednesday
Avg Commits/Day: 1.4
Active Days: 30 / 31
Value Estimates
ββββββββββββββββ¬βββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Level β Multiplier β Hourly Rate β Total Value β
ββββββββββββββββͺβββββββββββββͺββββββββββββββͺββββββββββββββ‘
β Junior β 1x β β©12,036 β β©1,058,155 β
β Mid-level β β 1.5x β β©18,054 β β©1,587,232 β
β Senior β 2x β β©24,072 β β©2,116,310 β
β Lead β 2.5x β β©30,090 β β©2,645,387 β
β Principal β 3x β β©36,108 β β©3,174,465 β
ββββββββββββββββ΄βββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
The tool uses a hybrid approach combining two estimation methods:
-
Time-Gap Method (60% weight)
- Measures time between consecutive commits
- Caps at 4 hours to avoid overnight/weekend gaps
- Assumes continuous work within reasonable timeframes
-
Code-Change Method (40% weight)
- Estimates based on lines added/deleted
- Applies language complexity multipliers (same as code-cost)
- Adjusts for file change complexity (more files = higher complexity)
- Base rate: 20 lines of code per hour
-
Final Estimate
- Weighted average of both methods
- Provides balanced estimate considering both time and work volume
- More accurate than either method alone
- Freelancer invoicing: Calculate billable hours from git history
- Project retrospectives: Understand team work patterns
- Time tracking: Estimate time spent on projects retroactively
- Team analytics: Analyze contributor activity and patterns
- Work reports: Generate professional summaries of development work
- Portfolio documentation: Showcase project effort and value
cli-tools/
βββ Cargo.toml # Workspace configuration
βββ crates/
β βββ cli-core/ # Shared library for all tools
β β βββ src/
β β β βββ output/ # Output formatters (table, JSON, CSV, HTML, MD)
β β β βββ config/ # Configuration management
β β β βββ ui/ # UI theming and colors
β βββ code-cost/ # Code value analyzer tool
β β βββ src/
β β βββ analyzer/ # Repository analysis logic
β β βββ calculator/ # Cost calculation
β β βββ metrics/ # Code metrics collection
β β βββ git/ # Git repository analysis
β βββ work-summary/ # Git commit work summarizer
β βββ src/
β βββ git/ # Commit history & diff analysis
β βββ analyzer/ # Work analysis & value calculation
β βββ patterns/ # Work pattern detection
β βββ summary/ # Summary generation
βββ README.md
- Rust 1.75+ (2021 edition)
- Cargo
cargo buildcargo test-
Create a new crate in
crates/:cargo new crates/your-tool
-
Add it to workspace in root
Cargo.toml:[workspace] members = [ "crates/cli-core", "crates/code-cost", "crates/your-tool", ]
-
Use
cli-corefor common functionality:[dependencies] cli-core = { path = "../cli-core" }
- Clean Architecture: Separation of concerns with clear module boundaries
- Extensibility: Easy to add new tools and features
- Maintainability: Consistent code style and well-documented
- Performance: Efficient Rust implementation
- User Experience: Beautiful terminal UI with colored output
MIT License - See LICENSE file for details
CHANN
Contributions are welcome! Please feel free to submit a Pull Request.