Act I · Refactoring
Sever the Shell
Hmm seems like we should just use the GH GQL SDK in pack-status.ts rather than shelling out to get more speeeeeeeed
Replaced all execSync('gh api graphql ...') and execSync('gh ...') calls with native Node 20 fetch + GitHub GraphQL/REST APIs. Auth token obtained once at startup via gh auth token — the only remaining child process spawn. Zero new dependencies.
const GH_GQL = "https://api.github.com/graphql"; const TOKEN = execSync("gh auth token", { encoding: "utf-8" }).trim();async function graphql(query, variables = {}) { const res = await fetch(GH_GQL, { method: "POST", headers: { Authorization:
bearer ${TOKEN}}, body: JSON.stringify({ query, variables }), }); return res.json(); }