Where does the bug appear (feature/product)?
Cursor CLI
Describe the Bug
When using Node.js child_process.spawn() to execute cursor-agent command, the process hangs and eventually exits with code 143 after the timeout period (60 seconds).
Steps to Reproduce
- Process starts but hangs indefinitely
- No output is received on stdout or stderr
- After 60 seconds (timeout), process exits with code 143
- Code 143 typically indicates the process was terminated by SIGTERM signal
const { spawn } = require('node:child_process');
const agent = spawn('cursor-agent', [
'--output-format', 'text',
'--model', 'cursor-small',
'--api-key', 'key-xxx',
'-p', 'Hello',
], {
timeout: 60000,
shell: true,
});
agent.stdout.on('data', (data) => {
console.log('STDOUT:', data.toString());
});
agent.stderr.on('data', (data) => {
console.error('STDERR:', data.toString());
});
agent.on('error', (error) => {
console.error('Process error:', error);
});
agent.on('close', (code) => {
console.log(`Process exited with code: ${code}`);
});
Expected Behavior
The cursor-agent should execute successfully and return output through stdout.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
OS: macOS (darwin 24.6.0)
Node.js: (v20.19.4)
cursor-agent: (2025.09.12-4852336)
For AI issues: which model did you use?
cursor-small
Additional Information
- The cursor-agent command works fine when executed directly in terminal
- The issue occurs specifically when spawning from Node.js
- No error messages are captured in stderr
Does this stop you from using Cursor
No - Cursor works, but with this issue