Skip to content

Latest commit

 

History

History
630 lines (490 loc) · 25.2 KB

File metadata and controls

630 lines (490 loc) · 25.2 KB

Preflight: prepare your machine

Untimed preparation
Complete this page before starting the 115-minute workshop.

What you'll have ready

By the end of preflight, you'll have the repository cloned, the Copilot CLI authenticated, the starter project built, and Playwright MCP downloaded and ready.

Follow all nine hands-on steps, including model selection and the interactive HTML report, then finish with a celebration and resources to keep building.

:::language dotnet

What you need

Requirement Why the workshop needs it Verify
.NET 10 SDK Builds and runs the C# console application dotnet --version
Node.js 22 or newer Runs the Playwright MCP server node --version
GitHub Copilot CLI Provides the Copilot runtime used by the SDK copilot --version
GitHub Copilot access Authorizes Copilot requests copilot login
Microsoft Edge (default) or Google Chrome Lets Playwright inspect the target page Open the browser once before the workshop

Your commands should return output in this shape:

$ dotnet --version
10.0.x
$ node --version
v22.x.x
$ copilot --version
GitHub Copilot CLI ...

:::

:::language nodejs

What you need

Requirement Why the workshop needs it Verify
Node.js 22.12 or newer Runs the TypeScript workshop app and Playwright MCP node --version
npm Installs @github/copilot-sdk and build tools npm --version
GitHub Copilot CLI Provides the Copilot runtime used by the SDK copilot --version
GitHub Copilot access Authorizes Copilot requests copilot login
Microsoft Edge (default) or Google Chrome Lets Playwright inspect the target page Open the browser once before the workshop

Your commands should return output in this shape:

$ node --version
v22.12.x
$ npm --version
10.x.x
$ copilot --version
GitHub Copilot CLI ...

See the official Node.js SDK installation guide. :::

:::language python

What you need

Requirement Why the workshop needs it Verify
Python 3.11 or newer Runs the async workshop application python --version
pip Installs the pinned github-copilot-sdk wheel python -m pip --version
Node.js 22 or newer Runs the Playwright MCP server node --version
GitHub Copilot CLI Optional local runtime override via COPILOT_CLI_PATH copilot --version
GitHub Copilot access Authorizes Copilot requests copilot login
Microsoft Edge (default) or Google Chrome Lets Playwright inspect the target page Open the browser once before the workshop

Your commands should return output in this shape:

$ python --version
Python 3.11.x
$ node --version
v22.x.x
$ copilot --version
GitHub Copilot CLI ...

The Python SDK can download a pinned runtime on first use. See the official Python SDK installation guide. :::

:::language go

What you need

Requirement Why the workshop needs it Verify
Go 1.24 or newer Builds and runs the Go workshop module go version
Node.js 22 or newer Runs the Playwright MCP server node --version
GitHub Copilot CLI Required on PATH (or COPILOT_CLI_PATH) for the SDK copilot --version
GitHub Copilot access Authorizes Copilot requests copilot login
Microsoft Edge (default) or Google Chrome Lets Playwright inspect the target page Open the browser once before the workshop

Your commands should return output in this shape:

$ go version
go version go1.24.x ...
$ node --version
v22.x.x
$ copilot --version
GitHub Copilot CLI ...

See the official Go SDK installation guide. :::

:::language rust

What you need

Requirement Why the workshop needs it Verify
Rust 1.94 or newer Builds the async Rust workshop crate rustc --version
Cargo Resolves locked dependencies and runs the app cargo --version
Node.js 22 or newer Runs the Playwright MCP server node --version
GitHub Copilot CLI Runtime used when not relying solely on a bundled binary copilot --version
GitHub Copilot access Authorizes Copilot requests copilot login
Microsoft Edge (default) or Google Chrome Lets Playwright inspect the target page Open the browser once before the workshop

Your commands should return output in this shape:

$ rustc --version
rustc 1.94.x
$ cargo --version
cargo 1.94.x
$ node --version
v22.x.x
$ copilot --version
GitHub Copilot CLI ...

See the official Rust SDK installation guide. :::

:::language java

What you need

Requirement Why the workshop needs it Verify
Java 17 or newer (JDK) Compiles and runs the Maven workshop app java -version
Node.js 22 or newer Runs the Playwright MCP server node --version
GitHub Copilot CLI Required on PATH for the Java SDK runtime copilot --version
GitHub Copilot access Authorizes Copilot requests copilot login
Microsoft Edge (default) or Google Chrome Lets Playwright inspect the target page Open the browser once before the workshop

Your commands should return output in this shape:

$ java -version
openjdk version "17.x.x" ...
$ node --version
v22.x.x
$ copilot --version
GitHub Copilot CLI ...

No separate Maven install is needed: each Java project includes the Maven Wrapper (./mvnw), which downloads the right Maven version on first use. On Windows, run mvnw.cmd instead of ./mvnw. Use Maven for this track. Do not substitute JBang or Gradle. See the official Java SDK installation guide. :::

1. Clone the repository and choose your starter

git clone https://github.com/github/copilot-sdk-workshop.git
cd copilot-sdk-workshop

You work directly inside the repository. There is no copy step: you change into the starter directory for your language and stay there for the whole workshop. That means you are editing tracked repository files, so your changes show up in git status. That is expected. If you want a clean starter again, run git checkout -- . from the repository root to discard your edits.

2. Authenticate Copilot

Install the CLI with the method from the official setup guide, then run:

copilot login

Finish the browser flow so later SDK calls can reach GitHub Copilot.

3. Warm up Playwright MCP

Run this once to download the pinned package and print its options without starting a server:

npx -y @playwright/mcp@0.0.78 --help

The package version is pinned so everyone sees the same tool names and behavior. The code uses Microsoft Edge with --browser=msedge. If you prepared Google Chrome instead, use --browser=chrome when the argument appears in Step 4.

:::language dotnet

4. Move into the starter and build it

If dotnet build cannot find the Copilot CLI later, set its path for the current terminal:

Windows macOS or Linux
$env:COPILOT_CLI_BINARY_PATH = (Get-Command copilot).Source
export COPILOT_CLI_BINARY_PATH="$(command -v copilot)"

Change into the .NET starter and build it. Stay in this directory for every later step:

cd start-accessibility/dotnet
dotnet build

A successful build ends with:

Build succeeded.
    0 Warning(s)
    0 Error(s)

You work in start-accessibility/dotnet for the rest of the workshop, so keep this terminal here. From this folder, enter code . to open it in VS Code, or open the folder in your favorite editor.

Open the controlled target page once to make sure you can reach it:

{{TARGET_APP_URL}}
Troubleshooting preflight
Symptom Fix
copilot is not recognized Restart the terminal after installation, or set COPILOT_CLI_BINARY_PATH with the command above.
Copilot asks you to authenticate Run copilot login, finish the browser flow, then retry.
NuGet restore cannot reach the package source Check proxy or package-source settings, then run dotnet restore.
npx is not recognized Install Node.js 22 or newer and restart the terminal.
The browser cannot start later Install Edge or Chrome, or follow the Playwright MCP browser configuration.

Start Step 1 when: dotnet build succeeds, copilot login is complete, and the target page opens. :::

:::language nodejs

4. Move into the starter and build it

If the SDK cannot find the Copilot CLI later, point it at your install for the current terminal:

Windows macOS or Linux
$env:COPILOT_CLI_PATH = (Get-Command copilot).Source
export COPILOT_CLI_PATH="$(command -v copilot)"

Change into the Node.js starter, install dependencies, and type-check. Stay in this directory for every later step:

cd start-accessibility/nodejs
npm install
npm run build

A successful type-check ends with no TypeScript errors (empty output from tsc --noEmit). The package.json start script is tsx src/index.ts.

You work in start-accessibility/nodejs for the rest of the workshop, so keep this terminal here. From this folder, enter code . to open it in VS Code, or open the folder in your favorite editor.

Open the controlled target page once to make sure you can reach it:

{{TARGET_APP_URL}}
Troubleshooting preflight
Symptom Fix
node or npm is not recognized Install Node.js 22.12 or newer and restart the terminal.
Engine warning about Node version Upgrade to Node.js 22.12+; the starter declares "node": ">=22.12.0".
npm install fails on the lockfile Stay in start-accessibility/nodejs and keep package-lock.json; do not delete it.
copilot is not recognized Restart the terminal after installation, or set COPILOT_CLI_PATH with the command above.
Copilot asks you to authenticate Run copilot login, finish the browser flow, then retry.
npx cannot download Playwright MCP Check network access, then rerun the warm-up command from section 3.
The browser cannot start later Install Edge or Chrome, or follow the Playwright MCP browser configuration.

Start Step 1 when: npm run build succeeds, copilot login is complete, and the target page opens. :::

:::language python

4. Move into the starter and build it

Optional: force the SDK to use your installed CLI instead of downloading a runtime:

Windows macOS or Linux
$env:COPILOT_CLI_PATH = (Get-Command copilot).Source
export COPILOT_CLI_PATH="$(command -v copilot)"

Change into the Python starter, create a virtual environment, install pinned requirements, and compile-check. Stay in this directory for every later step:

Windows macOS or Linux
cd start-accessibility/python
python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python -m py_compile main.py workshop.py report.py accessibility_rule_catalog.py
cd start-accessibility/python
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python -m py_compile main.py workshop.py report.py accessibility_rule_catalog.py

A successful install prints the resolved packages, including github-copilot-sdk==.... A successful compile check prints no output. Keep the virtual environment activated for later steps.

You work in start-accessibility/python for the rest of the workshop, so keep this terminal here. From this folder, enter code . to open it in VS Code, or open the folder in your favorite editor.

Optionally pre-download the runtime now so the first Step 1 run is faster:

python -m copilot download-runtime

Open the controlled target page once to make sure you can reach it:

{{TARGET_APP_URL}}
Troubleshooting preflight
Symptom Fix
python points at Python 2 or is missing Use Python 3.11+ (python3 on macOS/Linux) and recreate the venv.
pip install cannot reach PyPI Check proxy settings, then rerun python -m pip install -r requirements.txt.
Wrong package versions Install only from the pinned requirements.txt; do not loosen == pins.
Runtime download fails later Run python -m copilot download-runtime, or set COPILOT_CLI_PATH to a working CLI.
Copilot asks you to authenticate Run copilot login, finish the browser flow, then retry.
npx is not recognized Install Node.js 22 or newer and restart the terminal.
The browser cannot start later Install Edge or Chrome, or follow the Playwright MCP browser configuration.

Start Step 1 when: the pinned requirements install, py_compile succeeds, copilot login is complete, and the target page opens. :::

:::language go

4. Move into the starter and build it

The Go SDK expects the Copilot CLI on PATH, or via COPILOT_CLI_PATH:

Windows macOS or Linux
$env:COPILOT_CLI_PATH = (Get-Command copilot).Source
export COPILOT_CLI_PATH="$(command -v copilot)"

Change into the Go starter and build with the lock enforced. Stay in this directory for every later step:

cd start-accessibility/go
go build -mod=readonly ./...

A successful build prints no errors and produces a binary in the starter directory. Keep go.sum intact so module resolution stays deterministic.

You work in start-accessibility/go for the rest of the workshop, so keep this terminal here. From this folder, enter code . to open it in VS Code, or open the folder in your favorite editor.

Open the controlled target page once to make sure you can reach it:

{{TARGET_APP_URL}}
Troubleshooting preflight
Symptom Fix
go: go.mod requires go >= 1.24 Install Go 1.24 or newer and reopen the terminal.
missing go.sum entry Restore the committed go.sum; build with -mod=readonly instead of rewriting the lock.
Module download blocked Configure GOPROXY/proxy access, then retry the build from the starter directory.
copilot is not recognized Install the CLI, restart the terminal, or set COPILOT_CLI_PATH.
Copilot asks you to authenticate Run copilot login, finish the browser flow, then retry.
npx is not recognized Install Node.js 22 or newer and restart the terminal.
The browser cannot start later Install Edge or Chrome, or follow the Playwright MCP browser configuration.

Start Step 1 when: go build -mod=readonly ./... succeeds, copilot login is complete, and the target page opens.

Compare with finished/go/hello-copilot-sdk if you want a later reference point after Step 1. :::

:::language rust

4. Move into the starter and build it

If runtime startup cannot resolve the CLI later, set COPILOT_CLI_PATH:

Windows macOS or Linux
$env:COPILOT_CLI_PATH = (Get-Command copilot).Source
export COPILOT_CLI_PATH="$(command -v copilot)"

Change into the Rust starter and check it against the lockfile. Stay in this directory for every later step:

cd start-accessibility/rust
cargo check --locked

A successful check ends with a Finished line and no errors. Keep Cargo.lock committed so the crate graph stays pinned.

You work in start-accessibility/rust for the rest of the workshop, so keep this terminal here. From this folder, enter code . to open it in VS Code, or open the folder in your favorite editor.

Open the controlled target page once to make sure you can reach it:

{{TARGET_APP_URL}}
Troubleshooting preflight
Symptom Fix
rustc 1.xx is too old Install Rust 1.94+ with rustup update and reopen the terminal.
Lockfile mismatch with --locked Keep the starter Cargo.lock; do not run unconstrained cargo update.
Crate download blocked Check network/proxy access to crates.io, then retry cargo check.
Runtime cannot start later Install and authenticate copilot, or set COPILOT_CLI_PATH.
Copilot asks you to authenticate Run copilot login, finish the browser flow, then retry.
npx is not recognized Install Node.js 22 or newer and restart the terminal.
The browser cannot start later Install Edge or Chrome, or follow the Playwright MCP browser configuration.

Start Step 1 when: cargo check --locked succeeds, copilot login is complete, and the target page opens.

Compare with finished/rust/hello-copilot-sdk if you want a later reference point after Step 1. :::

:::language java

4. Move into the starter and build it

The Java SDK expects the Copilot CLI on PATH when the application starts. Confirm it before building:

copilot --version

Change into the Java starter and compile with Maven. Stay in this directory for every later step:

cd start-accessibility/java
./mvnw compile

A successful compile ends with:

[INFO] BUILD SUCCESS

The pom.xml already configures exec-maven-plugin with mainClass workshop.AccessibilityReport. Stay on Maven for this track.

You work in start-accessibility/java for the rest of the workshop, so keep this terminal here. From this folder, enter code . to open it in VS Code, or open the folder in your favorite editor.

Open the controlled target page once to make sure you can reach it:

{{TARGET_APP_URL}}
Troubleshooting preflight
Symptom Fix
java is not recognized Install JDK 17+, then restart the terminal.
./mvnw: Permission denied Run chmod +x mvnw, or use sh mvnw instead. On Windows, use mvnw.cmd.
Compiler release errors Confirm java -version reports 17 or newer; the POM sets maven.compiler.release to 17.
Dependency download fails Check Maven Central / proxy settings, then rerun ./mvnw compile.
Tempted to switch tools Do not replace Maven with JBang or Gradle for this workshop.
copilot is not recognized Install the CLI, restart the terminal, and verify copilot --version.
Copilot asks you to authenticate Run copilot login, finish the browser flow, then retry.
npx is not recognized Install Node.js 22 or newer and restart the terminal.
The browser cannot start later Install Edge or Chrome, or follow the Playwright MCP browser configuration.

Start Step 1 when: ./mvnw compile prints BUILD SUCCESS, copilot login is complete, and the target page opens.

Compare with finished/java/hello-copilot-sdk if you want a later reference point after Step 1. :::

Learn more

The SDK you are about to install is documented outside this workshop. These pages are the ones worth bookmarking before Step 1.

:::language dotnet

:::language nodejs

:::language python

:::language go

  • Go SDK reference: module installation and a minimal example for the Go SDK. :::

:::language rust

:::language java

Continue to Step 1: Create your first Copilot session.