Introduction
"View, search, and export your AI conversations in various formats."
This is Part 47 of the "One Open Source Project a Day" series. Today's project is Cursor Chat Browser (GitHub).
When using the Cursor editor for AI programming, have you encountered these problems: wanting to review previous conversations but can't find them? Wanting to search for solutions to technical problems but don't know where to start? Wanting to export chat history to share with your team but don't know how? Cursor Chat Browser is a web application for browsing and managing chat histories from the Cursor editor's AI chat feature, supporting viewing, searching, and exporting your AI conversations in Markdown, HTML, PDF and other formats, making it easy to manage and review your conversation history with AI.
Why it matters:
- 🔍 Browse and Search: Browse all workspaces with Cursor chat history, full-text search functionality
- 🌐 Multi-Storage Support: Support for both workspace-specific and global storage (newer Cursor versions)
- 🤖 Dual Logs: Support for both AI chat logs and Composer logs
- 📁 Workspace Organization: Organize chats by workspace
- 📱 Responsive Design: Support for dark/light mode, mobile-friendly
- ⬇️ Multi-Format Export: Support for Markdown, HTML (syntax highlighting), PDF export
- 🎨 Syntax Highlighting: Syntax-highlighted code blocks
- 📌 Bookmarkable URLs: Support for bookmarkable chat URLs
What You'll Learn
- Core features and capabilities of Cursor Chat Browser
- Storage mechanism of Cursor editor chat history
- How to browse, search, and export chat records
- Cross-platform path auto-detection mechanism
- Next.js + TypeScript + Tailwind CSS tech stack practices
- SQLite database reading and parsing
Prerequisites
- Basic understanding of Cursor editor usage
- Basic understanding of web application development
- Understanding of Next.js framework (optional)
- Basic understanding of SQLite databases (optional)
Project Background
Project Overview
Cursor Chat Browser is a web application for browsing and managing chat histories from the Cursor editor's AI chat feature. It solves the problem that the Cursor editor itself cannot conveniently browse, search, and export chat history, enabling developers to better manage and review conversations with AI.
Core Features:
- Browse Functionality: Browse chat history from all workspaces
- Search Functionality: Full-text search with chat type filtering
- Export Functionality: Support for Markdown, HTML, PDF formats
- Multi-Storage Support: Compatible with old and new Cursor storage formats
- Dual Logs: Support for both AI chat and Composer logs
- Auto-Detection: Automatically detects Cursor workspace storage paths
- Responsive Design: Support for dark/light mode, mobile-friendly
Core Problems Solved:
- Cursor editor cannot conveniently browse historical chat records
- Cannot search previous conversation content
- Cannot export chat records for sharing or backup
- Chat records scattered across multiple workspaces, difficult to manage uniformly
- New Cursor versions changed storage format, requiring compatibility
Target Users:
- Developers using Cursor editor for AI programming
- Users who need to review and organize AI conversation history
- Developers who need to export chat records to share with teams
- Users who need to backup important conversations
- Developers who want to better manage AI programming conversations
Author/Team Introduction
- Author: Thomas Pedersen (GitHub)
- Background: Open source developer, focused on developing practical tools
- Philosophy: Enable developers to better manage and utilize AI conversation history
- Community: 500+ stars, 87+ forks, active community support
Project Statistics
- ⭐ GitHub Stars: 500+
- 🍴 Forks: 87+
- 📦 Version: Continuously updated (32+ commits)
- 📄 License: MIT
- 🌐 Repository: github.com/thomas-pedersen/cursor-chat-browser
- 🐛 Issues: GitHub Issues
Tech Stack:
- Framework: Next.js 14 (App Router)
- Language: TypeScript (93.7%)
- Styling: Tailwind CSS (6.0%)
- UI Components: shadcn/ui
- Database: SQLite (reading Cursor chat database)
- Node.js: 18+
Key Features:
- Support for Windows, macOS, Linux, WSL2
- Automatic detection of Cursor workspace storage paths
- Support for old and new Cursor storage formats
- Responsive design with dark/light mode support
Main Features
Core Purpose
Cursor Chat Browser's core purpose is to provide a web interface for browsing, searching, and managing Cursor editor's AI chat history, enabling developers to:
- Browse History: View chat records from all workspaces
- Search Conversations: Full-text search across all chat content
- Export Records: Export as Markdown, HTML, PDF formats
- Organize Management: Organize chat records by workspace
- Type Distinction: Distinguish between AI chat and Composer logs
- Cross-Platform: Support for Windows, macOS, Linux, WSL2
Use Cases
-
Review Conversation History
- Find previously solved technical problems
- Review code suggestions from AI
- View previous error solutions
-
Knowledge Organization
- Export important conversations as documents
- Organize technical problems and solutions
- Create knowledge base
-
Team Sharing
- Export chat records to share with team members
- Save AI conversations as documents
- Create technical documentation
-
Backup Management
- Backup important AI conversations
- Sync chat history across devices
- Version control chat records
-
Search and Analysis
- Search for solutions to specific technical problems
- Analyze AI conversation patterns
- Find code examples
Quick Start
Installation:
# Clone repository
git clone https://github.com/thomas-pedersen/cursor-chat-browser.git
cd cursor-chat-browser
# Install dependencies
npm install
# Start development server
npm run devAccess:
- Open browser and visit: http://localhost:3000
Configuration:
The application automatically detects Cursor workspace storage paths:
- Windows:
%APPDATA%\Cursor\User\workspaceStorage - WSL2:
/mnt/c/Users/<USERNAME>/AppData/Roaming/Cursor/User/workspaceStorage - macOS:
~/Library/Application Support/Cursor/User/workspaceStorage - Linux:
~/.config/Cursor/User/workspaceStorage - Linux (remote/SSH):
~/.cursor-server/data/User/workspaceStorage
If auto-detection fails, you can manually set the path in the Configuration page (⚙️).
Note: Recent versions of Cursor have moved chat data storage from workspace-specific locations to global storage. This application now supports both storage methods to ensure compatibility with all Cursor versions.
Core Features
-
Browse Functionality
- View chat history from all workspaces
- Organize chat records by workspace
- Browse AI chat logs and Composer logs
- Navigate between different chat tabs within a workspace
- View combined logs with type indicators
- Display chat and Composer counts per workspace
-
Search Functionality
- Use search bar in navigation to search across all logs
- Filter results by chat logs, Composer logs, or both
- Search results show:
- Type badge (Chat/Composer)
- Matching text snippets
- Workspace location
- Title
- Timestamp
-
Export Functionality
- Markdown: Plain text format with code blocks
- HTML: Styled document with syntax highlighting
- PDF: Formatted document suitable for sharing
-
Multi-Storage Support
- Support for workspace-specific storage (old versions)
- Support for global storage (new Cursor versions)
- Automatic storage location detection
- Compatible with all Cursor versions
-
Dual Log Support
- AI chat logs
- Composer logs
- Type distinction and filtering
- Combined view
-
User Experience
- Responsive design
- Dark/light mode support
- Syntax-highlighted code blocks
- Bookmarkable chat URLs
- Automatic workspace path detection
Project Advantages
| Comparison Item | Cursor Chat Browser | Cursor Editor Built-in | Manual Export |
|---|---|---|---|
| Browse History | ✅ Web interface, easy to browse | ⚠️ Current session only | ❌ Not supported |
| Search Function | ✅ Full-text search with filtering | ❌ Not supported | ❌ Manual search required |
| Export Formats | ✅ Markdown, HTML, PDF | ❌ Not supported | ⚠️ Manual copy required |
| Multi-Workspace | ✅ Unified management of all workspaces | ⚠️ Scattered across workspaces | ⚠️ Process individually |
| Type Distinction | ✅ Distinguish Chat and Composer | ⚠️ Manual distinction required | ❌ Not supported |
| Cross-Platform | ✅ Windows, macOS, Linux | ✅ Cross-platform | ✅ Cross-platform |
| Syntax Highlighting | ✅ Code block syntax highlighting | ✅ Supported | ❌ Manual processing required |
| Backup Management | ✅ Export backup | ⚠️ Manual file copy required | ⚠️ Manual operation required |
Why Choose Cursor Chat Browser?
- Convenient Browsing: Web interface, easy to browse and search historical conversations
- Multi-Format Export: Support for Markdown, HTML, PDF, meeting different needs
- Full-Text Search: Quickly find needed conversation content
- Unified Management: Unified management of chat records from all workspaces
- Auto-Detection: Automatically detects Cursor storage paths, no manual configuration needed
- Open Source Free: MIT license, completely free to use
Detailed Project Analysis
Architecture Design
Cursor Chat Browser adopts Next.js 14 App Router architecture, developed with TypeScript, reading Cursor's chat database through SQLite.
Core Components:
Cursor Chat Browser
├── Next.js 14 (App Router)
│ ├── Page Routing
│ ├── Server Components
│ └── Client Components
├── SQLite Database Reading
│ ├── Read state.vscdb files
│ ├── Parse chat records
│ └── Parse Composer logs
├── UI Components (shadcn/ui)
│ ├── Navigation Bar
│ ├── Search Bar
│ ├── Chat List
│ └── Export Functionality
└── Styling System (Tailwind CSS)
├── Responsive Design
└── Dark/Light ModeDesign Philosophy:
- Simple and Easy: Web interface, no complex configuration
- Auto-Detection: Automatically detects Cursor storage paths
- Compatibility: Supports old and new Cursor storage formats
- Responsive: Support for desktop and mobile
- Extensible: Based on Next.js, easy to extend functionality
Cursor Storage Mechanism
The Cursor editor stores chat history in SQLite databases (state.vscdb files).
Storage Locations:
- Windows:
%APPDATA%\Cursor\User\workspaceStorage\<workspace-id>\state.vscdb - macOS:
~/Library/Application Support/Cursor/User/workspaceStorage/<workspace-id>/state.vscdb - Linux:
~/.config/Cursor/User/workspaceStorage/<workspace-id>/state.vscdb
New Version Changes:
- Old Versions: Each workspace has independent
state.vscdbfile - New Versions (v44.9+): Uses global storage, chat data centrally managed
Database Structure:
-- Simplified database structure
CREATE TABLE ItemTable (
key TEXT PRIMARY KEY,
value TEXT -- JSON format chat data
);Path Auto-Detection
The application automatically detects Cursor storage paths for different platforms:
Detection Logic:
// Pseudo-code example
function detectCursorPath(): string {
const platform = process.platform;
switch (platform) {
case 'win32':
return path.join(process.env.APPDATA, 'Cursor/User/workspaceStorage');
case 'darwin':
return path.join(os.homedir(), 'Library/Application Support/Cursor/User/workspaceStorage');
case 'linux':
// Check if WSL2
if (isWSL2()) {
return `/mnt/c/Users/${username}/AppData/Roaming/Cursor/User/workspaceStorage`;
}
return path.join(os.homedir(), '.config/Cursor/User/workspaceStorage');
default:
throw new Error('Unsupported platform');
}
}Manual Configuration:
If auto-detection fails, users can manually set the path in the configuration page:
- Click configuration icon (⚙️)
- Enter Cursor workspace storage path
- Save configuration
Search Functionality Implementation
Search functionality supports full-text search and type filtering:
Search Flow:
1. User enters search keywords
↓
2. Scan all workspace state.vscdb files
↓
3. Parse chat records and Composer logs
↓
4. Full-text search matching content
↓
5. Filter by type (Chat/Composer/All)
↓
6. Display search resultsSearch Results Display:
- Type badge (Chat/Composer)
- Matching text snippets (highlighted)
- Workspace location
- Title
- Timestamp
Export Functionality
Supports three export formats:
Markdown Export:
# Chat Title
## User
User message content
## Assistant
AI reply content
```code
Code block content
**HTML Export:**
- Styled HTML document
- Code block syntax highlighting (using highlight.js or similar)
- Responsive design
- Printable format
**PDF Export:**
- Using browser print functionality or PDF library
- Formatted document
- Suitable for sharing and archiving
**Export Implementation:**
```typescript
// Pseudo-code example
async function exportChat(chatId: string, format: 'md' | 'html' | 'pdf') {
const chat = await loadChat(chatId);
switch (format) {
case 'md':
return exportAsMarkdown(chat);
case 'html':
return exportAsHTML(chat);
case 'pdf':
return exportAsPDF(chat);
}
}Tech Stack Details
Next.js 14 App Router:
- Uses latest App Router architecture
- Mix of server components and client components
- File system routing
- Server-side data fetching
TypeScript:
- Type safety
- Better development experience
- Code hints and error checking
Tailwind CSS:
- Utility-first CSS framework
- Rapid development
- Responsive design
- Dark mode support
shadcn/ui:
- Component library based on Radix UI
- Accessibility support
- Customizable styles
- Rich components
SQLite:
- Uses
better-sqlite3or similar library to read database - Lightweight, no additional service needed
- Directly reads Cursor's database files
Compatibility Handling
The project needs to handle differences between old and new Cursor storage formats:
Old Version (Workspace-Specific Storage):
workspaceStorage/
├── workspace-id-1/
│ └── state.vscdb
├── workspace-id-2/
│ └── state.vscdb
└── ...New Version (Global Storage):
User/
├── workspaceStorage/
│ └── (old format)
└── globalStorage/
└── (new format)Compatibility Strategy:
- Check both storage locations simultaneously
- Prefer new format
- Fall back to old format if new format doesn't exist
- Unified data model handles both formats
Project Links and Resources
Official Resources
- 🌟 GitHub: github.com/thomas-pedersen/cursor-chat-browser
- 🐛 Issue Tracker: GitHub Issues
- 💬 Pull Requests: GitHub PRs
- 📝 Changelog: CHANGELOG.md
Target Audience
- Cursor Users: Developers using Cursor editor for AI programming
- Knowledge Management: Users who need to organize and review AI conversation history
- Team Collaboration: Teams who need to export and share chat records
- Backup Needs: Users who need to backup important conversations
- Web Developers: Developers learning Next.js + TypeScript + Tailwind CSS
Welcome to my homepage to find more useful knowledge and interesting products