MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / runDaemonCommand

Function runDaemonCommand

packages/codex-native-api/src/daemon_manager.ts:97–136  ·  view source on GitHub ↗
(argv: string[])

Source from the content-addressed store, hash-verified

95];
96
97export async function runDaemonCommand(argv: string[]): Promise<void> {
98 const options = parseDaemonCommandArgs(argv);
99 if (options.subcommand === 'install') {
100 const plan = await buildDaemonInstallPlan(options);
101 if (options.dryRun) {
102 printInstallPlan(plan);
103 return;
104 }
105 await installDaemon(plan);
106 printInstallSuccess(plan);
107 return;
108 }
109
110 if (options.dryRun) {
111 throw new Error('--dry-run is only supported for daemon install.');
112 }
113
114 switch (options.subcommand) {
115 case 'start':
116 await startDaemon();
117 return;
118 case 'stop':
119 await stopDaemon();
120 return;
121 case 'restart':
122 await restartDaemon();
123 return;
124 case 'status':
125 await statusDaemon();
126 return;
127 case 'logs':
128 await logsDaemon({ follow: options.follow, lines: options.lines });
129 return;
130 case 'uninstall':
131 await uninstallDaemon();
132 return;
133 default:
134 throw new Error(`Unsupported daemon subcommand: ${String(options.subcommand)}`);
135 }
136}
137
138export async function runDaemonSupervisor(argv: string[]): Promise<void> {
139 const options = parseSupervisorArgs(argv);

Callers 1

mainFunction · 0.85

Calls 11

parseDaemonCommandArgsFunction · 0.85
buildDaemonInstallPlanFunction · 0.85
printInstallPlanFunction · 0.85
installDaemonFunction · 0.85
printInstallSuccessFunction · 0.85
startDaemonFunction · 0.85
stopDaemonFunction · 0.85
restartDaemonFunction · 0.85
statusDaemonFunction · 0.85
logsDaemonFunction · 0.85
uninstallDaemonFunction · 0.85

Tested by

no test coverage detected