/** Run the app's services without Electron (development and tests): node dist/cli.js */ import { errorLog } from "./core/log.js"; import { startServices } from "./services.js"; const dataDir = process.argv[2] ?? process.env.JARVIS_DATA_DIR; if (!dataDir) { errorLog("usage: node dist/cli.js (or set JARVIS_DATA_DIR)"); process.exit(2); } startServices(dataDir).then((services) => { let stopping = false; const stop = () => { if (stopping) return; stopping = true; void services.stop().finally(() => process.exit(0)); }; process.on("SIGINT", stop); process.on("SIGTERM", stop); }, (e: Error) => { errorLog(`could not start: ${e.message}`); process.exit(1); });