Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
6283d8a
Add Java SDK for Copilot CLI
brunoborges Jan 19, 2026
80a4325
Merge branch 'github:main' into java-sdk
brunoborges Jan 19, 2026
e66235d
Update README.md
brunoborges Jan 20, 2026
0a36be0
Add COPILOT_GITHUB_TOKEN to environment variables for SDK tests
brunoborges Jan 20, 2026
6bc7288
Update SDK E2E tests to use COPILOT_GITHUB_TOKEN and comment out COPI…
brunoborges Jan 20, 2026
1e345be
Merge branch 'github:main' into main
brunoborges Jan 20, 2026
95e97be
Merge branch 'github:main' into main
brunoborges Jan 20, 2026
34189ca
Downgrade Maven compiler release version from 21 to 17
brunoborges Jan 20, 2026
6925f7a
Enhance CopilotSessionTest to handle tool execution and session abort…
brunoborges Jan 21, 2026
40ce3fb
Merge remote-tracking branch 'upstream/main'
brunoborges Jan 21, 2026
5d21ec3
Merge branch 'github:main' into main
brunoborges Jan 21, 2026
009d016
Merge remote-tracking branch 'refs/remotes/origin/main'
brunoborges Jan 21, 2026
56d6703
feat: enhance directory resolution by checking copilot.sdk.dir system…
brunoborges Jan 21, 2026
174ecc3
fix: improve readability of test assertions in CopilotSessionTest
brunoborges Jan 21, 2026
ec464cb
chore: remove outdated GitHub Actions workflow for publishing Java SDK
brunoborges Jan 21, 2026
92ceecd
Update README with new repository location and archive notice
brunoborges Jan 21, 2026
40f2641
Merge remote-tracking branch 'upstream/main'
brunoborges Jan 22, 2026
30a7e20
Bump lodash in /nodejs in the npm_and_yarn group across 1 directory
dependabot[bot] Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 47 additions & 4 deletions .github/workflows/sdk-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: "SDK E2E Tests"
env:
HUSKY: 0
PYTHONUTF8: 1
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}

on:
push:
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:

- name: Run Node.js SDK tests
env:
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
# COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
run: npm test

Expand Down Expand Up @@ -109,7 +110,8 @@ jobs:

- name: Run Go SDK tests
env:
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
# COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
run: /bin/bash test.sh

Expand Down Expand Up @@ -158,7 +160,8 @@ jobs:

- name: Run Python SDK tests
env:
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
# COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
run: uv run pytest -v -s

Expand Down Expand Up @@ -214,5 +217,45 @@ jobs:

- name: Run .NET SDK tests
env:
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
# COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
run: dotnet test --no-build -v n

java-sdk:
name: "Java SDK Tests"

runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./java
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-copilot
- uses: actions/setup-java@v5
with:
java-version: "21"
distribution: "temurin"

- name: Run spotless check
run: |
mvn spotless:check
if [ $? -ne 0 ]; then
echo "❌ spotless:check failed. Please run 'mvn spotless:apply' in java"
exit 1
fi
echo "✅ spotless:check passed"

- name: Build SDK
run: mvn compile

- name: Install test harness dependencies
working-directory: ./test/harness
run: npm ci --ignore-scripts

- name: Run Java SDK tests
env:
# COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
run: mvn verify
36 changes: 36 additions & 0 deletions java/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

# IDE
.idea/
*.iml
*.ipr
*.iws
.vscode/
.settings/
.project
.classpath
*.swp
*.swo
*~

# Build
build/
out/
bin/

# OS
.DS_Store
Thumbs.db

# Logs
*.log
3 changes: 3 additions & 0 deletions java/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
11 changes: 11 additions & 0 deletions java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ⚠️ This Project Has Moved

The **Copilot SDK for Java** has moved to a new location:

## 👉 [New Repository Location](https://github.com/copilot-community-sdk/copilot-sdk-java)

Please update your bookmarks and references to the new repository.

---

This repository is archived and will no longer receive updates.
34 changes: 34 additions & 0 deletions java/jbang-example.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

//DEPS com.github.copilot:copilot-sdk:0.1.0
import com.github.copilot.sdk.*;
import com.github.copilot.sdk.events.*;
import com.github.copilot.sdk.json.*;
import java.util.concurrent.CompletableFuture;

class CopilotSDK {
public static void main(String[] args) throws Exception {
// Create and start client
try (var client = new CopilotClient()) {
client.start().get();

// Create a session
var session = client.createSession(
new SessionConfig().setModel(CopilotModel.CLAUDE_SONNET_4_5.toString())).get();

// Wait for response using session.idle event
var done = new CompletableFuture<Void>();

session.on(evt -> {
if (evt instanceof AssistantMessageEvent msg) {
System.out.println(msg.getData().getContent());
} else if (evt instanceof SessionIdleEvent) {
done.complete(null);
}
});

// Send a message and wait for completion
session.send(new MessageOptions().setPrompt("What is 2+2?")).get();
done.get();
}
}
}
Loading
Loading