Skip to content

Comments

Add end-to-end auto-sync with Google Drive integration#10

Open
lmanchu wants to merge 1 commit intoPleasePrompto:masterfrom
lmanchu:feature/auto-sync
Open

Add end-to-end auto-sync with Google Drive integration#10
lmanchu wants to merge 1 commit intoPleasePrompto:masterfrom
lmanchu:feature/auto-sync

Conversation

@lmanchu
Copy link

@lmanchu lmanchu commented Dec 26, 2025

Summary

This PR adds a complete end-to-end automation pipeline for syncing local documents to NotebookLM through Google Drive.

New Features

  • Auto-sync to Google Drive (sync-to-drive.js) - Node.js script using Google APIs to sync local folders to Drive
  • Browser automation (add_sources.py) - Patchright-based automation to add Drive files as NotebookLM sources
  • End-to-end orchestration (auto_sync.py) - Python script that combines both steps with state tracking
  • Configuration file (sync-config.json.example) - Sample config for setting up sync mappings

Architecture

Local Files → Google Drive → NotebookLM
     ↑            ↑              ↑
sync-to-drive.js  │      add_sources.py
                  │
           auto_sync.py (orchestrates both)

Usage

# Full sync (Drive + NotebookLM)
python scripts/auto_sync.py --config sync-config.json

# Individual commands
node scripts/sync-to-drive.js --local ~/docs --drive "MyFolder"
python scripts/add_sources.py --notebook-url "https://..." --drive-folder "MyFolder"

Technical Changes

  • browser_utils.py: Made Chrome channel optional for Chromium compatibility
  • Added scripts/package.json for Node.js googleapis dependency
  • Updated .gitignore for node_modules and local config files
  • Updated SKILL.md with auto-sync documentation

Test Plan

  • Tested sync-to-drive.js with multiple file types (.md, .pdf)
  • Tested add_sources.py browser automation on NotebookLM
  • Verified end-to-end flow with auto_sync.py
  • Confirmed state tracking prevents duplicate syncs

🤖 Generated with Claude Code

Features:
- Auto-sync local files to Google Drive (sync-to-drive.js)
- Browser automation to add sources to NotebookLM (add_sources.py)
- End-to-end orchestration script (auto_sync.py)
- Sync state tracking - only processes new/modified files
- Sample configuration file (sync-config.json.example)
- Updated skill.md with auto-sync documentation

Technical changes:
- browser_utils.py: Comment out Chrome channel for Chromium compatibility
- Added Node.js package.json for googleapis dependency
- Updated .gitignore for node_modules and local config

Usage:
  notebooklm-sync              # Full sync (Drive + NotebookLM)
  notebooklm-sync --drive-only # Sync to Drive only

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant