├── 20250530_005756.mp4 ├── 2bf6d478820bf7c6b2155ba704fac3ed.jpg ├── README.md ├── config.env ├── config_mac.env ├── cursor_clean.py ├── cursor_clean.spec ├── cursor_clean_mac.py ├── cursor_clean_mac.spec ├── dist ├── config.env └── cursor_clean.exe └── ee959738cc1fe045a8e741b906a100fb.png /20250530_005756.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jskeaaa/cursor_pro/cf282abe14d72a41ae4660c659d12ca8700e9587/20250530_005756.mp4 -------------------------------------------------------------------------------- /2bf6d478820bf7c6b2155ba704fac3ed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jskeaaa/cursor_pro/cf282abe14d72a41ae4660c659d12ca8700e9587/2bf6d478820bf7c6b2155ba704fac3ed.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cursor-pro 2 | 3 | 突破claude-3.7的限制。(注意把自己的提示词先备份好) 4 | # 注意 5 | 当还是不行时,一定要换ip,可能是ip污染(已经有少部分人出现这种情况了)多试几次 6 | 7 | ## 解决问题 8 | 问题实例 9 | ## 功能 10 | 11 | * 删除 `globalStorage/state.vscdb` 和 `globalStorage/state.vscdb.backup` 文件 12 | * 清空 `History` 文件夹内的所有内容 13 | * 删除 `workspaceStorage` 文件夹及其内容 14 | 15 | ## 使用演示 16 | 17 | 下面是工具使用演示视频: 18 | 19 | [点击下载观看视频](20250530_005756.mp4) 20 | 21 | 25 | 26 | 27 | ### Windows系统 28 | 29 | #### 使用打包后的exe文件 30 | 31 | 1. 右键点击打包后的exe文件,选择"以管理员身份运行" 32 | 33 | ### Mac系统 34 | 35 | #### 使用Python脚本 36 | 37 | 1. 打开终端(Terminal) 38 | 2. 进入脚本所在目录 39 | 3. 执行以下命令运行脚本: 40 | ``` 41 | sudo python3 cursor_clean_mac.py 42 | ``` 43 | 44 | #### 使用打包后的可执行文件 45 | 46 | 1. 打开终端(Terminal) 47 | 2. 进入可执行文件所在目录 48 | 3. 执行以下命令运行: 49 | ``` 50 | sudo ./cursor_clean_mac 51 | ``` 52 | 53 | 注意:在Mac系统中程序需要管理员权限才能运行,因为需要访问系统受保护的文件。 54 | 55 | ## 配置文件 56 | 57 | ### Windows系统 58 | 59 | 脚本会自动创建 `config.env` 配置文件,您可以根据需要修改其中的路径设置: 60 | 61 | ```ini 62 | [PATHS] 63 | # Cursor用户数据目录路径 64 | base_path = C:\Users\用户名\AppData\Roaming\Cursor\User 65 | ``` 66 | exe文件会在dist文件夹中,配置文件需要和exe放在同一目录。 67 | 68 | ### Mac系统 69 | 70 | 程序会自动创建 `config_mac.env` 配置文件,您可以根据需要修改其中的路径设置: 71 | 72 | ```ini 73 | [PATHS] 74 | # Cursor用户数据目录路径 75 | base_path = ~/Library/Application Support/Cursor/User 76 | ``` 77 | 78 | 配置文件需要和脚本或可执行文件放在同一目录。 79 | 80 | # 问题反馈群(拉你进群) 81 | 82 | Cursor交流群 -------------------------------------------------------------------------------- /config.env: -------------------------------------------------------------------------------- 1 | [PATHS] 2 | # Cursor用户数据目录路径,可以根据实际情况修改 3 | # 默认为 C:\Users\{用户名}\AppData\Roaming\Cursor\User 4 | base_path = C:\Users\Administrator\AppData\Roaming\Cursor\User -------------------------------------------------------------------------------- /config_mac.env: -------------------------------------------------------------------------------- 1 | [PATHS] 2 | # Cursor用户数据目录路径,可以根据实际情况修改 3 | # 默认为 ~/Library/Application Support/Cursor/User 4 | base_path = ~/Library/Application Support/Cursor/User -------------------------------------------------------------------------------- /cursor_clean.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | import ctypes 4 | import sys 5 | import getpass 6 | import configparser 7 | 8 | def is_admin(): 9 | """检查脚本是否以管理员权限运行""" 10 | try: 11 | return ctypes.windll.shell32.IsUserAnAdmin() 12 | except: 13 | return False 14 | 15 | def read_config(): 16 | """读取配置文件""" 17 | config = configparser.ConfigParser() 18 | config_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.env') 19 | 20 | if not os.path.exists(config_path): 21 | create_default_config(config_path) 22 | 23 | config.read(config_path) 24 | return config 25 | 26 | def create_default_config(config_path): 27 | """创建默认配置文件""" 28 | config = configparser.ConfigParser() 29 | username = getpass.getuser() 30 | default_base_path = os.path.join('C:\\Users', username, 'AppData\\Roaming\\Cursor\\User') 31 | 32 | config['PATHS'] = { 33 | 'base_path': default_base_path 34 | } 35 | 36 | with open(config_path, 'w') as configfile: 37 | config.write(configfile) 38 | 39 | print(f"已创建默认配置文件: {config_path}") 40 | print(f"默认路径设置为: {default_base_path}") 41 | 42 | def clean_cursor_files(): 43 | """清理Cursor应用的文件和文件夹""" 44 | # 读取配置文件 45 | config = read_config() 46 | base_path = config['PATHS']['base_path'] 47 | 48 | print(f"清理 {base_path} 中的文件...") 49 | 50 | files_to_delete = [ 51 | os.path.join(base_path, 'globalStorage', 'state.vscdb'), 52 | os.path.join(base_path, 'globalStorage', 'state.vscdb.backup') 53 | ] 54 | 55 | folders_to_clean = [ 56 | os.path.join(base_path, 'History') 57 | ] 58 | 59 | folders_to_delete = [ 60 | os.path.join(base_path, 'workspaceStorage') 61 | ] 62 | 63 | for file_path in files_to_delete: 64 | try: 65 | if os.path.exists(file_path): 66 | os.remove(file_path) 67 | print(f"已删除文件: {file_path}") 68 | else: 69 | print(f"文件不存在: {file_path}") 70 | except Exception as e: 71 | print(f"删除文件 {file_path} 失败: {e}") 72 | 73 | for folder_path in folders_to_clean: 74 | try: 75 | if os.path.exists(folder_path): 76 | for item in os.listdir(folder_path): 77 | item_path = os.path.join(folder_path, item) 78 | try: 79 | if os.path.isfile(item_path): 80 | os.remove(item_path) 81 | elif os.path.isdir(item_path): 82 | shutil.rmtree(item_path) 83 | except Exception as e: 84 | print(f"删除 {item_path} 失败: {e}") 85 | print(f"已清空文件夹: {folder_path}") 86 | else: 87 | print(f"文件夹不存在: {folder_path}") 88 | except Exception as e: 89 | print(f"清空文件夹 {folder_path} 失败: {e}") 90 | 91 | for folder_path in folders_to_delete: 92 | try: 93 | if os.path.exists(folder_path): 94 | shutil.rmtree(folder_path) 95 | print(f"已删除文件夹: {folder_path}") 96 | else: 97 | print(f"文件夹不存在: {folder_path}") 98 | except Exception as e: 99 | print(f"删除文件夹 {folder_path} 失败: {e}") 100 | 101 | def main(): 102 | """主函数""" 103 | if not is_admin(): 104 | print("请以管理员权限运行此脚本") 105 | # 如果不是管理员权限,尝试以管理员权限重新运行 106 | ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1) 107 | return 108 | 109 | print("开始清理 Cursor 应用数据...") 110 | clean_cursor_files() 111 | print("清理完成!") 112 | input("按任意键退出...") 113 | 114 | if __name__ == "__main__": 115 | main() -------------------------------------------------------------------------------- /cursor_clean.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | 4 | a = Analysis( 5 | ['cursor_clean.py'], 6 | pathex=[], 7 | binaries=[], 8 | datas=[], 9 | hiddenimports=[], 10 | hookspath=[], 11 | hooksconfig={}, 12 | runtime_hooks=[], 13 | excludes=[], 14 | noarchive=False, 15 | optimize=0, 16 | ) 17 | pyz = PYZ(a.pure) 18 | 19 | exe = EXE( 20 | pyz, 21 | a.scripts, 22 | a.binaries, 23 | a.datas, 24 | [], 25 | name='cursor_clean', 26 | debug=False, 27 | bootloader_ignore_signals=False, 28 | strip=False, 29 | upx=True, 30 | upx_exclude=[], 31 | runtime_tmpdir=None, 32 | console=True, 33 | disable_windowed_traceback=False, 34 | argv_emulation=False, 35 | target_arch=None, 36 | codesign_identity=None, 37 | entitlements_file=None, 38 | uac_admin=True, 39 | ) 40 | -------------------------------------------------------------------------------- /cursor_clean_mac.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | import sys 4 | import getpass 5 | import configparser 6 | import subprocess 7 | 8 | def is_root(): 9 | """检查脚本是否以root权限运行""" 10 | return os.geteuid() == 0 11 | 12 | def resource_path(relative_path): 13 | """获取资源的绝对路径,适用于PyInstaller打包环境""" 14 | try: 15 | # PyInstaller创建临时文件夹,将路径存储在_MEIPASS中 16 | base_path = sys._MEIPASS 17 | except Exception: 18 | # 如果不是在打包环境中运行,使用当前目录 19 | base_path = os.path.abspath(".") 20 | 21 | return os.path.join(base_path, relative_path) 22 | 23 | def read_config(): 24 | """读取配置文件""" 25 | config = configparser.ConfigParser() 26 | 27 | # 尝试从脚本所在目录读取配置文件 28 | config_dir = os.path.dirname(os.path.abspath(sys.argv[0])) 29 | config_path = os.path.join(config_dir, 'config_mac.env') 30 | 31 | if not os.path.exists(config_path): 32 | create_default_config(config_path) 33 | 34 | config.read(config_path) 35 | return config 36 | 37 | def create_default_config(config_path): 38 | """创建默认配置文件""" 39 | config = configparser.ConfigParser() 40 | username = getpass.getuser() 41 | default_base_path = os.path.expanduser(f'~/Library/Application Support/Cursor/User') 42 | 43 | config['PATHS'] = { 44 | 'base_path': default_base_path 45 | } 46 | 47 | with open(config_path, 'w') as configfile: 48 | config.write(configfile) 49 | 50 | print(f"已创建默认配置文件: {config_path}") 51 | print(f"默认路径设置为: {default_base_path}") 52 | 53 | def clean_cursor_files(): 54 | """清理Cursor应用的文件和文件夹""" 55 | # 读取配置文件 56 | config = read_config() 57 | base_path = config['PATHS']['base_path'] 58 | base_path = os.path.expanduser(base_path) # 确保波浪线被正确解析 59 | 60 | print(f"清理 {base_path} 中的文件...") 61 | 62 | files_to_delete = [ 63 | os.path.join(base_path, 'globalStorage', 'state.vscdb'), 64 | os.path.join(base_path, 'globalStorage', 'state.vscdb.backup') 65 | ] 66 | 67 | folders_to_clean = [ 68 | os.path.join(base_path, 'History') 69 | ] 70 | 71 | folders_to_delete = [ 72 | os.path.join(base_path, 'workspaceStorage') 73 | ] 74 | 75 | # 删除指定文件 76 | for file_path in files_to_delete: 77 | try: 78 | if os.path.exists(file_path): 79 | os.remove(file_path) 80 | print(f"已删除文件: {file_path}") 81 | else: 82 | print(f"文件不存在: {file_path}") 83 | except Exception as e: 84 | print(f"删除文件 {file_path} 失败: {e}") 85 | 86 | # 清空指定文件夹 87 | for folder_path in folders_to_clean: 88 | try: 89 | if os.path.exists(folder_path): 90 | for item in os.listdir(folder_path): 91 | item_path = os.path.join(folder_path, item) 92 | try: 93 | if os.path.isfile(item_path): 94 | os.remove(item_path) 95 | elif os.path.isdir(item_path): 96 | shutil.rmtree(item_path) 97 | except Exception as e: 98 | print(f"删除 {item_path} 失败: {e}") 99 | print(f"已清空文件夹: {folder_path}") 100 | else: 101 | print(f"文件夹不存在: {folder_path}") 102 | except Exception as e: 103 | print(f"清空文件夹 {folder_path} 失败: {e}") 104 | 105 | # 删除指定文件夹 106 | for folder_path in folders_to_delete: 107 | try: 108 | if os.path.exists(folder_path): 109 | shutil.rmtree(folder_path) 110 | print(f"已删除文件夹: {folder_path}") 111 | else: 112 | print(f"文件夹不存在: {folder_path}") 113 | except Exception as e: 114 | print(f"删除文件夹 {folder_path} 失败: {e}") 115 | 116 | def main(): 117 | """主函数""" 118 | if not is_root(): 119 | print("需要root权限来运行此程序") 120 | print("请使用 sudo 重新运行") 121 | 122 | # 判断是否为打包后的应用 123 | if getattr(sys, 'frozen', False): 124 | # 如果是打包后的应用,使用完整路径 125 | app_path = sys.executable 126 | else: 127 | # 如果是脚本,使用脚本路径 128 | app_path = sys.argv[0] 129 | 130 | subprocess.call(['sudo', app_path]) 131 | return 132 | 133 | print("开始清理 Cursor 应用数据...") 134 | clean_cursor_files() 135 | print("清理完成!") 136 | input("按任意键退出...") 137 | 138 | if __name__ == "__main__": 139 | main() -------------------------------------------------------------------------------- /cursor_clean_mac.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | block_cipher = None 4 | 5 | a = Analysis(['cursor_clean_mac.py'], 6 | pathex=[], 7 | binaries=[], 8 | datas=[], 9 | hiddenimports=[], 10 | hookspath=[], 11 | hooksconfig={}, 12 | runtime_hooks=[], 13 | excludes=[], 14 | win_no_prefer_redirects=False, 15 | win_private_assemblies=False, 16 | cipher=block_cipher, 17 | noarchive=False) 18 | pyz = PYZ(a.pure, a.zipped_data, 19 | cipher=block_cipher) 20 | 21 | exe = EXE(pyz, 22 | a.scripts, 23 | a.binaries, 24 | a.zipfiles, 25 | a.datas, 26 | [], 27 | name='cursor_clean_mac', 28 | debug=False, 29 | bootloader_ignore_signals=False, 30 | strip=False, 31 | upx=True, 32 | upx_exclude=[], 33 | runtime_tmpdir=None, 34 | console=True, 35 | disable_windowed_traceback=False, 36 | target_arch=None, 37 | codesign_identity=None, 38 | entitlements_file=None ) -------------------------------------------------------------------------------- /dist/config.env: -------------------------------------------------------------------------------- 1 | [PATHS] 2 | # Cursor用户数据目录路径,可以根据实际情况修改 3 | # 默认为 C:\Users\{用户名}\AppData\Roaming\Cursor\User 4 | base_path = C:\Users\Administrator\AppData\Roaming\Cursor\User -------------------------------------------------------------------------------- /dist/cursor_clean.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jskeaaa/cursor_pro/cf282abe14d72a41ae4660c659d12ca8700e9587/dist/cursor_clean.exe -------------------------------------------------------------------------------- /ee959738cc1fe045a8e741b906a100fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jskeaaa/cursor_pro/cf282abe14d72a41ae4660c659d12ca8700e9587/ee959738cc1fe045a8e741b906a100fb.png --------------------------------------------------------------------------------