{"meta":{"title":"Default setup (bundled CLI)","intro":"The Node.js and .NET SDKs include the Copilot CLI as a dependency—your app ships with everything it needs, with no extra installation or configuration required.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos","title":"How-tos"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk","title":"Copilot SDK"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/setup","title":"Set up Copilot SDK"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/setup/bundled-cli","title":"Bundled CLI"}],"documentType":"article"},"body":"# Default setup (bundled CLI)\n\nThe Node.js and .NET SDKs include the Copilot CLI as a dependency—your app ships with everything it needs, with no extra installation or configuration required.\n\n<!-- markdownlint-disable GHD046 GHD005 -->\n\n<!-- Suppressed: GHD046 (outdated release terminology), GHD005 (hardcoded data variable) -->\n\nThe Python SDK recommends a one-time download step after installation:\n\n```bash\npython -m copilot download-runtime\n```\n\nThis downloads the matching runtime and caches it locally. If you skip this step, the SDK will attempt to download it automatically on first use as a fallback.\n\n**Best for:** Most applications—desktop apps, standalone tools, CLI utilities, prototypes, and more.\n\n## How it works\n\nWhen you install the SDK, the Copilot runtime is included automatically (Node.js, .NET) or downloaded via `python -m copilot download-runtime` (Python). The SDK starts it as a child process and communicates over stdio. There's nothing extra to configure.\n\n![Diagram: Flowchart showing the described process.](/assets/images/help/copilot/copilot-sdk/setup-bundled-cli-diagram-0.png)\n\n**Key characteristics:**\n\n* CLI binary is included with the SDK—no separate install needed\n* The SDK manages the CLI version to ensure compatibility\n* Users authenticate through your app (or use env vars / BYOK)\n* Sessions are managed per-user on their machine\n\n## Quick start\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"typescript\" data-label=\"TypeScript\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">TypeScript</div>\n\n```typescript\nimport { CopilotClient } from \"@github/copilot-sdk\";\n\nconst client = new CopilotClient();\n\nconst session = await client.createSession({ model: \"gpt-5.4\" });\nconst response = await session.sendAndWait({ prompt: \"Hello!\" });\nconsole.log(response?.data.content);\n\nawait client.stop();\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n```python\nfrom copilot import CopilotClient\nfrom copilot.session import PermissionHandler\n\nclient = CopilotClient()\nawait client.start()\n\nsession = await client.create_session(on_permission_request=PermissionHandler.approve_all, model=\"gpt-5.4\")\nresponse = await session.send_and_wait(\"Hello!\")\nprint(response.data.content)\n\nawait client.stop()\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"go\" data-label=\"Go\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Go</div>\n\n> \\[!NOTE]\n> Unlike Node.js, Python, and .NET, the Go SDK does not include a CLI as an automatic dependency. With no explicit path, `NewClient(nil)` uses an embedded CLI when available, then falls back to `copilot` on `PATH`. To embed a CLI, run the [bundler tool](https://github.com/github/copilot-sdk/tree/main/go/README.md#distributing-your-application-with-an-embedded-github-copilot-cli) at build time. You can also set `COPILOT_CLI_PATH` or point a `Connection` at an existing binary. See [Local CLI setup](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/setup/local-cli) for details.\n\n```golang\nclient := copilot.NewClient(nil)\nif err := client.Start(ctx); err != nil {\n    log.Fatal(err)\n}\ndefer client.Stop()\n\nsession, _ := client.CreateSession(ctx, &copilot.SessionConfig{Model: \"gpt-5.4\"})\nresponse, _ := session.SendAndWait(ctx, copilot.MessageOptions{Prompt: \"Hello!\"})\nif d, ok := response.Data.(*copilot.AssistantMessageData); ok {\n    fmt.Println(d.Content)\n}\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n```csharp\nawait using var client = new CopilotClient();\nawait using var session = await client.CreateSessionAsync(\n    new SessionConfig { Model = \"gpt-5.4\" });\n\nvar response = await session.SendAndWaitAsync(\n    new MessageOptions { Prompt = \"Hello!\" });\nConsole.WriteLine(response?.Data.Content);\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n> \\[!NOTE]\n> The Java SDK does not bundle or embed the Copilot CLI. Install the CLI separately and either make `copilot` available on your `PATH` or set its location with `setCliPath(...)` (or connect to a running CLI server with `setCliUrl(...)`).\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\n\nvar client = new CopilotClient(new CopilotClientOptions()\n    // Point to the CLI binary installed on the system\n    .setCliPath(\"/path/to/vendor/copilot\")\n);\nclient.start().get();\n\nvar session = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nvar response = session.sendAndWait(new MessageOptions()\n    .setPrompt(\"Hello!\")).get();\nSystem.out.println(response.getData().content());\n\nclient.stop().get();\n```\n\n</div>\n\n</div>\n\n## Authentication strategies\n\nYou need to decide how your users will authenticate. Here are the common patterns:\n\n![Diagram: Flowchart showing the described process.](/assets/images/help/copilot/copilot-sdk/setup-bundled-cli-diagram-1.png)\n\n### Option A: user's signed-in credentials (simplest)\n\nThe user signs in to the CLI once, and your app uses those credentials. No extra code needed—this is the default behavior.\n\n```typescript\nconst client = new CopilotClient();\n// Default: uses signed-in user credentials\n```\n\n### Option B: token via environment variable\n\nShip your app with instructions to set a token, or set it programmatically:\n\n```typescript\nconst client = new CopilotClient({\n    env: {\n        COPILOT_GITHUB_TOKEN: getUserToken(),  // Your app provides the token\n    },\n});\n```\n\n### Option C: BYOK (no GitHub auth needed)\n\nIf you manage your own model provider keys, users don't need GitHub accounts at all:\n\n```typescript\nconst client = new CopilotClient();\n\nconst session = await client.createSession({\n    model: \"gpt-5.4\",\n    provider: {\n        type: \"openai\",\n        baseUrl: \"https://api.openai.com/v1\",\n        apiKey: process.env.OPENAI_API_KEY,\n    },\n});\n```\n\nSee the **[BYOK (bring your own key)](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/auth/byok)** for full details.\n\n## Session management\n\nApps typically want named sessions so users can resume conversations:\n\n```typescript\nconst client = new CopilotClient();\n\n// Create a session tied to the user's project\nconst sessionId = `project-${projectName}`;\nconst session = await client.createSession({\n    sessionId,\n    model: \"gpt-5.4\",\n});\n\n// User closes app...\n// Later, resume where they left off\nconst resumed = await client.resumeSession(sessionId);\n```\n\nSession state persists at `~/.copilot/session-state/{sessionId}/`.\n\n## When to move on\n\n| Need                                     | Next Guide                                                                                               |\n| ---------------------------------------- | -------------------------------------------------------------------------------------------------------- |\n| Users signing in with GitHub accounts    | [GitHub OAuth setup](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/setup/github-oauth)         |\n| Run on a server instead of user machines | [Backend services setup](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/setup/backend-services) |\n| Use your own model keys                  | [BYOK (bring your own key)](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/auth/byok)           |\n\n## Next steps\n\n* **[BYOK (bring your own key)](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/auth/byok)**: Use your own model provider keys\n* **[Session resume and persistence](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/features/session-persistence)**: Advanced session management\n* **[Build your first Copilot-powered app](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/getting-started)**: Build a complete app"}