Skip to content

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

string

Repository URL to get token for

Record<string, string>

Object with GH_TOKEN and GITHUB_TOKEN set

import { spawnSync } from 'node:child_process';
const proc = spawnSync('gh', ['pr', 'list'], {
env: { ...process.env, ...getEnvForRepo("owner/repo") }
});