Skip to content

stats

Show repository commit statistics.

Synopsis:

bash
gcop-rs stats [OPTIONS]

Description:

Analyzes commit history and reports:

  • overview (total commits, contributors, time span)
  • top contributors
  • recent weekly activity (last 4 weeks)
  • daily activity heatmap (last 30 days)
  • current and longest commit streak
  • optional per-author line-level contribution statistics (--contrib, merge commits excluded)

Options:

OptionDescription
--format <FORMAT>, -fOutput format: text (default), json, or markdown
--jsonShortcut for --format json
--author <NAME>Filter all statistics by author name or email
--contribInclude per-author line-level contribution statistics

Examples:

bash
# Basic usage (text format)
gcop-rs stats

# Output as JSON for automation
gcop-rs stats --format json
gcop-rs stats --json

# Output as Markdown for reports
gcop-rs stats --format markdown > STATS.md

# Filter by specific author
gcop-rs stats --author "john"
gcop-rs stats --author "john@example.com"

# Include line-level contribution stats
gcop-rs stats --contrib
gcop-rs stats --author "john" --contrib

Note: In json/markdown formats, stats output is non-interactive (no step/spinner UI lines).

Note: --contrib computes line-level insert/delete stats per commit and skips merge commits.

Output Format (text):

ℹ Repository Statistics
────────────────────────────────────────

  ▸ Overview
    Total commits:    170
    Contributors:     6
    Time span:        2025-12-16 ~ 2026-02-12 (57 days)

  ▸ Top Contributors
    #1  AptS-1547 <esaps@esaps.net>  133 commits (78.2%)
    #2  AptS-1738 <apts-1738@esaps.net>  32 commits (18.8%)

  ▸ Recent Activity (last 4 weeks)
    2026-W07: █                    4
    2026-W06: ████████████████████ 45
    2026-W05:                      0
    2026-W04: ██████               14

  ▸ Commit Activity (last 30 days)
    01/14 ▂······▄▂·············▂▂▄█···▂ 02/12  peak: 31

  ▸ Streak
    Current streak:   1 days
    Longest streak:   9 days

Output Format (json):

json
{
  "success": true,
  "data": {
    "total_commits": 170,
    "total_authors": 6,
    "first_commit_date": "2025-12-16T14:38:08+08:00",
    "last_commit_date": "2026-02-12T06:03:30+08:00",
    "authors": [
      {"name": "AptS-1547", "email": "esaps@esaps.net", "commits": 133},
      {"name": "AptS-1738", "email": "apts-1738@esaps.net", "commits": 32}
    ],
    "commits_by_week": {
      "2026-W04": 14,
      "2026-W05": 0,
      "2026-W06": 45,
      "2026-W07": 4
    },
    "commits_by_day": {
      "2026-02-08": 31,
      "2026-02-12": 4
    },
    "current_streak": 1,
    "longest_streak": 9
  }
}

Output Format (json + contrib):

json
{
  "success": true,
  "data": {
    "total_commits": 170,
    "contrib": {
      "total_insertions": 4200,
      "total_deletions": 1800,
      "total_lines": 6000,
      "merge_commits_skipped": 3,
      "authors": [
        {
          "name": "AptS-1547",
          "email": "esaps@esaps.net",
          "insertions": 2800,
          "deletions": 900,
          "total": 3700,
          "percentage": 61.67
        }
      ]
    }
  }
}

Tips:

  • Use --format json for CI/CD integration or scripts
  • Use --author to focus on one contributor
  • Markdown output includes commit activity by day (non-zero days only)

See Also