Update totally_reset_cursor.py Stable

Working and Stable
This commit is contained in:
BasaiCorp 2025-03-21 22:06:01 +05:30 committed by GitHub
parent 8f47801dad
commit 854e987927
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,11 +52,38 @@ def reset_machine_id():
except Exception as e: except Exception as e:
print(f"❌ Failed to reset machine ID at {path}: {e}") print(f"❌ Failed to reset machine ID at {path}: {e}")
elif platform.system() == "Darwin": # macOS elif platform.system() == "Darwin": # macOS
# macOS typically doesn't use a machine-id file like Linux
print(" macOS does not use a machine-id file. Skipping machine ID reset.") print(" macOS does not use a machine-id file. Skipping machine ID reset.")
else: else:
print("❌ Unsupported operating system for machine ID reset.") print("❌ Unsupported operating system for machine ID reset.")
def display_features_and_warnings():
"""Displays features and warnings before proceeding."""
print("\n🚀 Cursor AI Reset Script")
print("=====================================")
print("Features:")
print(" - Removes Cursor AI configuration directories and files.")
print(" - Cleans up cache, preferences, and application data.")
print(" - Performs a deep scan for hidden Cursor-related files.")
print(" - Resets the machine ID to a new UUID (where applicable).")
print(" - Supports Windows, Linux, and macOS.")
print("\n⚠️ Warnings:")
print(" - This action is IRREVERSIBLE. All Cursor AI data will be deleted.")
print(" - Requires administrative privileges for some operations (e.g., machine ID reset on Windows/Linux).")
print(" - May disrupt Cursor AI functionality until reinstalled or reconfigured.")
print(" - Backup any important Cursor data before proceeding.")
print("=====================================\n")
def get_user_confirmation():
"""Prompts the user for confirmation to proceed."""
while True:
response = input("Do you want to proceed with resetting Cursor AI? (yes/no): ").lower().strip()
if response in ['yes', 'y']:
return True
elif response in ['no', 'n']:
return False
else:
print("Please enter 'yes' or 'no'.")
def reset_cursor(): def reset_cursor():
print("\n🚀 Resetting Cursor AI...\n") print("\n🚀 Resetting Cursor AI...\n")
@ -133,9 +160,17 @@ def reset_cursor():
def main(): def main():
start_time = time.time() start_time = time.time()
reset_cursor()
end_time = time.time() # Display features and warnings
print(f"\n⏱️ Completed in {end_time - start_time:.2f} seconds.") display_features_and_warnings()
# Get user confirmation
if get_user_confirmation():
reset_cursor()
end_time = time.time()
print(f"\n⏱️ Completed in {end_time - start_time:.2f} seconds.")
else:
print("\n❌ Operation cancelled by user.")
if __name__ == '__main__': if __name__ == '__main__':
main() main()