Skip to content

sho7650/obsidian-AI-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

336 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Obsidian AI Exporter

Chrome Extension that exports AI conversations from Google Gemini, Claude AI, ChatGPT, and Perplexity to Obsidian via the Local REST API.

日本語版はこちら

License: MIT Chrome Web Store

Features

  • Multi-platform support: Export from Google Gemini, Claude AI, ChatGPT, and Perplexity
  • One-click export: Floating "Sync" button on supported AI pages
  • Multiple output options: Save to Obsidian, download as file, or copy to clipboard
  • Deep Research support: Export Gemini Deep Research, Claude Extended Thinking, and Perplexity Deep Research reports
  • Artifact support: Extract Claude Artifacts with inline citations and sources
  • Configurable timezone: Set timezone for frontmatter dates (created/modified)
  • Tool content support: Optionally include Claude's web search results and tool activity as collapsible [!ABSTRACT] callouts
  • Append mode: Only new messages are added to existing notes
  • Question headers (optional): Prepend a ## heading (first 60 chars of the question) before each user message for TOC navigation in long conversations
  • Obsidian callouts: Formatted output with [!QUESTION] and [!NOTE] callouts
  • YAML frontmatter: Metadata including title, source, URL, dates, and tags
  • Auto-scroll: Automatically loads all messages in long Gemini conversations
  • Platform-based organization: Use {platform} template in vault path for auto-sorting
  • Configurable: Customizable vault path, template options, and frontmatter fields
  • Localized: English and Japanese UI support

Requirements

Installation

From Chrome Web Store

Install from Chrome Web Store

From Source

  1. Clone this repository:

    git clone https://github.com/sho7650/obsidian-AI-exporter.git
    cd obsidian-AI-exporter
  2. Install dependencies:

    npm install
  3. Build the extension:

    npm run build
  4. Load in Chrome:

    • Navigate to chrome://extensions
    • Enable "Developer mode"
    • Click "Load unpacked"
    • Select the dist/ folder

Setup Obsidian

  1. Install the Local REST API plugin in Obsidian
  2. Enable the plugin and copy your API key
  3. Click the extension icon in Chrome and enter:
    • API Key: Your Local REST API key
    • API URL: Default is http://127.0.0.1:27123 (HTTPS is also supported — see HTTPS Setup)
    • Vault Path: Folder path in your vault (e.g., AI/{platform} to auto-organize by source)

Usage

Gemini

  1. Open a conversation on gemini.google.com
  2. Click the purple "Sync" button in the bottom-right corner
  3. The conversation will be exported based on your selected output method:
    • Obsidian (default): Saved directly to your vault via Local REST API
    • File: Downloaded as a Markdown file
    • Clipboard: Copied to clipboard for pasting anywhere

Claude

  1. Open a conversation on claude.ai
  2. Click the purple "Sync" button in the bottom-right corner
  3. The conversation will be exported with the same output options as Gemini

ChatGPT

  1. Open a conversation on chatgpt.com
  2. Click the purple "Sync" button in the bottom-right corner
  3. The conversation will be exported with the same output options as Gemini

Perplexity

  1. Open a conversation on www.perplexity.ai
  2. Click the purple "Sync" button in the bottom-right corner
  3. The conversation will be exported with the same output options as Gemini

NotebookLM

  1. Open a notebook on notebooklm.google.com
  2. Click the purple "Sync" button in the bottom-right corner
  3. The chat conversation will be exported with inline source citations as footnotes

Deep Research / Extended Thinking Export

Gemini Deep Research:

  1. Open the Deep Research panel (expanded view)
  2. Click the "Sync" button
  3. The full report will be saved with its original heading structure

Claude Extended Thinking (Artifacts):

  1. Open a conversation with an Artifact
  2. Click the "Sync" button
  3. The Artifact content with inline citations and sources will be extracted

Perplexity Deep Research:

  1. Open a Perplexity conversation containing a Deep Research report
  2. Click the "Sync" button
  3. The report content will be extracted alongside normal conversation messages

Output Format

Conversation Format

Conversations are saved as Markdown files with YAML frontmatter:

---
id: gemini_abc123
title: "How to implement authentication"
source: gemini
url: https://gemini.google.com/app/abc123
created: 2025-01-10T12:00:00Z
modified: 2025-01-10T12:30:00Z
tags:
  - ai-conversation
  - gemini
message_count: 4
---

> [!QUESTION] User
> How do I implement JWT authentication?

> [!NOTE] Gemini
> To implement JWT authentication, you'll need to...

Tool Content Format (Claude)

When "Include tool/search results" is enabled, Claude's web search and tool activity are rendered as collapsible callouts before the assistant response:

> [!ABSTRACT]- Searched the web
> Rust latest version 2026 (10 results)
> - Rust Versions | Rust Changelogs (releases.rs)
> - Rust | endoflife.date (endoflife.date)

> [!NOTE] Claude
> Here are the latest Rust version details...

The [!ABSTRACT]- callout is collapsed by default in Obsidian (the - suffix).

Deep Research Format

Deep Research reports include a type field and preserve the original structure:

---
id: gemini_deep-research-a1b2c3d4
title: "Comprehensive Analysis of..."
source: gemini
type: deep-research
url: https://gemini.google.com/app/xxx
created: 2025-01-11T10:00:00Z
modified: 2025-01-11T10:00:00Z
tags:
  - ai-research
  - deep-research
  - gemini
message_count: 1
---

# Report Title

## 1. Introduction

The report content with original headings...

## 2. Analysis

Detailed analysis sections...

Development

The dev environment is provisioned by Nix (see ADR-010). With direnv and nix-direnv installed, entering the directory loads the environment automatically; otherwise run nix develop.

Every workflow has a Nix entry point (canonical) and an npm run alias (compatibility). See ADR-011.

Workflow Nix (canonical) npm (alias)
Dev server (HMR) nix run .#dev npm run dev
Production build nix run .#build npm run build
Build + zip for store nix run .#build-zip npm run build:zip
Lint nix run .#lint npm run lint
Lint platform consistency nix run .#lint-platforms npm run lint:platforms
Format (write) nix run .#format npm run format
Format (check) nix run .#format-check npm run format:check
Test nix run .#test npm test
Test (watch) nix run .#test-watch npm run test:watch
Test with coverage nix run .#test-coverage npm run test:coverage
E2E auth setup nix run .#e2e-auth npm run e2e:auth
E2E selector validation nix run .#e2e-selectors npm run e2e:selectors
E2E selectors (headed) nix run .#e2e-selectors-headed npm run e2e:selectors:headed
CDP daemon nix run .#e2e-daemon -- <start|stop|status> npm run e2e:daemon:<sub>

Note

Nix attribute names cannot contain :, so npm script names like e2e:auth map to e2e-auth. The CDP daemon takes its subcommand as an argument: nix run .#e2e-daemon -- start.

If node_modules/ is missing, the Nix wrapper exits with an instruction to run npm ci first. Dependency installation is intentionally not auto-run.

Architecture

Content Script (gemini.google.com, claude.ai, chatgpt.com, www.perplexity.ai, notebooklm.google.com)
    ↓ extracts conversation / Deep Research / Artifacts
Background Service Worker
    ↓ sends to Obsidian
Obsidian Local REST API (default: http://127.0.0.1:27123)

Key Components

Component Description
src/content/ Content script for DOM extraction and UI
src/content/extractors/gemini.ts Gemini conversation & Deep Research extractor
src/content/extractors/claude.ts Claude conversation & Artifact extractor
src/content/extractors/chatgpt.ts ChatGPT conversation extractor
src/content/extractors/perplexity.ts Perplexity conversation extractor
src/background/ Service worker for API communication
src/popup/ Settings UI
src/lib/ Shared utilities and types

HTTPS Setup (Optional)

The extension supports HTTPS connections to the Obsidian Local REST API. This is useful when:

  • The Local REST API is configured with HTTPS (self-signed certificate)
  • You want to connect to an Obsidian instance on your local network (LAN)

macOS

  1. Extract the certificate from the running Obsidian REST API:

    openssl s_client -connect 127.0.0.1:27124 -showcerts \
      </dev/null 2>/dev/null | openssl x509 -outform PEM > obsidian-cert.pem
  2. Import into macOS Keychain as a trusted root certificate:

    sudo security add-trusted-cert -d -r trustRoot \
      -k /Library/Keychains/System.keychain obsidian-cert.pem
  3. Restart Chrome completely (Cmd+Q → relaunch). A simple tab reload is not sufficient.

  4. Set the API URL in the extension popup to your HTTPS endpoint (e.g., https://127.0.0.1:27124).

Note: If Obsidian regenerates its certificate (e.g., after a plugin update), you must re-extract and re-import the new certificate. Chrome extensions require OS-level certificate trust — browser-level "proceed anyway" exceptions do not apply to extension service workers.

Windows / Linux

Import the certificate into your OS certificate store and restart Chrome. The general approach is the same — the certificate must be trusted at the OS level, not just accepted in the browser.

Security

  • Secure storage: API key stored in chrome.storage.local (not synced)
  • Input validation: Message content and filenames validated
  • Path traversal protection: Vault paths sanitized against directory traversal attacks
  • Sender verification: Only trusted origins can send messages
  • CSP: Content Security Policy configured for extension pages
  • YAML escaping: Frontmatter values properly escaped

Privacy

This extension:

  • Does not collect or transmit your data to external servers
  • Only communicates with your Obsidian instance (default: 127.0.0.1, configurable for LAN access)
  • Stores API key locally in your browser (not synced to cloud)

See our Privacy Policy for details.

License

MIT

Contributing

Contributions are welcome! Please read the CLAUDE.md for development guidelines.

Buy Me a Coffee

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors