Skip to content

feat: Add project statistics command (--stats) to analyze codebase metrics #1288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

WesleyJohnson0423
Copy link

Summary

Adds a new --stats command to Codex CLI that provides comprehensive project analysis including file counts, lines of code, file type distribution, and recent file activity.

Changes

  • Added --stats/-s flag to CLI with JSON output support
  • Implemented project analysis utility with file system scanning
  • Added comprehensive test suite with 100% coverage
  • Integrated with existing command structure and help system

Features

  • File Analysis: Counts files, lines of code, and project size
  • Type Breakdown: Statistics by file extension with percentages
  • Recent Activity: Shows last 5 modified files with timestamps
  • Smart Filtering: Ignores common non-source directories (node_modules, .git, dist, etc.)
  • Dual Output: Human-readable format and JSON for automation

Usage

codex --stats                # Human-readable output
codex --stats --json         # JSON format
codex -s                     # Short form

Copy link

github-actions bot commented Jun 9, 2025


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


Jinghang Sun seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant