forked from JuliusBrussee/caveman
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.js
More file actions
executable file
·35 lines (31 loc) · 1.49 KB
/
Copy pathinstall.js
File metadata and controls
executable file
·35 lines (31 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const { spawnSync } = require('child_process');
const sourceDir = path.join(__dirname, '.cursor');
const targetDir = path.join(process.cwd(), '.cursor');
console.log('🪨 Installing Neandercode (Neandercode mode) for Cursor...');
try {
fs.cpSync(sourceDir, targetDir, { recursive: true });
console.log('✅ Neandercode installed successfully!');
console.log('Open Cursor Chat and type /neandercode to activate.');
console.log('');
console.log('Authenticating Cursor Agent for CLI tools...');
const login = spawnSync('cursor', ['agent', 'login'], { stdio: 'inherit' });
if (login.error) {
console.warn('⚠️ Could not run `cursor agent login` automatically:', login.error.message);
console.warn('Run it manually later, or set CURSOR_API_KEY for non-interactive / CI.');
} else if (login.status !== 0) {
console.warn(`⚠️ \`cursor agent login\` exited with code ${login.status}.`);
console.warn('Run it again manually later, or set CURSOR_API_KEY for non-interactive / CI.');
} else {
console.log('✅ Cursor Agent login completed.');
}
console.log('');
console.log('If `cursor agent` fails with a missing @anysphere/... native module:');
console.log(' cursor agent update');
console.log('On Apple Silicon Macs, install Cursor’s Apple Silicon (ARM) app — not the Intel/x64 build.');
} catch (err) {
console.error('❌ Failed to install Neandercode:', err.message);
process.exit(1);
}