How to Automate Cursor Prompts and Monitor Accept/Reject Status via Code

Can I monitor Cursor’s button states such as ‘Accept All’, ‘Reject All’, or ‘Generating status’ programmatically?
I have a JSON file containing hundreds of prompts that I want to feed to Cursor one by one. After each prompt, I need to automatically verify certain pages via code to ensure the format is correct; if it is, I want Cursor to run Accept All. I believe I’ll need to use commands like:

await vscode.commands.executeCommand('editor.action.acceptCursorTabSuggestion');
  • Where can I find a complete list of these VS Code/Cursor commands?
  • Is there a way to write all of this in a plain .js script and run it with node script.js for my control logic, or is there a better approach?

Hi

simpler approach is to create a todo list from your prompts and save it into a file and refer to it in a chat, and ask for completing the task one by one and mark each one DONE when finished.

Thank you for your answer

It might make sense, but sometimes even if I send the exact same prompt, it produces outputs in different formats, so I have to check each one before accepting it.

For example, if I ask it to generate JSON and tell it that the JSON should have three fields metadata, content, and explanation with specific formatting rules, it sometimes doesn’t follow that format.

My goal is to assign the task and then just come back in the evening to see its status; if I don’t check with code each step, errors will compound and become unmanageable, and fixing them afterward would do more harm than good.

Do you have Schema in the language you use?
Like in Pydantic for example? or a class for that sake, which could validate the JSON?

What you want to achieve needs a bit more automation, if you want to avoid other complex solutions.

I’m just wondering how to run such code in a javascript file = await vscode.commands.executeCommand(‘editor.action.acceptCursorTabSuggestion’);

and how can I access the list of cursor’s commands. For example, I’ll check in the code to see if the rendering is still ongoing.

You don’t need such low-level access and it will probably end up causing an account ban for suspicious activity, until they don’t offer an API its better to not automate in unorthodox ways, your task can be achieved by ‘mcp evals’ which are mcps dedicated to evaluate a result, so you could add to context the json file, tell the model to read and process one prompt at a time and add an eval mcp that essentially contains examples of good results or instruct to run a verification script as @cocode suggested, the only limit is 25 tool calls that will be soon modifiable to a custom number we choose.

1 Like

Thank you for your answers, but I don’t think these will be useful for me at the moment.It seems like the 25 tool call limit won’t allow me to do that.

I also have an extra question regarding the ‘ban’ risk is this an official statement from the Cursor team, or is it just your personal opinion?
Depending on the situation, I might write a Python script that visually identifies the buttons and clicks them automatically.Like it would be safer.

1 Like

We don’t currently offer a way to automate the accept / reject actions in Cursor for any use case.

While we cannot condone or promote automating inputs into Cursor, using Python to click the button automatically seems like a reasonable thing to hook up.

3 Likes