project-stats-cli
v1.0.0
Published
Analyze project statistics: lines of code, file counts, dependencies, git stats
Maintainers
Readme
project-stats-cli
A fast, zero-config CLI tool that shows comprehensive project statistics: lines of code, file type distribution, dependency counts, git history, and largest files.
Features
- Lines of code broken down by language with visual bars
- File type distribution with unicode pie indicators
- Dependency counts — production vs dev (reads
package.json) - Git stats — commits, contributors, repo age, last commit
- Largest files table
- Respects
.gitignore— skipsnode_modules,dist, lock files automatically - JSON output for scripting / CI pipelines
- Beautifully colored output via chalk
Install
npm install -g project-stats-cliOr run without installing:
npx project-stats-cliUsage
# Analyze current directory
project-stats
# Analyze a specific path
project-stats ./src
project-stats /path/to/my/project
# Output raw JSON
project-stats --json
project-stats ./src --json
# Show help
project-stats --help
# Show version
project-stats --versionExample output
◉ Project Stats /home/user/my-app
──────────────────────────────────────────────────────────
Overview
──────────────────────────────────────────────────────────
Files 142
Lines 18,432
Size 512.3 KB
──────────────────────────────────────────────────────────
Lines by Language
──────────────────────────────────────────────────────────
TypeScript ████████████░░░░░░░░ 65.2% 12,018 lines / 89 files
JSON ████░░░░░░░░░░░░░░░░ 18.1% 3,336 lines / 12 files
Markdown ██░░░░░░░░░░░░░░░░░░ 9.4% 1,732 lines / 8 files
CSS █░░░░░░░░░░░░░░░░░░░ 4.2% 773 lines / 5 files
Shell ░░░░░░░░░░░░░░░░░░░░ 3.1% 573 lines / 3 files
──────────────────────────────────────────────────────────
File Type Distribution
──────────────────────────────────────────────────────────
● TypeScript 62.7% 89 files
◑ JSON 8.5% 12 files
◔ Markdown 5.6% 8 files
◔ CSS 3.5% 5 files
◔ Shell 2.1% 3 files
──────────────────────────────────────────────────────────
Dependencies (package.json)
──────────────────────────────────────────────────────────
Production 12
Dev 18
Total 30
──────────────────────────────────────────────────────────
Git Stats
──────────────────────────────────────────────────────────
Branch main
Commits 247
Contributors 4
Age 182 days
Last commit 2 hours ago
──────────────────────────────────────────────────────────
Largest Files (by lines)
──────────────────────────────────────────────────────────
src/components/Dashboard.tsx 1,243 lines 28.4 KB
src/utils/parser.ts 891 lines 18.1 KB
...JSON output
Use --json to get machine-readable output:
{
"root": "/home/user/my-app",
"totalFiles": 142,
"totalLines": 18432,
"totalSize": 524595,
"byLanguage": {
"TypeScript": { "files": 89, "lines": 12018 }
},
"largestFiles": [...],
"git": {
"commits": 247,
"contributors": 4,
"ageInDays": 182,
"branch": "main",
"lastCommit": "2 hours ago"
},
"deps": {
"prod": 12,
"dev": 18,
"total": 30
}
}Development
git clone https://github.com/okirmio-create/project-stats-cli
cd project-stats-cli
npm install
npm run build
node dist/index.js .License
MIT © okirmio-create
