mirror of
https://github.com/github/awesome-copilot.git
synced 2026-06-18 13:41:26 +00:00
1140812aaa
* Update .NET Copilot SDK cookbook for GitHub.Copilot.SDK 1.0 Align the dotnet copilot-sdk cookbook recipes and docs with the 1.0.1 release: - Namespace GitHub.Copilot.SDK -> GitHub.Copilot - MCP config uses Dictionary<string, McpServerConfig> + McpStdioServerConfig (drop Type discriminator) - StopAsync no longer returns an error list; wrap graceful shutdown in try/catch - GetMessagesAsync -> GetEventsAsync with event pattern matching - LogLevel string -> CopilotLogLevel.Error enum * Address PR review: clarify package/namespace, default event case, MCP stdio wording - Note that the GitHub.Copilot.SDK package exposes the GitHub.Copilot namespace in each recipe - Add a default case + note to the GetEventsAsync history example so other event kinds are not silently dropped - Refine accessibility-report docs to describe a local stdio MCP server (McpStdioServerConfig via npx) * Address re-review: add using for event types, note StopAsync throw behavior
GitHub Copilot SDK Cookbook
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.
Recipes by Language
.NET (C#)
- Ralph Loop: Build autonomous AI coding loops with fresh context per iteration, planning/building modes, and backpressure.
- Error Handling: Handle errors gracefully including connection failures, timeouts, and cleanup.
- Multiple Sessions: Manage multiple independent conversations simultaneously.
- Managing Local Files: Organize files by metadata using AI-powered grouping strategies.
- PR Visualization: Generate interactive PR age charts using GitHub MCP Server.
- Persisting Sessions: Save and resume sessions across restarts.
- Accessibility Report: Generate WCAG accessibility reports using the Playwright MCP server.
Node.js / TypeScript
- Ralph Loop: Build autonomous AI coding loops with fresh context per iteration, planning/building modes, and backpressure.
- Error Handling: Handle errors gracefully including connection failures, timeouts, and cleanup.
- Multiple Sessions: Manage multiple independent conversations simultaneously.
- Managing Local Files: Organize files by metadata using AI-powered grouping strategies.
- PR Visualization: Generate interactive PR age charts using GitHub MCP Server.
- Persisting Sessions: Save and resume sessions across restarts.
- Accessibility Report: Generate WCAG accessibility reports using the Playwright MCP server.
Python
- Ralph Loop: Build autonomous AI coding loops with fresh context per iteration, planning/building modes, and backpressure.
- Error Handling: Handle errors gracefully including connection failures, timeouts, and cleanup.
- Multiple Sessions: Manage multiple independent conversations simultaneously.
- Managing Local Files: Organize files by metadata using AI-powered grouping strategies.
- PR Visualization: Generate interactive PR age charts using GitHub MCP Server.
- Persisting Sessions: Save and resume sessions across restarts.
- Accessibility Report: Generate WCAG accessibility reports using the Playwright MCP server.
Go
- Ralph Loop: Build autonomous AI coding loops with fresh context per iteration, planning/building modes, and backpressure.
- Error Handling: Handle errors gracefully including connection failures, timeouts, and cleanup.
- Multiple Sessions: Manage multiple independent conversations simultaneously.
- Managing Local Files: Organize files by metadata using AI-powered grouping strategies.
- PR Visualization: Generate interactive PR age charts using GitHub MCP Server.
- Persisting Sessions: Save and resume sessions across restarts.
- Accessibility Report: Generate WCAG accessibility reports using the Playwright MCP server.
Java
- Ralph Loop: Build autonomous AI coding loops with fresh context per iteration, planning/building modes, and backpressure.
- Error Handling: Handle errors gracefully including connection failures, timeouts, and cleanup.
- Multiple Sessions: Manage multiple independent conversations simultaneously.
- Managing Local Files: Organize files by metadata using AI-powered grouping strategies.
- PR Visualization: Generate interactive PR age charts using GitHub MCP Server.
- Persisting Sessions: Save and resume sessions across restarts.
- Accessibility Report: Generate WCAG accessibility reports using the Playwright MCP server.
How to Use
- Browse your language section above and open the recipe links
- Each recipe includes runnable examples in a
recipe/subfolder with language-specific tooling - See existing examples and tests for working references:
- Node.js examples:
nodejs/examples/basic-example.ts - E2E tests:
go/e2e,python/e2e,nodejs/test/e2e,dotnet/test/Harness
- Node.js examples:
Running Examples
.NET
cd dotnet/cookbook/recipe
dotnet run <filename>.cs
Node.js
cd nodejs/cookbook/recipe
npm install
npx tsx <filename>.ts
Python
cd python/cookbook/recipe
pip install -r requirements.txt
python <filename>.py
Go
cd go/cookbook/recipe
go run <filename>.go
Java
cd java/recipe
jbang <FileName>.java
Contributing
- Propose or add a new recipe by creating a markdown file in your language's
cookbook/folder and a runnable example inrecipe/ - Follow repository guidance in CONTRIBUTING.md
Status
Cookbook structure is complete with 7 recipes across all 5 supported languages. Each recipe includes both markdown documentation and runnable examples.