#vibecoded
Find a file
2026-03-08 02:01:02 +01:00
lib feat: add ChatGPT conversation extractor 2026-03-07 02:23:46 +01:00
.editorconfig Initial commit 2026-03-07 01:39:34 +01:00
.eslintrc.json Initial commit 2026-03-07 01:39:34 +01:00
.gitignore feat: add ChatGPT conversation extractor 2026-03-07 02:23:46 +01:00
.htaccess Initial commit 2026-03-07 01:39:34 +01:00
.prettierrc Initial commit 2026-03-07 01:39:34 +01:00
.stylelintrc.json Initial commit 2026-03-07 01:39:34 +01:00
AGENTS.md feat: add ChatGPT conversation extractor 2026-03-07 02:23:46 +01:00
index.html feat: enhance conversation navigation and URL fragment management 2026-03-07 21:45:42 +01:00
index.js feat: add ChatGPT conversation extractor 2026-03-07 02:23:46 +01:00
make-stat.js feat: add optional statistics generation and dashboard to README 2026-03-08 02:00:11 +01:00
metrics.md feat: add optional statistics generation and dashboard to README 2026-03-08 02:00:11 +01:00
README.md docs: add image to README for statistics viewer 2026-03-08 02:01:02 +01:00
search.php feat: implement search functionality for conversations with title and content modes 2026-03-07 14:45:31 +01:00
update-category.php feat: add category selection and update functionality for conversations 2026-03-07 16:29:08 +01:00
view-stat.html feat: add optional statistics generation and dashboard to README 2026-03-08 02:00:11 +01:00

ChatGPT History Archiver

Offline archive and viewer for your ChatGPT conversation history.

Quick Start

1. Capture Conversations

  1. Navigate to chatgpt.com
  2. Open browser DevTools (F12 or right-click → Inspect)
  3. Switch to the Network tab
  4. Browse through your conversations in ChatGPT (click each one to load it)
  5. Click on Export HAR icon (resembles a download icon)
  6. Save the HAR file to the data/ directory in this project

Tip: Repeat this process for different conversation categories or time periods.

2. Extract Conversations

Run the extraction script:

node index.js

This will:

  • Process all HAR files in data/
  • Extract conversation data (title, timestamps, messages)
  • Generate output/metadata.json with conversation index
  • Save individual conversations to output/conversations/{id}.json

3. View Your Archive

Option A: Static Hosting (Basic Features)

Open index.html directly or deploy to any static host (GitHub Pages, Netlify, etc.):

# Open directly in browser
open index.html

# Or serve locally
npx serve .

Available features:

  • Tree navigation by category
  • Title-based search
  • Markdown rendering
  • Conversation viewing
  • Metadata display

Option B: PHP Server (Full Features)

Serve with PHP to enable advanced features:

# Using PHP built-in server
php -S localhost:8000

# Or deploy to any PHP-enabled host (Apache, nginx + PHP-FPM)

Additional features with PHP:

  • Content Search: Full-text search through all message content
  • Category Editing: Change conversation categories with automatic backups

Features

Core Features (Always Available)

  • Tree Navigation: Conversations organized by category
  • Title Search: Filter conversations by title, ID, or category
  • Markdown Support: Properly rendered code blocks, lists, and formatting
  • Role-Based Styling: Color-coded messages (user/assistant/system)
  • Metadata Display: Timestamps, model info, and referenced URLs
  • Deep Links: Click conversation IDs to open in ChatGPT

PHP-Only Features

  • Content Search: Search through all message text across conversations
  • Category Management: Edit conversation categories with dropdown selector
    • Change existing categories
    • Create new categories
    • Automatic timestamped backups before changes

Requirements

  • Node.js (for extraction script)
  • Modern web browser (for viewer)
  • PHP 7.0+ (optional, for advanced features)

File Structure

├── data/                        # Place HAR files here
├── output/
│   ├── metadata.json            # Conversation index
│   ├── metadata.backup.*.json   # Automatic backups (PHP feature)
│   └── conversations/           # Individual conversation files
├── lib/
│   ├── parser.js                # HAR parsing logic
│   └── metadata.js              # Metadata management
├── index.js                     # Extraction script
├── index.html                   # Conversation viewer
├── make-stat.js                 # Statistics generation (optional)
├── view-stat.html               # Statistics dashboard (optional)
├── search.php                   # Content search endpoint (requires PHP)
└── update-category.php          # Category update endpoint (requires PHP)

Bonus: Statistics Dashboard

If you're curious about your ChatGPT usage patterns, there's an optional statistics viewer with visual charts.

Generate Statistics

node make-stat.js

This analyzes all conversations and generates output/stats.json with metrics including:

  • Volume & activity (message counts, conversation distribution)
  • Length metrics (character/word counts, longest/shortest conversations)
  • Temporal patterns (activity over time, hourly/daily trends)
  • Linguistic analysis (questions, code blocks, sentences)
  • Interaction dynamics (prompt types, turn counts)
  • Sentiment indicators (emojis, politeness, hedging language)
  • Model usage breakdown

View Statistics

Open view-stat.html in your browser:

# Static (works without server)
open view-stat.html

# Or with server
php -S localhost:8000
# Then navigate to http://localhost:8000/view-stat.html

The dashboard includes interactive charts:

  • Message distribution by role (doughnut chart)
  • Conversation/message length histograms
  • Activity timeline (messages over time)
  • Hourly and weekly activity patterns
  • Prompt type breakdown
  • Sentiment indicators comparison
  • Model usage distribution

All charts are powered by Chart.js and match the dark theme of the main viewer.


Notes

  • HAR files contain full conversation data including messages and metadata
  • The script handles both plain JSON and base64-encoded responses
  • Duplicate conversations (across multiple HAR files) are deduplicated by most recent update time
  • Only conversation endpoints (/backend-api/conversation/{id}) are extracted
  • The viewer automatically detects PHP availability and enables/disables features accordingly
  • Category updates create timestamped backups to prevent data loss