|
2 | 2 |
|
3 | 3 | Build an interactive CLI tool that visualizes pull request age distribution for a GitHub repository using Copilot's built-in capabilities. |
4 | 4 |
|
5 | | -## Example scenario |
| 5 | +## Prerequisites |
6 | 6 |
|
7 | | -You want to understand how long PRs have been open in a repository. This tool detects the current Git repo or accepts a repo as input, then lets Copilot fetch PR data via the GitHub MCP Server and generate a chart image. |
| 7 | +Install [JBang](https://www.jbang.dev/) to run this example: |
8 | 8 |
|
9 | | -## Prerequisites |
| 9 | +```bash |
| 10 | +# macOS (using Homebrew) |
| 11 | +brew install jbangdev/tap/jbang |
10 | 12 |
|
11 | | -Add the following dependency to your `pom.xml`: |
| 13 | +# Linux/macOS (using curl) |
| 14 | +curl -Ls https://sh.jbang.dev | bash -s - app setup |
12 | 15 |
|
13 | | -```xml |
14 | | -<dependency> |
15 | | - <groupId>io.github.copilot-community-sdk</groupId> |
16 | | - <artifactId>copilot-sdk</artifactId> |
17 | | - <version>1.0.8</version> |
18 | | -</dependency> |
| 16 | +# Windows (using Scoop) |
| 17 | +scoop install jbang |
19 | 18 | ``` |
20 | 19 |
|
| 20 | +## Example scenario |
| 21 | + |
| 22 | +You want to understand how long PRs have been open in a repository. This tool detects the current Git repo or accepts a repo as input, then lets Copilot fetch PR data via the GitHub MCP Server and generate a chart image. |
| 23 | + |
21 | 24 | ## Usage |
22 | 25 |
|
23 | 26 | ```bash |
24 | 27 | # Auto-detect from current git repo |
25 | | -java PRVisualization.java |
| 28 | +jbang PRVisualization.java |
26 | 29 |
|
27 | 30 | # Specify a repo explicitly |
28 | | -java PRVisualization.java github/copilot-sdk |
| 31 | +jbang PRVisualization.java github/copilot-sdk |
29 | 32 | ``` |
30 | 33 |
|
31 | 34 | ## Full example: PRVisualization.java |
@@ -222,14 +225,3 @@ public class PRVisualization { |
222 | 225 | | Flexibility | Fixed logic | **AI decides best approach** | |
223 | 226 | | Chart types | What you coded | **Any type Copilot can generate** | |
224 | 227 | | Data grouping | Hardcoded buckets | **Intelligent grouping** | |
225 | | - |
226 | | -## Running with JBang |
227 | | - |
228 | | -You can also run this example directly with JBang: |
229 | | - |
230 | | -```bash |
231 | | -//DEPS io.github.copilot-community-sdk:copilot-sdk:${project.version} |
232 | | - |
233 | | -# Then run: |
234 | | -jbang PRVisualization.java github/copilot-sdk |
235 | | -``` |
0 commit comments