From 71c05b65c952cb4b33294de0d0534f2892f7febf Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 9 Jun 2025 23:02:20 +0300 Subject: extract chat history from Cursor AI --- extractcursor.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 extractcursor.rb diff --git a/extractcursor.rb b/extractcursor.rb new file mode 100644 index 0000000..86ea0b2 --- /dev/null +++ b/extractcursor.rb @@ -0,0 +1,15 @@ +require 'sqlite3' + +db_path = File.expand_path('~/.config/Cursor/User/globalStorage/state.vscdb') # Adjust if needed +table = 'cursorDiskKV' + +db = SQLite3::Database.new(db_path) +columns = db.execute("PRAGMA table_info(#{table});").map { |col| col[1] } +rows = db.execute("SELECT * FROM #{table};") + +File.open('cursor_chat_history.txt', 'w') do |file| + file.puts columns.join("\t") + rows.each { |row| file.puts row.join("\t") } +end + +puts "Exported #{rows.size} rows from #{table} to cursor_chat_history.txt" -- cgit v1.2.3