MCPcopy Create free account
hub / github.com/chrispyers/openkiwi / ghApi

Function ghApi

tools/github/github.ts:21–35  ·  view source on GitHub ↗
(...args: string[])

Source from the content-addressed store, hash-verified

19 'Use this tool instead of chromium for all GitHub repo access — it has authenticated access to private repos and gists.';
20
21async function ghApi(...args: string[]): Promise<any> {
22 debug('gh api', args);
23 try {
24 const { stdout } = await execFileAsync('gh', ['api', ...args], {
25 timeout: 30_000,
26 maxBuffer: 10 * 1024 * 1024
27 });
28 debug('gh api response:', stdout.slice(0, 200) + (stdout.length > 200 ? '...' : ''));
29 return JSON.parse(stdout);
30 } catch (err: any) {
31 const msg = err.stderr?.trim() || err.message;
32 debug('gh api error:', msg);
33 throw new Error(`gh api failed: ${msg}`);
34 }
35}
36
37export default {
38 definition: {

Callers 1

github.tsFile · 0.85

Calls 1

debugFunction · 0.70

Tested by

no test coverage detected