# NotebookLM for Codex Query Google Gemini Notebook (formerly NotebookLM) directly from local OpenAI Codex. The skill uses a local Chrome session to return source-grounded answers from your own notebooks, discover notebooks by title, and manage a lightweight local library. > This project is an independent community integration. It is not affiliated with, endorsed by, or sponsored by Google or OpenAI. ## Features - Query a notebook by URL or local library ID - Find notebooks by title on your authenticated Gemini Notebook home page - Preserve source references returned by Gemini Notebook - Ask independent follow-up questions and synthesize grounded results - Preserve conversational context across queries and Codex restarts - Add local files, Google Drive files, web or YouTube URLs, and pasted text as notebook sources - Persist Google authentication locally between Codex sessions - Manage notebook links, descriptions, topics, and an active notebook locally - Support both `notebook.google.com` and legacy `notebooklm.google.com` links - Automatically create an isolated Python environment and install Patchright/Chrome support - Avoid returning a stale response that was already present in the notebook chat ## Requirements - Local Codex desktop or CLI - Python 3.9 or newer - A graphical environment where Chrome can open - A Google account with access to Gemini Notebook This skill is not designed for remote or fully headless Codex environments where manual Google login is impossible. ## Install ```bash mkdir -p ~/.codex/skills git clone https://github.com/Jockeys97/notebooklm-codex-skill.git ~/.codex/skills/notebooklm-codex ``` Restart Codex after installation. The skill can then be invoked explicitly as `$notebooklm-codex` or selected automatically when a request mentions NotebookLM, Gemini Notebook, or a notebook URL. ## First-time authentication Ask Codex: ```text Use $notebooklm-codex to set up Gemini Notebook authentication. ``` A visible Chrome window opens. Complete Google login manually; never share your password or MFA code with the agent. The browser profile and storage state remain in the skill's ignored `data/` directory. You can also run the command yourself from the installed skill directory: ```bash python3 scripts/run.py auth_manager.py setup ``` The first run creates `.venv`, installs the pinned dependencies, and installs Chrome support for Patchright. ## Examples Ask a notebook by its visible title: ```text Use $notebooklm-codex to find my "API Documentation" notebook and explain its authentication flow. ``` Ask by URL: ```text Use $notebooklm-codex to query https://notebook.google.com/notebook/NOTEBOOK_ID and summarize the main findings with source references. ``` Compare claims through multiple independent questions: ```text Use $notebooklm-codex to identify the documented benefits, limitations, and contradictions in my research notebook. ``` Keep conversational context across related questions: ```text Use $notebooklm-codex to create a managed context session for my research notebook, then keep using it for my follow-ups. ``` ## Commands Always run scripts through the environment wrapper: ```bash python3 scripts/run.py auth_manager.py status python3 scripts/run.py auth_manager.py validate python3 scripts/run.py discover_notebooks.py --query "TITLE" python3 scripts/run.py ask_question.py --question "QUESTION" --notebook-url "URL" python3 scripts/run.py session_manager.py start --session-id "research" --notebook-url "URL" python3 scripts/run.py session_manager.py ask --session-id "research" --question "QUESTION" python3 scripts/run.py source_manager.py --notebook-url "URL" --file "/absolute/file.pdf" python3 scripts/run.py source_manager.py --notebook-url "URL" --url "https://example.com" python3 scripts/run.py source_manager.py --notebook-url "URL" --text "TEXT" python3 scripts/run.py source_manager.py --notebook-url "URL" --drive-query "FILE NAME" python3 scripts/run.py source_manager.py --notebook-url "URL" --drive-query "FILE NAME" --drive-id "ID" --confirm python3 scripts/run.py notebook_manager.py list python3 scripts/run.py notebook_manager.py search --query "TOPIC" ``` See [`SKILL.md`](SKILL.md) for agent instructions and [`references/api_reference.md`](references/api_reference.md) for the full command reference. ## Local library The library stores links and metadata; it does not create, upload, or delete notebooks in your Google account. ```bash python3 scripts/run.py notebook_manager.py add \ --url "URL" \ --name "NAME" \ --description "DESCRIPTION" \ --topics "topic1,topic2" ``` ## Security Authentication data is sensitive. Never commit or share: - `data/browser_state/` - `data/auth_info.json` - `.env` - cookies or exported browser storage These paths are excluded by `.gitignore`. Consider using a dedicated Google account for browser automation. Automated access may be affected by Google product changes, rate limits, account policies, or terms of service. ## Limitations - Browser automation still opens a fresh browser context for each managed query, but recent conversation turns are supplied automatically from an ignored local transcript. Very long conversations are truncated to a configurable context window. - Source imports remain subject to Google's account-plan, source-count, 200 MB file-size, and 500,000-word-per-source limits. Drive imports require an explicit result ID and confirmation. - Notebook discovery depends on the current Google UI and may require selector updates after product changes. - Source reference numbers are preserved when available, but direct source links may not always be extractable. - The skill does not generate Studio artifacts such as Audio Overviews, presentations, or mind maps. - Browser automation is slower and less stable than an official API. ## Credits This Codex adaptation is based on [PleasePrompto/notebooklm-skill](https://github.com/PleasePrompto/notebooklm-skill), originally built for Claude Code. The original Python automation is used and modified under the MIT License. Codex-specific changes include native skill metadata, Gemini Notebook's current domain, title-based notebook discovery, durable managed context sessions, local and Google Drive source imports, safer credential-handling instructions, and correct detection of newly generated answers. ## License MIT. See [`LICENSE`](LICENSE). The original copyright and permission notice are preserved.