Skip to content

Commit a764240

Browse files
Docs: clarify Copilot CLI is bundled with SDKs and update installatio… (#988)
* Add installation lnk * Move more heavily to bundled-first recommendation --------- Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
1 parent 11fc542 commit a764240

File tree

5 files changed

+70
-262
lines changed

5 files changed

+70
-262
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Quick steps:
3333
1. **(Optional) Install the Copilot CLI**
3434

3535
For Node.js, Python, and .NET SDKs, the Copilot CLI is bundled automatically and no separate installation is required.
36-
For the Go SDK, install the CLI manually or ensure `copilot` is available in your PATH.
36+
For the Go SDK, [install the CLI manually](https://github.com/features/copilot/cli) or ensure `copilot` is available in your PATH.
3737

3838
2. **Install your preferred SDK** using the commands above.
3939

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Step-by-step tutorial that takes you from zero to a working Copilot app with str
2222

2323
How to configure and deploy the SDK for your use case.
2424

25-
- [Local CLI](./setup/local-cli.md)simplest path, uses your signed-in CLI
26-
- [Bundled CLI](./setup/bundled-cli.md)ship the CLI with your app
25+
- [Default Setup (Bundled CLI)](./setup/bundled-cli.md)the SDK includes the CLI automatically
26+
- [Local CLI](./setup/local-cli.md)use your own CLI binary or running instance
2727
- [Backend Services](./setup/backend-services.md) — server-side with headless CLI over TCP
2828
- [GitHub OAuth](./setup/github-oauth.md) — implement the OAuth flow
2929
- [Azure Managed Identity](./setup/azure-managed-identity.md) — BYOK with Azure AI Foundry

docs/setup/bundled-cli.md

Lines changed: 24 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,43 @@
1-
# Bundled CLI Setup
1+
# Default Setup (Bundled CLI)
22

3-
Package the Copilot CLI alongside your application so users don't need to install or configure anything separately. Your app ships with everything it needs.
3+
The Node.js, Python, and .NET SDKs include the Copilot CLI as a dependency — your app ships with everything it needs, with no extra installation or configuration required.
44

5-
**Best for:** Desktop apps, standalone tools, Electron apps, distributable CLI utilities.
5+
**Best for:** Most applications — desktop apps, standalone tools, CLI utilities, prototypes, and more.
66

77
## How It Works
88

9-
Instead of relying on a globally installed CLI, you include the CLI binary in your application bundle. The SDK points to your bundled copy via the `cliPath` option.
9+
When you install the SDK, the Copilot CLI binary is included automatically. The SDK starts it as a child process and communicates over stdio. There's nothing extra to configure.
1010

1111
```mermaid
1212
flowchart TB
13-
subgraph Bundle["Your Distributed App"]
13+
subgraph Bundle["Your Application"]
1414
App["Application Code"]
1515
SDK["SDK Client"]
16-
CLIBin["Copilot CLI Binary<br/>(bundled)"]
16+
CLIBin["Copilot CLI Binary<br/>(included with SDK)"]
1717
end
1818
1919
App --> SDK
20-
SDK -- "cliPath" --> CLIBin
20+
SDK --> CLIBin
2121
CLIBin -- "API calls" --> Copilot["☁️ GitHub Copilot"]
2222
2323
style Bundle fill:#0d1117,stroke:#58a6ff,color:#c9d1d9
2424
```
2525

2626
**Key characteristics:**
27-
- CLI binary ships with your app — no separate install needed
28-
- You control the exact CLI version your app uses
27+
- CLI binary is included with the SDK — no separate install needed
28+
- The SDK manages the CLI version to ensure compatibility
2929
- Users authenticate through your app (or use env vars / BYOK)
3030
- Sessions are managed per-user on their machine
3131

32-
## Architecture: Bundled vs. Installed
33-
34-
```mermaid
35-
flowchart LR
36-
subgraph Installed["Standard Setup"]
37-
A1["Your App"] --> SDK1["SDK"]
38-
SDK1 --> CLI1["Global CLI<br/>(/usr/local/bin/copilot)"]
39-
end
40-
41-
subgraph Bundled["Bundled Setup"]
42-
A2["Your App"] --> SDK2["SDK"]
43-
SDK2 --> CLI2["Bundled CLI<br/>(./vendor/copilot)"]
44-
end
45-
46-
style Installed fill:#161b22,stroke:#8b949e,color:#c9d1d9
47-
style Bundled fill:#0d1117,stroke:#3fb950,color:#c9d1d9
48-
```
49-
50-
## Setup
51-
52-
### 1. Include the CLI in Your Project
53-
54-
The CLI is distributed as part of the `@github/copilot` npm package. You can also obtain platform-specific binaries for your distribution pipeline.
55-
56-
```bash
57-
# The CLI is available from the @github/copilot package
58-
npm install @github/copilot
59-
```
60-
61-
### 2. Point the SDK to Your Bundled CLI
32+
## Quick Start
6233

6334
<details open>
6435
<summary><strong>Node.js / TypeScript</strong></summary>
6536

6637
```typescript
6738
import { CopilotClient } from "@github/copilot-sdk";
68-
import path from "path";
6939

70-
const client = new CopilotClient({
71-
// Point to the CLI binary in your app bundle
72-
cliPath: path.join(__dirname, "vendor", "copilot"),
73-
});
40+
const client = new CopilotClient();
7441

7542
const session = await client.createSession({ model: "gpt-4.1" });
7643
const response = await session.sendAndWait({ prompt: "Hello!" });
@@ -87,11 +54,8 @@ await client.stop();
8754
```python
8855
from copilot import CopilotClient
8956
from copilot.session import PermissionHandler
90-
from pathlib import Path
9157

92-
client = CopilotClient({
93-
"cli_path": str(Path(__file__).parent / "vendor" / "copilot"),
94-
})
58+
client = CopilotClient()
9559
await client.start()
9660

9761
session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="gpt-4.1")
@@ -106,6 +70,8 @@ await client.stop()
10670
<details>
10771
<summary><strong>Go</strong></summary>
10872

73+
> **Note:** The Go SDK does not bundle the CLI. You must install the CLI separately or set `CLIPath` to point to an existing binary. See [Local CLI Setup](./local-cli.md) for details.
74+
10975
<!-- docs-validate: hidden -->
11076
```go
11177
package main
@@ -120,9 +86,7 @@ import (
12086
func main() {
12187
ctx := context.Background()
12288

123-
client := copilot.NewClient(&copilot.ClientOptions{
124-
CLIPath: "./vendor/copilot",
125-
})
89+
client := copilot.NewClient(nil)
12690
if err := client.Start(ctx); err != nil {
12791
log.Fatal(err)
12892
}
@@ -138,9 +102,7 @@ func main() {
138102
<!-- /docs-validate: hidden -->
139103

140104
```go
141-
client := copilot.NewClient(&copilot.ClientOptions{
142-
CLIPath:"./vendor/copilot",
143-
})
105+
client := copilot.NewClient(nil)
144106
if err := client.Start(ctx); err != nil {
145107
log.Fatal(err)
146108
}
@@ -159,11 +121,7 @@ if d, ok := response.Data.(*copilot.AssistantMessageData); ok {
159121
<summary><strong>.NET</strong></summary>
160122

161123
```csharp
162-
var client = new CopilotClient(new CopilotClientOptions
163-
{
164-
CliPath = Path.Combine(AppContext.BaseDirectory, "vendor", "copilot"),
165-
});
166-
124+
await using var client = new CopilotClient();
167125
await using var session = await client.CreateSessionAsync(
168126
new SessionConfig { Model = "gpt-4.1" });
169127

@@ -206,7 +164,7 @@ client.stop().get();
206164

207165
## Authentication Strategies
208166

209-
When bundling, you need to decide how your users will authenticate. Here are the common patterns:
167+
You need to decide how your users will authenticate. Here are the common patterns:
210168

211169
```mermaid
212170
flowchart TB
@@ -225,13 +183,11 @@ flowchart TB
225183

226184
### Option A: User's Signed-In Credentials (Simplest)
227185

228-
The user signs in to the CLI once, and your bundled app uses those credentials. No extra code needed — this is the default behavior.
186+
The user signs in to the CLI once, and your app uses those credentials. No extra code needed — this is the default behavior.
229187

230188
```typescript
231-
const client = new CopilotClient({
232-
cliPath: path.join(__dirname, "vendor", "copilot"),
233-
// Default: uses signed-in user credentials
234-
});
189+
const client = new CopilotClient();
190+
// Default: uses signed-in user credentials
235191
```
236192

237193
### Option B: Token via Environment Variable
@@ -240,7 +196,6 @@ Ship your app with instructions to set a token, or set it programmatically:
240196

241197
```typescript
242198
const client = new CopilotClient({
243-
cliPath: path.join(__dirname, "vendor", "copilot"),
244199
env: {
245200
COPILOT_GITHUB_TOKEN: getUserToken(), // Your app provides the token
246201
},
@@ -252,9 +207,7 @@ const client = new CopilotClient({
252207
If you manage your own model provider keys, users don't need GitHub accounts at all:
253208

254209
```typescript
255-
const client = new CopilotClient({
256-
cliPath: path.join(__dirname, "vendor", "copilot"),
257-
});
210+
const client = new CopilotClient();
258211

259212
const session = await client.createSession({
260213
model: "gpt-4.1",
@@ -270,12 +223,10 @@ See the **[BYOK guide](../auth/byok.md)** for full details.
270223

271224
## Session Management
272225

273-
Bundled apps typically want named sessions so users can resume conversations:
226+
Apps typically want named sessions so users can resume conversations:
274227

275228
```typescript
276-
const client = new CopilotClient({
277-
cliPath: path.join(__dirname, "vendor", "copilot"),
278-
});
229+
const client = new CopilotClient();
279230

280231
// Create a session tied to the user's project
281232
const sessionId = `project-${projectName}`;
@@ -291,90 +242,6 @@ const resumed = await client.resumeSession(sessionId);
291242

292243
Session state persists at `~/.copilot/session-state/{sessionId}/`.
293244

294-
## Distribution Patterns
295-
296-
### Desktop App (Electron, Tauri)
297-
298-
```mermaid
299-
flowchart TB
300-
subgraph Electron["Desktop App Package"]
301-
UI["App UI"] --> Main["Main Process"]
302-
Main --> SDK["SDK Client"]
303-
SDK --> CLI["Copilot CLI<br/>(in app resources)"]
304-
end
305-
CLI --> Cloud["☁️ GitHub Copilot"]
306-
307-
style Electron fill:#0d1117,stroke:#58a6ff,color:#c9d1d9
308-
```
309-
310-
Include the CLI binary in your app's resources directory:
311-
312-
```typescript
313-
import { app } from "electron";
314-
import path from "path";
315-
316-
const cliPath = path.join(
317-
app.isPackaged ? process.resourcesPath : __dirname,
318-
"copilot"
319-
);
320-
321-
const client = new CopilotClient({ cliPath });
322-
```
323-
324-
### CLI Tool
325-
326-
For distributable CLI tools, resolve the path relative to your binary:
327-
328-
```typescript
329-
import { fileURLToPath } from "url";
330-
import path from "path";
331-
332-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
333-
const cliPath = path.join(__dirname, "..", "vendor", "copilot");
334-
335-
const client = new CopilotClient({ cliPath });
336-
```
337-
338-
## Platform-Specific Binaries
339-
340-
When distributing for multiple platforms, include the correct binary for each:
341-
342-
```
343-
my-app/
344-
├── vendor/
345-
│ ├── copilot-darwin-arm64 # macOS Apple Silicon
346-
│ ├── copilot-darwin-x64 # macOS Intel
347-
│ ├── copilot-linux-x64 # Linux x64
348-
│ └── copilot-win-x64.exe # Windows x64
349-
└── src/
350-
└── index.ts
351-
```
352-
353-
```typescript
354-
import os from "os";
355-
356-
function getCLIPath(): string {
357-
const platform = process.platform; // "darwin", "linux", "win32"
358-
const arch = os.arch(); // "arm64", "x64"
359-
const ext = platform === "win32" ? ".exe" : "";
360-
const name = `copilot-${platform}-${arch}${ext}`;
361-
return path.join(__dirname, "vendor", name);
362-
}
363-
364-
const client = new CopilotClient({
365-
cliPath: getCLIPath(),
366-
});
367-
```
368-
369-
## Limitations
370-
371-
| Limitation | Details |
372-
|------------|---------|
373-
| **Bundle size** | CLI binary adds to your app's distribution size |
374-
| **Updates** | You manage CLI version updates in your release cycle |
375-
| **Platform builds** | Need separate binaries for each OS/architecture |
376-
| **Single user** | Each bundled CLI instance serves one user |
377-
378245
## When to Move On
379246

380247
| Need | Next Guide |

docs/setup/index.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ The setup guides below help you configure each layer for your scenario.
3838
You're building a personal assistant, side project, or experimental app. You want the simplest path to getting Copilot in your code.
3939

4040
**Start with:**
41-
1. **[Local CLI](./local-cli.md)**Use the CLI already signed in on your machine
42-
2. **[Bundled CLI](./bundled-cli.md)**Package everything into a standalone app
41+
1. **[Default Setup](./bundled-cli.md)**The SDK includes the CLI automatically — just install and go
42+
2. **[Local CLI](./local-cli.md)**Use your own CLI binary or running instance (advanced)
4343

4444
### 🏢 Internal App Developer
4545

@@ -82,8 +82,8 @@ Use this table to find the right guides based on what you need to do:
8282

8383
| What you need | Guide |
8484
|---------------|-------|
85-
| Simplest possible setup | [Local CLI](./local-cli.md) |
86-
| Ship a standalone app with Copilot | [Bundled CLI](./bundled-cli.md) |
85+
| Getting started quickly | [Default Setup (Bundled CLI)](./bundled-cli.md) |
86+
| Use your own CLI binary or server | [Local CLI](./local-cli.md) |
8787
| Users sign in with GitHub | [GitHub OAuth](./github-oauth.md) |
8888
| Use your own model keys (OpenAI, Azure, etc.) | [BYOK](../auth/byok.md) |
8989
| Azure BYOK with Managed Identity (no API keys) | [Azure Managed Identity](./azure-managed-identity.md) |
@@ -129,11 +129,10 @@ flowchart LR
129129

130130
All guides assume you have:
131131

132-
- **Copilot CLI** installed ([Installation guide](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli))
133-
- **One of the SDKs** installed:
132+
- **One of the SDKs** installed (Node.js, Python, and .NET SDKs include the CLI automatically):
134133
- Node.js: `npm install @github/copilot-sdk`
135134
- Python: `pip install github-copilot-sdk`
136-
- Go: `go get github.com/github/copilot-sdk/go`
135+
- Go: `go get github.com/github/copilot-sdk/go` (requires separate CLI installation)
137136
- .NET: `dotnet add package GitHub.Copilot.SDK`
138137

139138
If you're brand new, start with the **[Getting Started tutorial](../getting-started.md)** first, then come back here for production configuration.

0 commit comments

Comments
 (0)