GitHub Copilot Usage Analytics Dashboard - Track and visualize AI assistance patterns across your organization's repositories.
Copilot Stats is a comprehensive analytics dashboard that helps organizations understand how their teams are leveraging GitHub Copilot and AI tools across their development workflow. It provides insights into:
- 📈 AI Usage Patterns - Track code generation, test creation, documentation, and review patterns
- 🔍 Copilot Review Analytics - Monitor when and how Copilot reviews are being utilized
- 📋 Repository Insights - Get detailed stats across multiple specified repositories
- Backend: NestJS, TypeScript, Octokit (GitHub API)
- Frontend: React, TypeScript, Vite
- Build System: Turborepo, pnpm
- Styling: Material UI for React
- Node.js (v18+ required)
- pnpm
- GitHub CLI (
gh) installed and authenticated - GitHub Personal Access Token with repository permissions
# Clone the repository
git clone https://github.com/incubyte/copilot-stats.git
cd copilot-stats
# Install dependencies
pnpm install
# Create .env in backend folder with your configuration
# You can use .env.example file in backend folder as reference
# Start development servers
pnpm start:devThe application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3006
Create a .env file in the backend directory:
# GitHub Configuration
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_ORG=your-organization-name
GITHUB_REPOS=repo1,repo2,repo3
# Application Configuration
PORT=3006
NODE_ENV=development| Variable | Description |
|---|---|
GITHUB_TOKEN |
GitHub Personal Access Token with repo permissions |
GITHUB_ORG |
Your GitHub organization name |
GITHUB_REPOS |
Comma-separated list of repository names to analyze |
Add the following comment block to your PR descriptions to track AI usage:
<!-- AI_USAGE_START -->
- [ ] AI_CODE: Used for code generation
- [ ] AI_TEST: Used for test generation
- [ ] AI_DOCS: Used for documentation
- [ ] AI_OTHER: Other AI usage
<!-- AI_USAGE_END -->Check the boxes that apply to indicate which types of AI assistance were used in the pull request.
copilot-stats/
├── apps/
│ ├── backend/ # NestJS API server
│ └── frontend/ # React dashboard
├── packages/ # Shared packages
├── LICENSE # MIT license
└── turbo.json # Turborepo configuration
# Development
pnpm start:dev # Start both frontend and backend in dev mode
# Build
pnpm build # Build all applications
# Clean
pnpm clean # Clean build artifactsReturns real-time Copilot usage statistics via Server-Sent Events.
Query Parameters:
days(optional): Number of days to analyze (default: 1)
Response Format:
{
"pullRequestsReviewedByCopilot": {
"repo-name": [
{
"number": 123,
"title": "Feature implementation",
"author": "username",
"closed_at": "2024-01-01T00:00:00Z",
"repo": "repo-name",
"ai_usage": {
"code": 1,
"test": 0,
"docs": 1,
"other": 0,
"review": 0
},
"copilot_review": {
"login": "github-copilot[bot]",
"type": "Bot",
"body": "Review comments...",
"url": "https://github.com/..."
}
}
]
},
"usageOfAI": {
"code": 5,
"test": 3,
"docs": 2,
"other": 1,
"review": 8
}
}This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by Incubyte