从 Cursor IDE 本地数据库导出完整对话历史的 Python 工具。支持批量导出、智能过滤、时间倒序排列,完整保留用户消息、Agent 回复和工具调用详情。一键备份你的 AI 编程对话!
#prompt-engineering #可视化
13 个赞
支持大佬
2 个赞
再来个导入脚本,每次换号重启cursor都会丢失会话,烦
macOS没有排面呀,数据库路径不对
修bug
import platform
def get_cursor_db_path():
"""根据操作系统自动检测 Cursor 数据库路径"""
system = platform.system()
if system == 'Darwin': # macOS
return os.path.expanduser('~/Library/Application Support/Cursor/User/globalStorage/state.vscdb')
elif system == 'Windows':
# Windows: %APPDATA%\Cursor\User\globalStorage\state.vscdb
appdata = os.getenv('APPDATA')
if appdata:
return os.path.join(appdata, 'Cursor', 'User', 'globalStorage', 'state.vscdb')
else:
return os.path.expandvars(r'%APPDATA%\Cursor\User\globalStorage\state.vscdb')
else: # Linux 或其他
return os.path.expanduser('~/.config/Cursor/User/globalStorage/state.vscdb')
感谢大佬
能导入就好了,导出。换号,导入
![]()
暴露了我的安卓电脑
谢谢分享