How to develop with Cursor AI

The Cursor AI IDE depends on VS Code and documentation on Frappe GitHub is kind of outdated. Here’s the following setup that works:
The configuration is:

{
    "window.commandCenter": true,
    "git.autofetch": true,
    "python.defaultInterpreterPath": "~/frappe-bench/env/bin/python3.12",
    "launch": {
        "configurations": [
            {
                "name": "Frappe",
                "type": "debugpy",
                "request": "launch",
                "stopOnEntry": false,
                "python": "~/frappe-bench/env/bin/python3.12",
                "args": ["PYTHONUNBUFFERED=1", "DEVSERVER=1"],
                "program": "~/frappe-bench/apps/frappe/debug.py",
                "cwd": "~/frappe-bench/sites"
            }
        ]
    }
}

Please note my site name is devoncursor so you’ll need to change it with yours. The debug.py under ~/frappe-bench/apps/frappe/ is:

import frappe.app

frappe.app.serve(port=8000, no_reload=True, no_threading=True, site='devoncursor', sites_path='~/frappe-bench/sites')

The following is a must:

Edit the Procfile inside your bench, and remove the line that starts with bench serve

No other changes required so far. The system is Ubuntu 24LTS and development setup is done by GitHub - flexcomng/erpnext_quick_install: Unattended install script for ERPNext Versions, 13, 14 and 15 @flexy2ky best script ever!
Do not install production and do not install hrms
Happy coding!

2 Likes