Skip to content

Commit 40ffae5

Browse files
committed
Merge main into jm/infinite, update protocol to v2
1 parent bfa9b72 commit 40ffae5

File tree

103 files changed

+11998
-1256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+11998
-1256
lines changed

.github/workflows/sdk-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
env:
112112
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
113113
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
114-
run: ./test.sh
114+
run: /bin/bash test.sh
115115

116116
python-sdk:
117117
name: "Python SDK Tests"

CONTRIBUTING.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Currently **we are not looking to add SDKs for other languages**. If you want to
2626
This is a multi-language SDK repository. Install the tools for the SDK(s) you plan to work on:
2727

2828
### All SDKs
29-
1. Install [just](https://github.com/casey/just) command runner
29+
1. (Optional) Install [just](https://github.com/casey/just) command runner for convenience
3030

3131
### Node.js/TypeScript SDK
3232
1. Install [Node.js](https://nodejs.org/) (v18+)
@@ -44,7 +44,13 @@ This is a multi-language SDK repository. Install the tools for the SDK(s) you pl
4444

4545
### .NET SDK
4646
1. Install [.NET 8.0+](https://dotnet.microsoft.com/download)
47-
1. Install dependencies: `cd dotnet && dotnet restore`
47+
1. Install [Node.js](https://nodejs.org/) (v18+) (the .NET tests depend on a TypeScript-based test harness)
48+
1. Install npm dependencies (from the repository root):
49+
```bash
50+
cd nodejs && npm ci
51+
cd test/harness && npm ci
52+
```
53+
1. Install .NET dependencies: `cd dotnet && dotnet restore`
4854

4955
## Submitting a pull request
5056

@@ -59,7 +65,7 @@ This is a multi-language SDK repository. Install the tools for the SDK(s) you pl
5965

6066
### Running tests and linters
6167

62-
Use `just` to run tests and linters across all SDKs or for specific languages:
68+
If you installed `just`, you can use it to run tests and linters across all SDKs or for specific languages:
6369

6470
```bash
6571
# All SDKs

README.md

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
1-
# Copilot CLI SDKs
1+
# GitHub Copilot CLI SDKs
22

3-
Language-specific SDKs for programmatic access to the GitHub Copilot CLI.
3+
![GitHub Copilot SDK](./assets/RepoHeader_01.png)
44

5-
All SDKs are in technical preview and may change in breaking ways as we move towards a stable release.
5+
Agents for every app.
6+
7+
Embed Copilot's agentic workflows in your application—now available in Technical preview as a programmable SDK for Python, TypeScript, Go, and .NET.
8+
9+
The GitHub Copilot SDK exposes the same engine behind Copilot CLI: a production-tested agent runtime you can invoke programmatically. No need to build your own orchestration—you define agent behavior, Copilot handles planning, tool invocation, file edits, and more.
610

711
## Available SDKs
812

9-
| SDK | Location | Installation |
10-
| ------------------------ | --------------------------------- | ----------------------------------------- |
11-
| **Node.js / TypeScript** | [`./nodejs/`](./nodejs/README.md) | `npm install @github/copilot-sdk` |
12-
| **Python** | [`./python/`](./python/README.md) | `pip install github-copilot-sdk` |
13-
| **Go** | [`./go/`](./go/README.md) | `go get github.com/github/copilot-sdk/go` |
14-
| **.NET** | [`./dotnet/`](./dotnet/README.md) | `dotnet add package GitHub.Copilot.SDK` |
13+
| SDK | Location | Installation |
14+
| ------------------------ | --------------------------------- | ------------------------------------------ |
15+
| **Node.js / TypeScript** | [`./nodejs/`](./nodejs/README.md) | `npm install @github/copilot-sdk` |
16+
| **Python** | [`./python/`](./python/README.md) | `pip install github-copilot-sdk` |
17+
| **Go** | [`./go/`](./go/README.md) | `go get github.com/github/copilot-sdk/go` |
18+
| **.NET** | [`./dotnet/`](./dotnet/README.md) | `dotnet add package GitHub.Copilot.SDK` |
19+
| **Rust** | [`./rust/`](./rust/README.md) | `cargo add github-copilot-sdk` |
1520

1621
See the individual SDK READMEs for installation, usage examples, and API reference.
1722

1823
## Getting Started
1924

25+
For a complete walkthrough, see the **[Getting Started Guide](./docs/getting-started.md)**.
26+
27+
Quick steps:
28+
2029
1. **Install the Copilot CLI:**
2130

2231
Follow the [Copilot CLI installation guide](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli) to install the CLI, or ensure `copilot` is available in your PATH.
@@ -39,6 +48,54 @@ Your Application
3948

4049
The SDK manages the CLI process lifecycle automatically. You can also connect to an external CLI server—see individual SDK docs for details.
4150

51+
## FAQ
52+
53+
### Do I need a GitHub Copilot subscription to use the SDK?
54+
55+
Yes, a GitHub Copilot subscription is required to use the GitHub Copilot SDK. Refer to the [GitHub Copilot pricing page](https://github.com/features/copilot#pricing). You can use the free tier of the Copilot CLI, which includes limited usage.
56+
57+
### How does billing work for SDK usage?
58+
59+
Billing for the GitHub Copilot SDK is based on the same model as the Copilot CLI, with each prompt being counted towards your premium request quota. For more information on premium requests, see [Requests in GitHub Copilot](https://docs.github.com/en/copilot/concepts/billing/copilot-requests).
60+
61+
### Does it support BYOK (Bring Your Own Key)?
62+
63+
Yes, the GitHub Copilot SDK supports BYOK. You can configure the SDK to use your own encryption keys for data security. Refer to the individual SDK documentation for instructions on setting up BYOK.
64+
65+
### Do I need to install the Copilot CLI separately?
66+
67+
Yes, the Copilot CLI must be installed separately. The SDKs communicate with the Copilot CLI in server mode to provide agent capabilities.
68+
69+
### What tools are enabled by default?
70+
71+
By default, the SDK will operate the Copilot CLI in the equivalent of `--allow-all` being passed to the CLI, enabling all first-party tools, which means that the agents can perform a wide range of actions, including file system operations, Git operations, and web requests. You can customize tool availability by configuring the SDK client options to enable and disable specific tools. Refer to the individual SDK documentation for details on tool configuration and Copilot CLI for the list of tools available.
72+
73+
### Can I use custom agents, skills or tools?
74+
75+
Yes, the GitHub Copilot SDK allows you to define custom agents, skills, and tools. You can extend the functionality of the agents by implementing your own logic and integrating additional tools as needed. Refer to the SDK documentation of your preferred language for more details.
76+
77+
### Are there instructions for Copilot to speed up development with the SDK?
78+
79+
Yes, check out the custom instructions at [`github/awesome-copilot`](https://github.com/github/awesome-copilot/blob/main/collections/copilot-sdk.md).
80+
81+
### What models are supported?
82+
83+
All models available via Copilot CLI are supported in the SDK. The SDK also exposes a method which will return the models available so they can be accessed at runtime.
84+
85+
### Is the SDK production-ready?
86+
87+
The GitHub Copilot SDK is currently in Technical Preview. While it is functional and can be used for development and testing, it may not yet be suitable for production use.
88+
89+
### How do I report issues or request features?
90+
91+
Please use the [GitHub Issues](https://github.com/github/copilot-sdk/issues) page to report bugs or request new features. We welcome your feedback to help improve the SDK.
92+
93+
## Quick Links
94+
95+
- **[Getting Started](./docs/getting-started.md)** – Tutorial to get up and running
96+
- **[Cookbook](./cookbook/README.md)** – Practical recipes for common tasks across all languages
97+
- **[Samples](./samples/README.md)** – Video walkthroughs and sample projects
98+
4299
## Contributing
43100

44101
See [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution guidelines.

assets/RepoHeader_01.png

55.9 KB
Loading

cookbook/README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# GitHub Copilot SDK Cookbook
2+
3+
This cookbook collects small, focused recipes showing how to accomplish common tasks with the GitHub Copilot SDK across languages. Each recipe is intentionally short and practical, with copy‑pasteable snippets and pointers to fuller examples and tests.
4+
5+
## Recipes by Language
6+
7+
### .NET (C#)
8+
9+
- [Error Handling](dotnet/error-handling.md): Handle errors gracefully including connection failures, timeouts, and cleanup.
10+
- [Multiple Sessions](dotnet/multiple-sessions.md): Manage multiple independent conversations simultaneously.
11+
- [Managing Local Files](dotnet/managing-local-files.md): Organize files by metadata using AI-powered grouping strategies.
12+
- [PR Visualization](dotnet/pr-visualization.md): Generate interactive PR age charts using GitHub MCP Server.
13+
- [Persisting Sessions](dotnet/persisting-sessions.md): Save and resume sessions across restarts.
14+
15+
### Node.js / TypeScript
16+
17+
- [Error Handling](nodejs/error-handling.md): Handle errors gracefully including connection failures, timeouts, and cleanup.
18+
- [Multiple Sessions](nodejs/multiple-sessions.md): Manage multiple independent conversations simultaneously.
19+
- [Managing Local Files](nodejs/managing-local-files.md): Organize files by metadata using AI-powered grouping strategies.
20+
- [PR Visualization](nodejs/pr-visualization.md): Generate interactive PR age charts using GitHub MCP Server.
21+
- [Persisting Sessions](nodejs/persisting-sessions.md): Save and resume sessions across restarts.
22+
23+
### Python
24+
25+
- [Error Handling](python/error-handling.md): Handle errors gracefully including connection failures, timeouts, and cleanup.
26+
- [Multiple Sessions](python/multiple-sessions.md): Manage multiple independent conversations simultaneously.
27+
- [Managing Local Files](python/managing-local-files.md): Organize files by metadata using AI-powered grouping strategies.
28+
- [PR Visualization](python/pr-visualization.md): Generate interactive PR age charts using GitHub MCP Server.
29+
- [Persisting Sessions](python/persisting-sessions.md): Save and resume sessions across restarts.
30+
31+
### Go
32+
33+
- [Error Handling](go/error-handling.md): Handle errors gracefully including connection failures, timeouts, and cleanup.
34+
- [Multiple Sessions](go/multiple-sessions.md): Manage multiple independent conversations simultaneously.
35+
- [Managing Local Files](go/managing-local-files.md): Organize files by metadata using AI-powered grouping strategies.
36+
- [PR Visualization](go/pr-visualization.md): Generate interactive PR age charts using GitHub MCP Server.
37+
- [Persisting Sessions](go/persisting-sessions.md): Save and resume sessions across restarts.
38+
39+
## How to Use
40+
41+
- Browse your language section above and open the recipe links
42+
- Each recipe includes runnable examples in a `recipe/` subfolder with language-specific tooling
43+
- See existing examples and tests for working references:
44+
- Node.js examples: `nodejs/examples/basic-example.ts`
45+
- E2E tests: `go/e2e`, `python/e2e`, `nodejs/test/e2e`, `dotnet/test/Harness`
46+
47+
## Running Examples
48+
49+
### .NET
50+
51+
```bash
52+
cd dotnet/cookbook/recipe
53+
dotnet run <filename>.cs
54+
```
55+
56+
### Node.js
57+
58+
```bash
59+
cd nodejs/cookbook/recipe
60+
npm install
61+
npx tsx <filename>.ts
62+
```
63+
64+
### Python
65+
66+
```bash
67+
cd python/cookbook/recipe
68+
pip install -r requirements.txt
69+
python <filename>.py
70+
```
71+
72+
### Go
73+
74+
```bash
75+
cd go/cookbook/recipe
76+
go run <filename>.go
77+
```
78+
79+
## Contributing
80+
81+
- Propose or add a new recipe by creating a markdown file in your language's `cookbook/` folder and a runnable example in `recipe/`
82+
- Follow repository guidance in [CONTRIBUTING.md](../CONTRIBUTING.md)
83+
84+
## Status
85+
86+
Cookbook structure is complete with 4 recipes across all 4 supported languages. Each recipe includes both markdown documentation and runnable examples.

cookbook/dotnet/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# GitHub Copilot SDK Cookbook — .NET (C#)
2+
3+
This folder hosts short, practical recipes for using the GitHub Copilot SDK with .NET. Each recipe is concise, copy‑pasteable, and points to fuller examples and tests.
4+
5+
## Recipes
6+
7+
- [Error Handling](error-handling.md): Handle errors gracefully including connection failures, timeouts, and cleanup.
8+
- [Multiple Sessions](multiple-sessions.md): Manage multiple independent conversations simultaneously.
9+
- [Managing Local Files](managing-local-files.md): Organize files by metadata using AI-powered grouping strategies.
10+
- [PR Visualization](pr-visualization.md): Generate interactive PR age charts using GitHub MCP Server.
11+
- [Persisting Sessions](persisting-sessions.md): Save and resume sessions across restarts.
12+
13+
## Contributing
14+
15+
Add a new recipe by creating a markdown file in this folder and linking it above. Follow repository guidance in [CONTRIBUTING.md](../../CONTRIBUTING.md).
16+
17+
## Status
18+
19+
This README is a scaffold; recipe files are placeholders until populated.

0 commit comments

Comments
 (0)