Team Ai
Apppublic

delqhi/sin-github-issues

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
cli.ts40 linesDownload Raw Back to src
1#!/usr/bin/env node2 3import { readFileSync } from 'node:fs';4import { resolve } from 'node:path';5import { createTemplateAgentHttpServer } from './a2a-http.js';6import { runMcpServer } from './mcp-server.js';7import { executeGitHubAgentAction } from './runtime.js';8 9const cmd = process.argv[2];10 11if (cmd === 'serve-a2a') {12  createTemplateAgentHttpServer().start().catch(err => {13    console.error(err);14    process.exit(1);15  });16} else if (cmd === 'serve-mcp') {17  runMcpServer().catch(err => {18    console.error(err);19    process.exit(1);20  });21} else if (cmd === 'print-card') {22  const cardPath = resolve(process.cwd(), 'A2A-CARD.md');23  console.log(readFileSync(cardPath, 'utf8'));24} else if (cmd === 'run-action') {25  const payload = process.argv[3];26  if (!payload) {27    console.error('Usage: run-action \'{"action":"sin.github.health"}\'');28    process.exit(1);29  }30  executeGitHubAgentAction(JSON.parse(payload))31    .then(res => console.log(JSON.stringify(res, null, 2)))32    .catch(err => {33      console.error(err);34      process.exit(1);35    });36} else {37  console.error('Usage: <cli> [serve-mcp|print-card|run-action]');38  process.exit(1);39}40