This commit is contained in:
2026-02-24 12:29:58 +00:00
commit 3fad287a29
58 changed files with 3999 additions and 0 deletions

37
ts/index.ts Normal file
View File

@@ -0,0 +1,37 @@
/**
* Main exports and CLI entry point for GitOps
*/
export { GitopsApp } from './classes/gitopsapp.ts';
export { logger } from './logging.ts';
import { GitopsApp } from './classes/gitopsapp.ts';
import { logger } from './logging.ts';
export async function runCli(): Promise<void> {
const args = Deno.args;
const command = args[0] || 'server';
switch (command) {
case 'server': {
const port = parseInt(Deno.env.get('GITOPS_PORT') || '3000', 10);
const app = new GitopsApp();
await app.start(port);
// Handle graceful shutdown
const shutdown = async () => {
logger.info('Shutting down...');
await app.stop();
Deno.exit(0);
};
Deno.addSignalListener('SIGINT', shutdown);
Deno.addSignalListener('SIGTERM', shutdown);
break;
}
default:
logger.error(`Unknown command: ${command}`);
logger.info('Usage: gitops [server]');
Deno.exit(1);
}
}