Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b904431
Add setup guides for GitHub OAuth and local CLI usage (#415)
patniko Feb 9, 2026
4dc5629
fix: set executable permission on CLI binary in Python wheel (#419)
SteveSandersonMS Feb 10, 2026
f1d8cc1
[go] support bundling and auto installing the GitHub Copilot CLI (#414)
qmuntal Feb 12, 2026
7e069fd
RPC codegen (#464)
SteveSandersonMS Feb 13, 2026
e40d57c
Expose session context, add filtering, and context_changed event (#427)
jmoseley Feb 13, 2026
8598dc3
Fix ObjectDisposedException when disposing session after client.StopA…
SteveSandersonMS Feb 16, 2026
304d812
fix: fall back to portable RID for bundled CLI lookup on Linux (#424)…
SteveSandersonMS Feb 16, 2026
ce54e43
Add copy constructors and Clone methods to the various .NET config op…
stephentoub Feb 16, 2026
f460b5d
Fix maccatalyst RID detection in SDK targets (#485)
SteveSandersonMS Feb 16, 2026
273c425
Allow custom npm registry URL for downloading Copilot from dotnet SDK…
nayanshah Feb 16, 2026
f1038d7
Hide CLI console window on Windows across all SDKs (#329)
Copilot Feb 16, 2026
46a1239
Change Node engine requirement to 20+. Use 22 for CI.
SteveSandersonMS Feb 16, 2026
5016587
Fix Available SDKs table Location links to point to SDK subfolders (#…
SteveSandersonMS Feb 16, 2026
3c5368a
Update @github/copilot to 0.0.411-0 (#491)
SteveSandersonMS Feb 17, 2026
e22d235
Fix .NET SDK CLI download timeout (#493)
SteveSandersonMS Feb 17, 2026
ed51ab8
Add minimal chat samples for all SDK languages (#492)
SteveSandersonMS Feb 17, 2026
df23ff4
Add CopilotSkipCliDownload option to .NET SDK (#494)
SteveSandersonMS Feb 17, 2026
6003273
Fix MCP env vars: send envValueMode direct across all SDKs (#484)
SteveSandersonMS Feb 17, 2026
2f2bcf7
Bump CLI dep to 0.0.411 (#497)
friggeri Feb 18, 2026
8a9f992
Fix formatting and update SDK table in README
krukow Feb 18, 2026
19d8cea
docs: Add Azure Managed Identity guide for BYOK (#498)
tonybaloney Feb 18, 2026
3e2d2b2
Breaking change: deny all permissions by default (#509)
SteveSandersonMS Feb 18, 2026
397ef66
feat: add clientName to SessionConfig across all SDKs (#510)
devm33 Feb 19, 2026
970db18
If running under bun, fall back on finding `node` from path
SteveSandersonMS Feb 19, 2026
886e5aa
Fix flaky abort test: approve permissions to avoid race with deny-by-…
SteveSandersonMS Feb 19, 2026
c263dfc
Add E2E scenario tests/examples for all SDK languages (#512)
patniko Feb 19, 2026
93a3f71
python: migrate to PEP 639 license-files (#456)
brettcannon Feb 20, 2026
c884332
fix(python): clean up setuptools usage and drop redundant/unnecessary…
brettcannon Feb 20, 2026
c4b3b36
Bump manylinux tag to glibc 2.28 for Node 24.11 (#428)
brettcannon Feb 20, 2026
f6eb8ae
Merge remote-tracking branch 'upstream/main' into upstream-sync/test-…
Feb 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 56 additions & 0 deletions .github/workflows/codegen-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Codegen Check"

on:
push:
branches:
- main
pull_request:
paths:
- 'scripts/codegen/**'
- 'nodejs/src/generated/**'
- 'dotnet/src/Generated/**'
- 'python/copilot/generated/**'
- 'go/generated_*.go'
- 'go/rpc/**'
- '.github/workflows/codegen-check.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
check:
name: "Verify generated files are up-to-date"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install nodejs SDK dependencies
working-directory: ./nodejs
run: npm ci

- name: Install codegen dependencies
working-directory: ./scripts/codegen
run: npm ci

- name: Run codegen
working-directory: ./scripts/codegen
run: npm run generate

- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Generated files are out of date. Run 'cd scripts/codegen && npm run generate' and commit the changes."
git diff --stat
git diff
exit 1
fi
echo "✅ Generated files are up-to-date"
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
dotnet-version: "8.0.x"
- uses: actions/setup-node@v6
with:
node-version: "24"
node-version: "22"
cache: "npm"
cache-dependency-path: "./nodejs/package-lock.json"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
cache: "npm"
cache-dependency-path: "./nodejs/package-lock.json"
node-version: 24
node-version: 22
- name: Install dependencies
run: npm ci --ignore-scripts

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
python-version: "3.12"
- uses: actions/setup-node@v6
with:
node-version: "24"
node-version: "22"
cache: "npm"
cache-dependency-path: "./nodejs/package-lock.json"

Expand All @@ -59,7 +59,7 @@ jobs:
enable-cache: true

- name: Install Python dev dependencies
run: uv sync --locked --all-extras --dev
run: uv sync --all-extras --dev

- name: Install Node.js dependencies (for CLI in tests)
working-directory: ./nodejs
Expand Down
186 changes: 186 additions & 0 deletions .github/workflows/scenario-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
name: "Scenario Build Verification"

on:
pull_request:
paths:
- "test/scenarios/**"
- "nodejs/src/**"
- "python/copilot/**"
- "go/**/*.go"
- "dotnet/src/**"
- ".github/workflows/scenario-builds.yml"
push:
branches:
- main
paths:
- "test/scenarios/**"
- ".github/workflows/scenario-builds.yml"
workflow_dispatch:
merge_group:

permissions:
contents: read

jobs:
# ── TypeScript ──────────────────────────────────────────────────────
build-typescript:
name: "TypeScript scenarios"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
with:
node-version: 22

- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-scenarios-${{ hashFiles('test/scenarios/**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-scenarios-
# Build the SDK so local file: references resolve
- name: Build SDK
working-directory: nodejs
run: npm ci --ignore-scripts

- name: Build all TypeScript scenarios
run: |
PASS=0; FAIL=0; FAILURES=""
for dir in $(find test/scenarios -path '*/typescript/package.json' -exec dirname {} \; | sort); do
scenario="${dir#test/scenarios/}"
echo "::group::$scenario"
if (cd "$dir" && npm install --ignore-scripts 2>&1); then
echo "✅ $scenario"
PASS=$((PASS + 1))
else
echo "❌ $scenario"
FAIL=$((FAIL + 1))
FAILURES="$FAILURES\n $scenario"
fi
echo "::endgroup::"
done
echo ""
echo "TypeScript builds: $PASS passed, $FAIL failed"
if [ "$FAIL" -gt 0 ]; then
echo -e "Failures:$FAILURES"
exit 1
fi
# ── Python ──────────────────────────────────────────────────────────
build-python:
name: "Python scenarios"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install Python SDK
run: pip install -e python/

- name: Compile and import-check all Python scenarios
run: |
PASS=0; FAIL=0; FAILURES=""
for main in $(find test/scenarios -path '*/python/main.py' | sort); do
dir=$(dirname "$main")
scenario="${dir#test/scenarios/}"
echo "::group::$scenario"
if python3 -m py_compile "$main" 2>&1 && python3 -c "import copilot" 2>&1; then
echo "✅ $scenario"
PASS=$((PASS + 1))
else
echo "❌ $scenario"
FAIL=$((FAIL + 1))
FAILURES="$FAILURES\n $scenario"
fi
echo "::endgroup::"
done
echo ""
echo "Python builds: $PASS passed, $FAIL failed"
if [ "$FAIL" -gt 0 ]; then
echo -e "Failures:$FAILURES"
exit 1
fi
# ── Go ──────────────────────────────────────────────────────────────
build-go:
name: "Go scenarios"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-go@v6
with:
go-version: "1.24"
cache: true
cache-dependency-path: test/scenarios/**/go.sum

- name: Build all Go scenarios
run: |
PASS=0; FAIL=0; FAILURES=""
for mod in $(find test/scenarios -path '*/go/go.mod' | sort); do
dir=$(dirname "$mod")
scenario="${dir#test/scenarios/}"
echo "::group::$scenario"
if (cd "$dir" && go build ./... 2>&1); then
echo "✅ $scenario"
PASS=$((PASS + 1))
else
echo "❌ $scenario"
FAIL=$((FAIL + 1))
FAILURES="$FAILURES\n $scenario"
fi
echo "::endgroup::"
done
echo ""
echo "Go builds: $PASS passed, $FAIL failed"
if [ "$FAIL" -gt 0 ]; then
echo -e "Failures:$FAILURES"
exit 1
fi
# ── C# ─────────────────────────────────────────────────────────────
build-csharp:
name: "C# scenarios"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"

- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-scenarios-${{ hashFiles('test/scenarios/**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-scenarios-
- name: Build all C# scenarios
run: |
PASS=0; FAIL=0; FAILURES=""
for proj in $(find test/scenarios -name '*.csproj' | sort); do
dir=$(dirname "$proj")
scenario="${dir#test/scenarios/}"
echo "::group::$scenario"
if (cd "$dir" && dotnet build --nologo 2>&1); then
echo "✅ $scenario"
PASS=$((PASS + 1))
else
echo "❌ $scenario"
FAIL=$((FAIL + 1))
FAILURES="$FAILURES\n $scenario"
fi
echo "::endgroup::"
done
echo ""
echo "C# builds: $PASS passed, $FAIL failed"
if [ "$FAIL" -gt 0 ]; then
echo -e "Failures:$FAILURES"
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Documentation validation output
docs/.validation/
.DS_Store
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ The GitHub Copilot SDK exposes the same engine behind Copilot CLI: a production-

## Available SDKs

| SDK | Location | Installation |
| ------------------------ | ------------------------------------------------- | ----------------------------------------- |
| **Node.js / TypeScript** | [`cookbook/nodejs/`](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/nodejs/README.md) | `npm install @github/copilot-sdk` |
| **Python** | [`cookbook/python/`](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/python/README.md) | `pip install github-copilot-sdk` |
| **Go** | [`cookbook/go/`](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/go/README.md) | `go get github.com/github/copilot-sdk/go` |
| **.NET** | [`cookbook/dotnet/`](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/dotnet/README.md) | `dotnet add package GitHub.Copilot.SDK` |
| SDK | Location | Cookbook | Installation |
| ------------------------ | -------------- | ------------------------------------------------- | ----------------------------------------- |
| **Node.js / TypeScript** | [`nodejs/`](./nodejs/) | [Cookbook](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/nodejs/README.md) | `npm install @github/copilot-sdk` |
| **Python** | [`python/`](./python/) | [Cookbook](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/python/README.md) | `pip install github-copilot-sdk` |
| **Go** | [`go/`](./go/) | [Cookbook](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/go/README.md) | `go get github.com/github/copilot-sdk/go` |
| **.NET** | [`dotnet/`](./dotnet/) | [Cookbook](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/dotnet/README.md) | `dotnet add package GitHub.Copilot.SDK` |

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

Expand Down Expand Up @@ -116,17 +116,17 @@ Please use the [GitHub Issues](https://github.com/github/copilot-sdk/issues) pag

⚠️ Disclaimer: These are unofficial, community-driven SDKs and they are not supported by GitHub. Use at your own risk.

| SDK | Location |
| --------------| -------------------------------------------------- |
| **Java** | [copilot-community-sdk/copilot-sdk-java][sdk-java] |
| **Rust** | [copilot-community-sdk/copilot-sdk-rust][sdk-rust] |
| **C++** | [0xeb/copilot-sdk-cpp][sdk-cpp] |
| **Clojure** | [krukow/copilot-sdk-clojure][sdk-clojure] |
| SDK | Location |
| --------------| ----------------------------------------------------------------- |
| **Java** | [copilot-community-sdk/copilot-sdk-java][sdk-java] |
| **Rust** | [copilot-community-sdk/copilot-sdk-rust][sdk-rust] |
| **Clojure** | [copilot-community-sdk/copilot-sdk-clojure][sdk-clojure] |
| **C++** | [0xeb/copilot-sdk-cpp][sdk-cpp] |

[sdk-java]: https://github.com/copilot-community-sdk/copilot-sdk-java
[sdk-rust]: https://github.com/copilot-community-sdk/copilot-sdk-rust
[sdk-cpp]: https://github.com/0xeb/copilot-sdk-cpp
[sdk-clojure]: https://github.com/krukow/copilot-sdk-clojure
[sdk-clojure]: https://github.com/copilot-community-sdk/copilot-sdk-clojure

## Contributing

Expand Down
13 changes: 3 additions & 10 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,13 @@ The `--share` option is not available via SDK. Workarounds:

### Permission Control

The SDK uses a **deny-by-default** permission model. All permission requests (file writes, shell commands, URL fetches, etc.) are denied unless your app provides an `onPermissionRequest` handler.

Instead of `--allow-all-paths` or `--yolo`, use the permission handler:

```typescript
const session = await client.createSession({
onPermissionRequest: async (request) => {
// Auto-approve everything (equivalent to --yolo)
return { approved: true };

// Or implement custom logic
if (request.kind === "shell") {
return { approved: request.command.startsWith("git") };
}
return { approved: true };
},
onPermissionRequest: approveAll,
});
```

Expand Down
6 changes: 5 additions & 1 deletion docs/guides/session-persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,16 @@ session_id = create_session_id("alice", "code-review")
### Listing Active Sessions

```typescript
// List all sessions
const sessions = await client.listSessions();
console.log(`Found ${sessions.length} sessions`);

for (const session of sessions) {
console.log(`- ${session.sessionId} (created: ${session.createdAt})`);
}

// Filter sessions by repository
const repoSessions = await client.listSessions({ repository: "owner/repo" });
```

### Cleaning Up Old Sessions
Expand Down Expand Up @@ -521,7 +525,7 @@ await withSessionLock("user-123-task-456", async () => {
| **Create resumable session** | Provide your own `sessionId` |
| **Resume session** | `client.resumeSession(sessionId)` |
| **BYOK resume** | Re-provide `provider` config |
| **List sessions** | `client.listSessions()` |
| **List sessions** | `client.listSessions(filter?)` |
| **Delete session** | `client.deleteSession(sessionId)` |
| **Destroy active session** | `session.destroy()` |
| **Containerized deployment** | Mount `~/.copilot/session-state/` to persistent storage |
Expand Down
Loading
Loading