From 50366e319a3bc1635dc50335591712c6ecd8c734 Mon Sep 17 00:00:00 2001 From: BasaiCorp Date: Sun, 16 Mar 2025 09:05:17 +0530 Subject: [PATCH] Added totally_reset_cursor.py to fully reset Cursor AI --- totally_reset_cursor.py | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 totally_reset_cursor.py diff --git a/totally_reset_cursor.py b/totally_reset_cursor.py new file mode 100644 index 0000000..c130fdc --- /dev/null +++ b/totally_reset_cursor.py @@ -0,0 +1,68 @@ +import os +import shutil +import platform +import time + +def remove_dir(path): + """Removes a directory if it exists and logs the action.""" + if os.path.exists(path): + shutil.rmtree(path, ignore_errors=True) + print(f"[āœ”] Deleted: {path}") + else: + print(f"[✘] Not Found: {path}") + +def reset_cursor(): + """Completely resets Cursor AI by removing all settings, caches, and extensions.""" + system = platform.system() + home = os.path.expanduser("~") + + print("\nšŸš€ Resetting Cursor AI Editor... Please wait.\n") + + if system == "Windows": + cursor_paths = [ + os.path.join(home, "AppData", "Roaming", "Cursor"), + os.path.join(home, "AppData", "Local", "Cursor"), + os.path.join(home, ".vscode"), # Cursor sometimes stores extensions here + os.path.join(home, "AppData", "Local", "Temp", "Cursor"), # Temporary data + ] + + elif system == "Darwin": # macOS + cursor_paths = [ + os.path.join(home, "Library", "Application Support", "Cursor"), + os.path.join(home, "Library", "Caches", "Cursor"), + os.path.join(home, "Library", "Preferences", "Cursor"), + os.path.join(home, ".vscode"), # Cursor sometimes stores extensions here + ] + + elif system == "Linux": + cursor_paths = [ + os.path.join(home, ".config", "Cursor"), + os.path.join(home, ".cache", "Cursor"), + os.path.join(home, ".local", "share", "Cursor"), + os.path.join(home, ".vscode"), # Cursor sometimes stores extensions here + ] + + else: + print("āŒ Unsupported OS. Exiting.") + return + + for path in cursor_paths: + remove_dir(path) + + # Remove potential files that store trial/activation data + cursor_trial_paths = [ + os.path.join(home, ".cursor_trial_data"), + os.path.join(home, "AppData", "Local", "Cursor", "trial_info.json"), # Windows + os.path.join(home, "Library", "Application Support", "Cursor", "trial_info.json"), # macOS + os.path.join(home, ".config", "Cursor", "trial_info.json"), # Linux + ] + + print("\nšŸ”„ Removing trial data and license information...\n") + for path in cursor_trial_paths: + remove_dir(path) + + print("\nāœ… Cursor AI has been fully reset! Restart your system for changes to take effect.\n") + +if __name__ == "__main__": + reset_cursor() +