MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / cliEnv

Function cliEnv

packages/plugins/onepassword/src/sdk/service.ts:190–197  ·  view source on GitHub ↗
(auth: ResolvedAuth)

Source from the content-addressed store, hash-verified

188const cliPromptLock = Semaphore.makeUnsafe(1);
189
190const cliEnv = (auth: ResolvedAuth): Record<string, string | undefined> => {
191 const env: Record<string, string | undefined> = { ...process.env };
192 // An inherited token would override `--account` and silently route a
193 // desktop-app call to whatever service account the parent process carries.
194 delete env["OP_SERVICE_ACCOUNT_TOKEN"];
195 if (auth.kind === "service-account") env["OP_SERVICE_ACCOUNT_TOKEN"] = auth.token;
196 return env;
197};
198
199const cliArgs = (auth: ResolvedAuth, base: readonly string[]): readonly string[] =>
200 auth.kind === "desktop-app" ? [...base, `--account=${auth.accountName}`] : base;

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected