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

Function installMacos

apps/cli/src/daemon/service.ts:135–154  ·  view source on GitHub ↗
(options: ServiceInstallOptions)

Source from the content-addressed store, hash-verified

133}
134
135function installMacos(options: ServiceInstallOptions): void {
136 fs.mkdirSync(path.dirname(PLIST_PATH), { recursive: true })
137
138 if (fs.existsSync(PLIST_PATH)) {
139 launchctlUnload(PLIST_PATH)
140 }
141
142 fs.writeFileSync(PLIST_PATH, buildPlist(options))
143 launchctlLoad(PLIST_PATH)
144
145 const port = options.port ?? 3110
146 const host = options.host ?? '127.0.0.1'
147 writeMeta({ port, host, installedAt: new Date().toISOString() })
148
149 console.log(`\nChatLab is now running as a system service`)
150 console.log(` API: http://${host}:${port}`)
151 console.log(` Logs: ${LOG_FILE}`)
152 console.log(` Service: ${SERVICE_LABEL} (launchd)`)
153 console.log(`\nAuto-starts on login. Use \`chatlab stop\` to remove.\n`)
154}
155
156function uninstallMacos(): void {
157 if (!fs.existsSync(PLIST_PATH)) {

Callers 1

serviceInstallFunction · 0.85

Calls 4

launchctlUnloadFunction · 0.85
buildPlistFunction · 0.85
launchctlLoadFunction · 0.85
writeMetaFunction · 0.70

Tested by

no test coverage detected