MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / run

Function run

apps/cli/src/cli.ts:613–627  ·  view source on GitHub ↗
(argv?: string[])

Source from the content-addressed store, hash-verified

611
612/** CLI entry function */
613export function run(argv?: string[]): void {
614 // Logs go to ~/.chatlab/logs/app.log regardless of configured user data dir.
615 initAppLogger(getSystemLogsDir())
616 process.on('uncaughtException', (error) => {
617 console.error('Uncaught Exception:', error)
618 appLogger.error('crash', 'uncaughtException', error)
619 process.exit(1)
620 })
621 process.on('unhandledRejection', (reason) => {
622 console.error('Unhandled Rejection:', reason)
623 appLogger.error('crash', 'unhandledRejection', reason)
624 process.exit(1)
625 })
626 program.parse(argv)
627}
628
629// Auto-execute when run directly as a script
630const isDirectRun = process.argv[1]?.endsWith('cli.ts') || process.argv[1]?.endsWith('cli.js')

Callers 1

cli.tsFile · 0.70

Calls 5

initAppLoggerFunction · 0.90
getSystemLogsDirFunction · 0.90
onMethod · 0.80
parseMethod · 0.80
errorMethod · 0.65

Tested by

no test coverage detected