agentify-client
Version:
Secure connection client for exposing local REST APIs, self-hosted LLMs, and development sites to the web instantly
37 lines (28 loc) • 1.01 kB
JavaScript
const { spawn } = require('child_process');
const path = require('path');
const fs = require('fs');
const os = require('os');
// Get binary name based on platform
const binaryName = os.platform() === 'win32' ? 'agentify.exe' : 'agentify';
const binaryPath = path.join(__dirname, 'bin', binaryName);
// Check if binary exists
if (!fs.existsSync(binaryPath)) {
console.error('❌ Agentify binary not found. Please reinstall the package.');
console.error('Visit https://agentifyops.com for manual installation instructions.');
process.exit(1);
}
// Run the binary with provided arguments
try {
const child = spawn(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
child.on('error', (error) => {
console.error(`❌ Error executing agentify: ${error.message}`);
process.exit(1);
});
child.on('exit', (code) => {
process.exit(code || 0);
});
} catch (error) {
console.error(`❌ Failed to start agentify: ${error.message}`);
process.exit(1);
}