summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"