MCPcopy Index your code
hub / github.com/github/copilot-sdk / createClientWithEnv

Function createClientWithEnv

nodejs/test/e2e/rpc_server.e2e.test.ts:25–48  ·  view source on GitHub ↗
(
        extraEnv: Record<string, string | undefined>,
        token?: string
    )

Source from the content-addressed store, hash-verified

23 }
24
25 function createClientWithEnv(
26 extraEnv: Record<string, string | undefined>,
27 token?: string
28 ): CopilotClient {
29 const childEnv = {
30 ...env,
31 ...extraEnv,
32 };
33 const extraClient = new CopilotClient({
34 workingDirectory: workDir,
35 env: childEnv,
36 logLevel: "error",
37 connection: RuntimeConnection.forStdio({ path: process.env.COPILOT_CLI_PATH }),
38 gitHubToken: token,
39 });
40 onTestFinished(async () => {
41 try {
42 await extraClient.forceStop();
43 } catch {
44 // Ignore cleanup errors
45 }
46 });
47 return extraClient;
48 }
49
50 async function configureAuthenticatedUser(
51 token: string,

Callers 2

Calls 1

forceStopMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…