summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-09 23:02:20 +0300
committerPaul Buetow <paul@buetow.org>2025-06-09 23:02:20 +0300
commit71c05b65c952cb4b33294de0d0534f2892f7febf (patch)
treed4edb417e6be74f4ff16a381e788313dc2d8679b
parenta9cc643802628f9219a959a7e5a6dfdd5de68063 (diff)
extract chat history from Cursor AIHEADmaster
-rw-r--r--extractcursor.rb15
1 files changed, 15 insertions, 0 deletions
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"