An AI-powered tool for analyzing GitHub pull requests using the GitHub Copilot SDK. Get instant insights and visualizations about your repository's PRs.
Automatically analyzes pull requests and generates:
- Visual charts showing PR age distribution
- Insights about contributors and patterns
- Recommendations for improving workflow
- Interactive Q&A - ask follow-up questions in natural language
The GitHub Copilot SDK handles everything - fetching data, generating charts, and providing insights.
Install Copilot CLI:
npm install -g @github/copilot-cliAuthenticate:
gh auth loginnpm install
npm start -- --repo github/copilot-sdkIf you're in a git repository with a GitHub remote:
npm startnpm start -- --repo facebook/reactnpm run demoRun analysis once and exit:
npm start -- --repo microsoft/vscode --non-interactiveAfter the initial analysis, you can ask follow-up questions:
You: Who are the most active contributors?
You: Which PRs have been open the longest?
You: What patterns do you see?
You: Any recommendations for improving our workflow?
Type exit to quit.
// 1. Create Copilot client
const client = new CopilotClient();
await client.start();
// 2. Create a session
const session = await client.createSession({
model: "gpt-4o",
systemMessage: {
content: "You are analyzing GitHub pull requests..."
}
});
// 3. Listen for responses
session.on((event) => {
if (event.type === "assistant.message") {
console.log(event.data.content);
}
});
// 4. Send requests - responses come via events
session.send({
prompt: "Please analyze the open pull requests"
});Copilot automatically:
- Fetches PR data from GitHub
- Analyzes patterns and trends
- Provides actionable insights
- Answers follow-up questions
π PR Insights Dashboard
π¦ Auto-detected: github/copilot-sdk
π Analyzing: github/copilot-sdk
β
Connected to Copilot
π Analyzing pull requests...
I've analyzed the repository and created a visualization. Here's what I found:
The repository has 34 open pull requests with the following distribution:
- 0-7 days old: 15 PRs (44%)
- 7-30 days old: 12 PRs (35%)
- 30-90 days old: 5 PRs (15%)
- 90+ days old: 2 PRs (6%)
I've saved a chart as 'pr-age-distribution.png' showing this distribution.
Top Contributors:
- Copilot AI: 8 PRs
- john0isaac: 4 PRs
- reachanihere: 3 PRs
Recommendations:
- Focus review efforts on the 5 PRs over 30 days old
- Consider pairing reviewers for faster turnaround
π‘ Ask follow-up questions (or type 'exit')
You: Create a pie chart showing PRs by label
Creating a pie chart of PR labels...
Saved as 'pr-labels.png'
You: exit
π Goodbye!
Modify the systemMessage to focus on different aspects:
systemMessage: {
content: `Analyze PRs with focus on:
- Review velocity and bottlenecks
- New contributor onboarding
- Breaking changes and dependencies
- Documentation coverage`
}Add common queries as CLI options:
npm start -- --repo owner/repo --analysis reviews
npm start -- --repo owner/repo --analysis contributors
npm start -- --repo owner/repo --analysis velocityCompare multiple repositories:
const repos = ['facebook/react', 'vercel/next.js', 'angular/angular'];
for (const repo of repos) {
// Analyze each and compare
}Run daily/weekly with cron or GitHub Actions:
- name: PR Analysis
run: npm start -- --repo ${{ github.repository }} --non-interactivepr-dashboard/
βββ src/
β βββ index.ts # Main application
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript config
βββ README.md # This file
"copilot: command not found"
npm install -g @github/copilot-cli"Authentication required"
gh auth loginWant to analyze private repos? Make sure you're authenticated with appropriate permissions.
Ideas for enhancements:
- Add predefined analysis templates
- Support for issues analysis
- Team performance metrics
- Historical trend tracking
- Export conversation history
- Slack/Discord integration
Built with GitHub Copilot SDK - Pure AI-powered insights! π€