Skip to content

OthmanAdi/AI-Docs-Copier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Docs Copier

Transform any documentation into AI-friendly formats with one click.

A powerful browser extension that detects documentation websites and provides instant export to AI-optimized formats including Markdown, llms.txt, and plain text. Seamlessly integrates with ChatGPT, Claude, Cursor, and VS Code.


🎯 What It Does

AI Docs Copier solves a daily pain point for developers: copying documentation into AI tools for analysis and questions. Instead of manually copying, formatting, and cleaning up docs, this extension:

  • Automatically detects documentation sites using intelligent multi-strategy detection
  • Extracts clean content using Mozilla's Readability algorithm with smart fallbacks
  • Converts to AI-friendly formats including Markdown, llms.txt, and plain text
  • Opens directly in AI platforms like ChatGPT and Claude with pre-filled prompts
  • Integrates with IDEs via Cursor and VS Code deeplinks

✨ Features

Smart Documentation Detection

Uses 5 detection strategies to identify documentation sites:

  • Meta tag platform detection (Docusaurus, Sphinx, GitBook, MkDocs, Jekyll, Hugo)
  • URL pattern analysis (/docs/, /api/, /guide/, etc.)
  • DOM structure recognition (sidebars, TOCs, navigation patterns)
  • Content analysis (headings and titles)
  • llms.txt file presence detection

Multiple Export Formats

  • Markdown: Clean, LLM-ready markdown with proper formatting
  • llms.txt: Structured index format for AI consumption (following llmstxt.org spec)
  • Plain Text: Simple text extraction for lightweight use

AI Platform Integration

  • ChatGPT: One-click open with GPT-4o and pre-filled context
  • Claude: Direct integration with pre-filled prompts
  • Cursor IDE: Deeplink support for immediate editing
  • VS Code: Deeplink integration for developer workflows

Content Extraction Pipeline

  1. Primary: Mozilla Readability.js for article/documentation extraction
  2. Fallback: CSS selector matching for 15+ documentation platforms
  3. Ultimate Fallback: Sanitized body content extraction
  4. Security: All content sanitized with DOMPurify

Trial & Subscription System

  • 2-day free trial (no payment required)
  • Subscription management via chrome.storage.sync
  • Access control for premium features
  • Upgrade prompts with clear pricing

πŸ—οΈ Architecture

Tech Stack

  • Framework: React 19 + TypeScript
  • Build Tool: Vite 6 with Turborepo monorepo
  • Styling: Tailwind CSS 3
  • Browser: Manifest V3 for Chrome/Edge/Brave/Opera
  • Content Extraction: @mozilla/readability + DOMPurify
  • Markdown Conversion: Turndown.js with GFM plugin

Project Structure

ai-docs-copier/
β”œβ”€β”€ chrome-extension/          # Extension manifest and background scripts
β”‚   β”œβ”€β”€ manifest.ts            # Manifest V3 configuration
β”‚   └── src/background/        # Service worker
β”œβ”€β”€ pages/                     # Extension pages
β”‚   β”œβ”€β”€ content-ui/            # Floating button and export menu
β”‚   β”œβ”€β”€ popup/                 # Extension popup
β”‚   └── options/               # Settings page
β”œβ”€β”€ packages/                  # Shared packages
β”‚   β”œβ”€β”€ shared/                # Core business logic
β”‚   β”‚   β”œβ”€β”€ lib/ai-integrations.ts
β”‚   β”‚   β”œβ”€β”€ lib/content-extractor.ts
β”‚   β”‚   β”œβ”€β”€ lib/docs-detector.ts
β”‚   β”‚   β”œβ”€β”€ lib/markdown-converter.ts
β”‚   β”‚   β”œβ”€β”€ lib/llms-txt-generator.ts
β”‚   β”‚   β”œβ”€β”€ lib/mcp-registry.ts
β”‚   β”‚   └── lib/subscription.ts
β”‚   β”œβ”€β”€ storage/               # Chrome storage helpers
β”‚   β”œβ”€β”€ ui/                    # Shared UI components
β”‚   └── hmr/                   # Hot module reload
└── dist/                      # Built extension (load in browser)

πŸš€ Getting Started

Prerequisites

  • Node.js >= 22.15.1
  • pnpm 10.11.0 (install with npm install -g pnpm)
  • Chrome, Edge, Brave, or any Chromium-based browser

Installation

  1. Clone the repository

    git clone https://github.com/OthmanAdi/ai-docs-copier.git
    cd ai-docs-copier
  2. Install dependencies

    pnpm install
  3. Run development build

    pnpm dev
  4. Load in browser

    • Open Chrome and navigate to chrome://extensions
    • Enable "Developer mode" (toggle in top right)
    • Click "Load unpacked"
    • Select the dist directory from this project

Production Build

pnpm build        # For Chrome/Edge
pnpm build:firefox # For Firefox

Create Distribution Package

pnpm zip          # Creates extension-YYYYMMDD-HHmmss.zip in dist-zip/

🎨 Usage

  1. Navigate to any documentation site (e.g., docs.langchain.com, react.dev, docs.python.org)
  2. Click the floating "Copy for AI" button that appears in the bottom right
  3. Choose your export option:
    • Copy as Markdown/llms.txt/Plain Text
    • Open directly in ChatGPT or Claude
  4. Or right-click anywhere on the page and use the "AI Docs Copier" context menu

πŸ› οΈ Development

Install dependencies for specific modules

# For root
pnpm i <package> -w

# For specific module
pnpm i <package> -F <module-name>

Update extension version

pnpm update-version 1.2.0

Environment Variables

See packages/env/README.md for environment variable configuration.

Module Management

Enable/disable extension features:

pnpm module-manager

πŸ“¦ Core Dependencies

  • @mozilla/readability - Content extraction engine
  • turndown - HTML to Markdown conversion
  • turndown-plugin-gfm - GitHub Flavored Markdown support
  • dompurify - HTML sanitization
  • react - UI framework
  • tailwindcss - Styling

πŸ—ΊοΈ Roadmap

Current Status: MVP Complete βœ…

  • Smart documentation detection
  • Multi-format export (Markdown, llms.txt, plain text)
  • AI platform integration (ChatGPT, Claude)
  • Floating UI with export menu
  • Context menu integration
  • Trial system implementation

Planned Features

  • Preview dialog before copying
  • Copy history explorer
  • MCP server installation UI
  • Cloud library with AI organization
  • User accounts and cross-device sync
  • Custom export templates
  • Firefox and Safari support

πŸ’Ό Business Model

This project is open source with a dual licensing approach:

  • Free Version: Open source repository for developers and community
  • Paid Version: Chrome Web Store with 2-day free trial, then monthly/yearly subscription

This model builds trust through transparency while sustaining development.


🀝 Contributing

Contributions are welcome! This is an early-stage project, and we're open to:

  • Bug reports and fixes
  • Feature suggestions
  • Documentation improvements
  • Code quality enhancements

Please open an issue first to discuss major changes.


πŸ“„ License

MIT License - See LICENSE file for details.



πŸ‘¨β€πŸ’» About the Author

Ahmad Othman Ammar Adi (Othman Adi)

Full Stack Developer, AI Agents Orchestrator, and passionate educator from Hama, Syria β€” now based in Berlin, Germany.

  • πŸŽ“ Education: Completed apprenticeship in Computer Science
  • πŸ‘¨β€πŸ« Teaching: 8,000+ documented teaching lectures since 2020
  • πŸ“š Formats: Workshops (days to weeks), intensive courses (2-6 months), and long-term programs including multi-year weekend coding classes for kids
  • πŸ’Ό Current Role: AI Agents Orchestrator at migRaven

Connect:


Made with ❀️ for developers who live in documentation

About

Transform any documentation into AI-friendly formats with one click

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published