Files
cli/assistant/src/command/asst-server/reload.ts
abearxiong a80a3ede46 feat: add argument parsing and module resolution for assistant app
- Implemented argument parsing in args.ts to handle root, home, and help options.
- Added parseHomeArg and parseHelpArg functions for command line argument handling.
- Created ModuleResolver class in assistant-app-resolve.ts to resolve module paths, including scoped packages and relative paths.
- Introduced caching mechanism for package.json reads to improve performance.
- Added utility functions for checking file existence and clearing the cache.
2026-01-31 17:42:53 +08:00

17 lines
555 B
TypeScript

import { program, Command } from '@/program.ts';
import { spawnSync } from 'node:child_process';
const reload = new Command('reload')
.description('重载正在运行的 Assistant Server 服务')
.action(() => {
console.log('正在重载 Assistant Server 服务...');
const cwd = 'pm2 restart assistant-server';
const child = spawnSync('pm2', ['restart', 'assistant-server'], {
stdio: 'inherit',
shell: true,
cwd: cwd,
});
console.log('Assistant Server 服务重载完成。');
});
program.addCommand(reload);