getEnvForRepo
getEnvForRepo(
repoUrl):Record<string,string>
Defined in: packages/agentic-control/src/core/tokens.ts:373
Create environment variables object for a subprocess targeting a specific org Useful when spawning child processes that need the correct GitHub token
Parameters
Section titled “Parameters”repoUrl
Section titled “repoUrl”string
Repository URL to get token for
Returns
Section titled “Returns”Record<string, string>
Object with GH_TOKEN and GITHUB_TOKEN set
Example
Section titled “Example”import { spawnSync } from 'node:child_process';const proc = spawnSync('gh', ['pr', 'list'], { env: { ...process.env, ...getEnvForRepo("owner/repo") }});