opencode Verified current stable Not installed? Version Control

Opencode / Show Statistics Last N Days

Show Statistics Last N Days

Retrieve statistics from the Opencode tool for a specified number of days.

$
Terminal
opencode stats --days <30>

When To Use

During a network performance review to assess usage trends over the past month.

Pro Tip

Use the `--include-inactive` flag to include statistics from inactive users, revealing potentially valuable insights.

Anatomy of Output

Understanding the result

Total Commits: 1200 Total Commits

Total number of code commits in the past 30 days.

Active Users: 320 Active Users

Number of distinct users who have committed code.

Average Commits per User: 3.75 Engagement Metric

Average number of commits per active user.

Power User Variants

Optimized versions

opencode stats --days 30 --include-inactive

Includes statistics from inactive users in the output.

opencode stats --days -1

Fetches statistics only for past days, ensuring future dates aren't queried.

Troubleshooting

Common pitfalls

Error: Invalid argument --days

Solution: Ensure the number of days is a positive integer.

Error: No data available for specified days

Solution: Check if the requested period has any commit activity.

Error: Unknown flag --include-inactive

Solution: Remove unsupported flags; ensure compatibility with Opencode version.

Command Breakdown

What each part is doing

opencode
Base Command
The executable that performs this operation. Here it runs Opencode before the shell applies any redirect operators.
<30>
30
The value supplied for 30.
--days
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative version control tools for the same job.