147 lines
3.9 KiB
Markdown
147 lines
3.9 KiB
Markdown
# GitPulse - Developer Productivity Analyzer
|
|
|
|
GitPulse is a CLI tool that analyzes local git repositories to generate developer productivity reports. It provides commit frequency analysis, code churn tracking, contributor statistics, refactoring detection, and a beautiful terminal dashboard. Perfect for freelancers, consultants, and teams who want to understand their development patterns without external services.
|
|
|
|
## Features
|
|
|
|
- **Commit Frequency Analysis**: Track commit patterns over time with daily, weekly, and monthly statistics
|
|
- **Code Churn Tracking**: Monitor lines added/removed and identify high-churn files
|
|
- **Contributor Statistics**: Calculate per-developer metrics including commits, changes, and activity patterns
|
|
- **Refactoring Detection**: Identify file renames and potential refactoring activity
|
|
- **JSON/CSV Export**: Export analysis results for external processing and reporting
|
|
- **Interactive Dashboard**: Visual terminal UI with charts and metrics (coming soon)
|
|
- **Time Period Filtering**: Analyze commits for specific time ranges using flexible date filters
|
|
- **Configuration**: Customizable settings via configuration file
|
|
|
|
## Installation
|
|
|
|
### From Source
|
|
|
|
```bash
|
|
git clone https://github.com/gitpulse/gitpulse.git
|
|
cd gitpulse
|
|
cargo build --release
|
|
cargo install --path .
|
|
```
|
|
|
|
### From Cargo
|
|
|
|
```bash
|
|
cargo install gitpulse
|
|
```
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
# Analyze the current repository (last 30 days)
|
|
gitpulse analyze
|
|
|
|
# Analyze with specific time period
|
|
gitpulse analyze --since 7d
|
|
gitpulse analyze --since 2024-01-01 --until 2024-01-31
|
|
|
|
# Export to JSON
|
|
gitpulse analyze --json > report.json
|
|
|
|
# Export to CSV
|
|
gitpulse export --format csv --output contributors.csv
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Analyze Command
|
|
|
|
The `analyze` command generates a comprehensive analysis report:
|
|
|
|
```bash
|
|
gitpulse analyze [OPTIONS]
|
|
|
|
Options:
|
|
-s, --since <PERIOD> Time period (e.g., 7d, 2w, 1m, 1y)
|
|
-u, until <DATE> End date for analysis
|
|
-c, --commits <N> Analyze last N commits
|
|
--include-merges Include merge commits
|
|
--no-churn Skip code churn analysis
|
|
--no-refactor Skip refactoring detection
|
|
--json Output in JSON format
|
|
--history Show commit history
|
|
--top <N> Limit to top N contributors
|
|
-o, --output <PATH> Output file path (for JSON/CSV)
|
|
```
|
|
|
|
### Export Command
|
|
|
|
Export analysis results in various formats:
|
|
|
|
```bash
|
|
gitpulse export --format json --output report.json
|
|
gitpulse export --format csv --output contributors.csv
|
|
```
|
|
|
|
### Dashboard Command
|
|
|
|
Launch the interactive terminal dashboard (coming soon):
|
|
|
|
```bash
|
|
gitpulse dashboard
|
|
```
|
|
|
|
## Configuration
|
|
|
|
GitPulse uses a configuration file located at `~/.config/gitpulse/config.toml`:
|
|
|
|
```toml
|
|
[analysis]
|
|
default_time_period = "30 days"
|
|
max_contributors = 50
|
|
include_merges = false
|
|
refactoring_detection = true
|
|
|
|
[display]
|
|
theme = "dark"
|
|
chart_height = 10
|
|
compact_tables = false
|
|
show_sparklines = true
|
|
|
|
[export]
|
|
default_format = "json"
|
|
include_timestamps = true
|
|
indent_json = true
|
|
```
|
|
|
|
## Environment Variables
|
|
|
|
- `GITPULSE_CONFIG`: Path to custom config file
|
|
- `GITPULSE_THEME`: Override dashboard theme (dark/light)
|
|
- `GITPULSE_NO_COLOR`: Disable colored output
|
|
|
|
## Building from Source
|
|
|
|
```bash
|
|
# Development build
|
|
cargo build
|
|
|
|
# Release build with optimizations
|
|
cargo build --release
|
|
|
|
# Run tests
|
|
cargo test
|
|
|
|
# Run with logging
|
|
RUST_LOG=debug cargo run -- analyze
|
|
```
|
|
|
|
## Contributing
|
|
|
|
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
|
|
|
|
## License
|
|
|
|
GitPulse is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
|
|
## Acknowledgments
|
|
|
|
- Built with [clap](https://github.com/clap-rs/clap) for CLI
|
|
- Uses [git2](https://github.com/rust-lang/git2-rs) for git operations
|
|
- Terminal UI powered by [ratatui](https://github.com/ratatui/ratatui)
|