mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-21 17:38:10 +00:00
23 lines
669 B
JavaScript
23 lines
669 B
JavaScript
#!/usr/bin/env node
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
const { fork } = require('child_process');
|
|
|
|
const binDir = __dirname;
|
|
const skillsdirPath = path.join(binDir, '..', '.skillsdir');
|
|
|
|
if (!fs.existsSync(skillsdirPath)) {
|
|
process.stderr.write('Error: OpenClaw manager not running (no .skillsdir found)\n');
|
|
process.exit(1);
|
|
}
|
|
|
|
const skillsDir = fs.readFileSync(skillsdirPath, 'utf8').trim();
|
|
const managerPath = path.join(binDir, '..', 'manager.js');
|
|
|
|
const proc = fork(managerPath, [skillsDir, ...process.argv.slice(2)], {
|
|
stdio: 'inherit',
|
|
env: { ...process.env, OPENCLAW_CLI: '1' },
|
|
});
|
|
|
|
proc.on('exit', (code) => process.exit(code));
|