@caddis/cli 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/antigravity-plugin/agents/code-reviewer.md +2 -2
- package/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/scripts/enforcement_inventory.py +1 -1
- package/bundles/antigravity-plugin/scripts/oss_review.py +10 -2
- package/bundles/antigravity-plugin/skills/_registry.md +0 -1
- package/bundles/antigravity-plugin/skills/brainstorming/SKILL.md +2 -2
- package/bundles/antigravity-plugin/skills/cross-review/SKILL.md +5 -2
- package/bundles/antigravity-plugin/skills/explainer-doc/SKILL.md +1 -1
- package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +1 -1
- package/bundles/antigravity-plugin/skills/spawn-session/SKILL.md +2 -2
- package/bundles/antigravity-plugin-extras/plugin.json +1 -1
- package/bundles/antigravity-plugin-extras/skills/_registry.md +1 -19
- package/bundles/codex/.codex/skills/docs/explainer-doc/SKILL.md +1 -1
- package/bundles/codex/.codex/skills/workflow/brainstorming/SKILL.md +2 -2
- package/bundles/manifest.json +3 -3
- package/package.json +1 -1
- package/bundles/antigravity-plugin-extras/skills/competitive-ads-extractor/SKILL.md +0 -294
- package/bundles/antigravity-plugin-extras/skills/content-research-writer/SKILL.md +0 -539
- package/bundles/antigravity-plugin-extras/skills/domain-name-brainstormer/SKILL.md +0 -213
- package/bundles/antigravity-plugin-extras/skills/humanizer/SKILL.md +0 -194
- package/bundles/antigravity-plugin-extras/skills/image-enhancer/SKILL.md +0 -100
- package/bundles/antigravity-plugin-extras/skills/invoice-organizer/SKILL.md +0 -447
- package/bundles/antigravity-plugin-extras/skills/job-application/SKILL.md +0 -188
- package/bundles/antigravity-plugin-extras/skills/lead-research-assistant/SKILL.md +0 -200
- package/bundles/antigravity-plugin-extras/skills/meeting-insights-analyzer/SKILL.md +0 -328
- package/bundles/antigravity-plugin-extras/skills/notebooklm/AUTHENTICATION.md +0 -154
- package/bundles/antigravity-plugin-extras/skills/notebooklm/SKILL.md +0 -270
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/api_reference.md +0 -309
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/troubleshooting.md +0 -376
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/usage_patterns.md +0 -338
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/__init__.py +0 -81
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/ask_question.py +0 -256
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/auth_manager.py +0 -358
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_session.py +0 -255
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_utils.py +0 -107
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/cleanup_manager.py +0 -302
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/config.py +0 -44
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/notebook_manager.py +0 -410
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/run.py +0 -102
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/setup_environment.py +0 -204
- package/bundles/antigravity-plugin-extras/skills/onboard-project/SKILL.md +0 -192
- package/bundles/antigravity-plugin-extras/skills/pipeline-state/SKILL.md +0 -208
- package/bundles/antigravity-plugin-extras/skills/raffle-winner-picker/SKILL.md +0 -159
- package/bundles/antigravity-plugin-extras/skills/relay/SKILL.md +0 -246
- package/bundles/antigravity-plugin-extras/skills/requesting-code-review/SKILL.md +0 -105
- package/bundles/antigravity-plugin-extras/skills/requesting-code-review/code-reviewer.md +0 -146
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/LICENSE.txt +0 -202
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/SKILL.md +0 -646
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/color_palettes.py +0 -302
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/easing.py +0 -230
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/frame_composer.py +0 -469
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/gif_builder.py +0 -246
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/typography.py +0 -357
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/validators.py +0 -264
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/visual_effects.py +0 -494
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/requirements.txt +0 -4
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/bounce.py +0 -106
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/explode.py +0 -331
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/fade.py +0 -329
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/flip.py +0 -291
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/kaleidoscope.py +0 -211
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/morph.py +0 -329
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/move.py +0 -293
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/pulse.py +0 -268
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/shake.py +0 -127
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/slide.py +0 -291
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/spin.py +0 -269
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/wiggle.py +0 -300
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/zoom.py +0 -312
- package/bundles/antigravity-plugin-extras/skills/state-tracking/SKILL.md +0 -131
- package/bundles/antigravity-plugin-extras/skills/video-downloader/SKILL.md +0 -107
- package/bundles/antigravity-plugin-extras/skills/youtube-transcript/SKILL.md +0 -416
- package/bundles/codex/.codex/skills/workflow/golden-plan/SKILL.md +0 -586
- /package/bundles/{antigravity-plugin → antigravity-plugin-extras}/skills/golden-plan/SKILL.md +0 -0
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: notebooklm
|
|
3
|
-
context: fork
|
|
4
|
-
description: Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# NotebookLM Research Assistant Skill
|
|
8
|
-
|
|
9
|
-
Interact with Google NotebookLM to query documentation with Gemini's source-grounded answers. Each question opens a fresh browser session, retrieves the answer exclusively from your uploaded documents, and closes.
|
|
10
|
-
|
|
11
|
-
## When to Use This Skill
|
|
12
|
-
|
|
13
|
-
Trigger when user:
|
|
14
|
-
- Mentions NotebookLM explicitly
|
|
15
|
-
- Shares NotebookLM URL (`https://notebooklm.google.com/notebook/...`)
|
|
16
|
-
- Asks to query their notebooks/documentation
|
|
17
|
-
- Wants to add documentation to NotebookLM library
|
|
18
|
-
- Uses phrases like "ask my NotebookLM", "check my docs", "query my notebook"
|
|
19
|
-
|
|
20
|
-
## ⚠️ CRITICAL: Add Command - Smart Discovery
|
|
21
|
-
|
|
22
|
-
When user wants to add a notebook without providing details:
|
|
23
|
-
|
|
24
|
-
**SMART ADD (Recommended)**: Query the notebook first to discover its content:
|
|
25
|
-
```bash
|
|
26
|
-
# Step 1: Query the notebook about its content
|
|
27
|
-
python scripts/run.py ask_question.py --question "What is the content of this notebook? What topics are covered? Provide a complete overview briefly and concisely" --notebook-url "[URL]"
|
|
28
|
-
|
|
29
|
-
# Step 2: Use the discovered information to add it
|
|
30
|
-
python scripts/run.py notebook_manager.py add --url "[URL]" --name "[Based on content]" --description "[Based on content]" --topics "[Based on content]"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**MANUAL ADD**: If user provides all details:
|
|
34
|
-
- `--url` - The NotebookLM URL
|
|
35
|
-
- `--name` - A descriptive name
|
|
36
|
-
- `--description` - What the notebook contains (REQUIRED!)
|
|
37
|
-
- `--topics` - Comma-separated topics (REQUIRED!)
|
|
38
|
-
|
|
39
|
-
NEVER guess or use generic descriptions! If details missing, use Smart Add to discover them.
|
|
40
|
-
|
|
41
|
-
## Critical: Always Use run.py Wrapper
|
|
42
|
-
|
|
43
|
-
**NEVER call scripts directly. ALWAYS use `python scripts/run.py [script]`:**
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
# ✅ CORRECT - Always use run.py:
|
|
47
|
-
python scripts/run.py auth_manager.py status
|
|
48
|
-
python scripts/run.py notebook_manager.py list
|
|
49
|
-
python scripts/run.py ask_question.py --question "..."
|
|
50
|
-
|
|
51
|
-
# ❌ WRONG - Never call directly:
|
|
52
|
-
python scripts/auth_manager.py status # Fails without venv!
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
The `run.py` wrapper automatically:
|
|
56
|
-
1. Creates `.venv` if needed
|
|
57
|
-
2. Installs all dependencies
|
|
58
|
-
3. Activates environment
|
|
59
|
-
4. Executes script properly
|
|
60
|
-
|
|
61
|
-
## Core Workflow
|
|
62
|
-
|
|
63
|
-
### Step 1: Check Authentication Status
|
|
64
|
-
```bash
|
|
65
|
-
python scripts/run.py auth_manager.py status
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
If not authenticated, proceed to setup.
|
|
69
|
-
|
|
70
|
-
### Step 2: Authenticate (One-Time Setup)
|
|
71
|
-
```bash
|
|
72
|
-
# Browser MUST be visible for manual Google login
|
|
73
|
-
python scripts/run.py auth_manager.py setup
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
**Important:**
|
|
77
|
-
- Browser is VISIBLE for authentication
|
|
78
|
-
- Browser window opens automatically
|
|
79
|
-
- User must manually log in to Google
|
|
80
|
-
- Tell user: "A browser window will open for Google login"
|
|
81
|
-
|
|
82
|
-
### Step 3: Manage Notebook Library
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
# List all notebooks
|
|
86
|
-
python scripts/run.py notebook_manager.py list
|
|
87
|
-
|
|
88
|
-
# BEFORE ADDING: Ask user for metadata if unknown!
|
|
89
|
-
# "What does this notebook contain?"
|
|
90
|
-
# "What topics should I tag it with?"
|
|
91
|
-
|
|
92
|
-
# Add notebook to library (ALL parameters are REQUIRED!)
|
|
93
|
-
python scripts/run.py notebook_manager.py add \
|
|
94
|
-
--url "https://notebooklm.google.com/notebook/..." \
|
|
95
|
-
--name "Descriptive Name" \
|
|
96
|
-
--description "What this notebook contains" \ # REQUIRED - ASK USER IF UNKNOWN!
|
|
97
|
-
--topics "topic1,topic2,topic3" # REQUIRED - ASK USER IF UNKNOWN!
|
|
98
|
-
|
|
99
|
-
# Search notebooks by topic
|
|
100
|
-
python scripts/run.py notebook_manager.py search --query "keyword"
|
|
101
|
-
|
|
102
|
-
# Set active notebook
|
|
103
|
-
python scripts/run.py notebook_manager.py activate --id notebook-id
|
|
104
|
-
|
|
105
|
-
# Remove notebook
|
|
106
|
-
python scripts/run.py notebook_manager.py remove --id notebook-id
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Quick Workflow
|
|
110
|
-
1. Check library: `python scripts/run.py notebook_manager.py list`
|
|
111
|
-
2. Ask question: `python scripts/run.py ask_question.py --question "..." --notebook-id ID`
|
|
112
|
-
|
|
113
|
-
### Step 4: Ask Questions
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
# Basic query (uses active notebook if set)
|
|
117
|
-
python scripts/run.py ask_question.py --question "Your question here"
|
|
118
|
-
|
|
119
|
-
# Query specific notebook
|
|
120
|
-
python scripts/run.py ask_question.py --question "..." --notebook-id notebook-id
|
|
121
|
-
|
|
122
|
-
# Query with notebook URL directly
|
|
123
|
-
python scripts/run.py ask_question.py --question "..." --notebook-url "https://..."
|
|
124
|
-
|
|
125
|
-
# Show browser for debugging
|
|
126
|
-
python scripts/run.py ask_question.py --question "..." --show-browser
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## Follow-Up Mechanism (CRITICAL)
|
|
130
|
-
|
|
131
|
-
Every NotebookLM answer ends with: **"EXTREMELY IMPORTANT: Is that ALL you need to know?"**
|
|
132
|
-
|
|
133
|
-
**Required Claude Behavior:**
|
|
134
|
-
1. **STOP** - Do not immediately respond to user
|
|
135
|
-
2. **ANALYZE** - Compare answer to user's original request
|
|
136
|
-
3. **IDENTIFY GAPS** - Determine if more information needed
|
|
137
|
-
4. **ASK FOLLOW-UP** - If gaps exist, immediately ask:
|
|
138
|
-
```bash
|
|
139
|
-
python scripts/run.py ask_question.py --question "Follow-up with context..."
|
|
140
|
-
```
|
|
141
|
-
5. **REPEAT** - Continue until information is complete
|
|
142
|
-
6. **SYNTHESIZE** - Combine all answers before responding to user
|
|
143
|
-
|
|
144
|
-
## Script Reference
|
|
145
|
-
|
|
146
|
-
### Authentication Management (`auth_manager.py`)
|
|
147
|
-
```bash
|
|
148
|
-
python scripts/run.py auth_manager.py setup # Initial setup (browser visible)
|
|
149
|
-
python scripts/run.py auth_manager.py status # Check authentication
|
|
150
|
-
python scripts/run.py auth_manager.py reauth # Re-authenticate (browser visible)
|
|
151
|
-
python scripts/run.py auth_manager.py clear # Clear authentication
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Notebook Management (`notebook_manager.py`)
|
|
155
|
-
```bash
|
|
156
|
-
python scripts/run.py notebook_manager.py add --url URL --name NAME --description DESC --topics TOPICS
|
|
157
|
-
python scripts/run.py notebook_manager.py list
|
|
158
|
-
python scripts/run.py notebook_manager.py search --query QUERY
|
|
159
|
-
python scripts/run.py notebook_manager.py activate --id ID
|
|
160
|
-
python scripts/run.py notebook_manager.py remove --id ID
|
|
161
|
-
python scripts/run.py notebook_manager.py stats
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Question Interface (`ask_question.py`)
|
|
165
|
-
```bash
|
|
166
|
-
python scripts/run.py ask_question.py --question "..." [--notebook-id ID] [--notebook-url URL] [--show-browser]
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Data Cleanup (`cleanup_manager.py`)
|
|
170
|
-
```bash
|
|
171
|
-
python scripts/run.py cleanup_manager.py # Preview cleanup
|
|
172
|
-
python scripts/run.py cleanup_manager.py --confirm # Execute cleanup
|
|
173
|
-
python scripts/run.py cleanup_manager.py --preserve-library # Keep notebooks
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
## Environment Management
|
|
177
|
-
|
|
178
|
-
The virtual environment is automatically managed:
|
|
179
|
-
- First run creates `.venv` automatically
|
|
180
|
-
- Dependencies install automatically
|
|
181
|
-
- Chromium browser installs automatically
|
|
182
|
-
- Everything isolated in skill directory
|
|
183
|
-
|
|
184
|
-
Manual setup (only if automatic fails):
|
|
185
|
-
```bash
|
|
186
|
-
python -m venv .venv
|
|
187
|
-
source .venv/bin/activate # Linux/Mac
|
|
188
|
-
pip install -r requirements.txt
|
|
189
|
-
python -m patchright install chromium
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## Data Storage
|
|
193
|
-
|
|
194
|
-
All data stored in `~/.claude/skills/notebooklm/data/`:
|
|
195
|
-
- `library.json` - Notebook metadata
|
|
196
|
-
- `auth_info.json` - Authentication status
|
|
197
|
-
- `browser_state/` - Browser cookies and session
|
|
198
|
-
|
|
199
|
-
**Security:** Protected by `.gitignore`, never commit to git.
|
|
200
|
-
|
|
201
|
-
## Configuration
|
|
202
|
-
|
|
203
|
-
Optional `.env` file in skill directory:
|
|
204
|
-
```env
|
|
205
|
-
HEADLESS=false # Browser visibility
|
|
206
|
-
SHOW_BROWSER=false # Default browser display
|
|
207
|
-
STEALTH_ENABLED=true # Human-like behavior
|
|
208
|
-
TYPING_WPM_MIN=160 # Typing speed
|
|
209
|
-
TYPING_WPM_MAX=240
|
|
210
|
-
DEFAULT_NOTEBOOK_ID= # Default notebook
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
## Decision Flow
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
User mentions NotebookLM
|
|
217
|
-
↓
|
|
218
|
-
Check auth → python scripts/run.py auth_manager.py status
|
|
219
|
-
↓
|
|
220
|
-
If not authenticated → python scripts/run.py auth_manager.py setup
|
|
221
|
-
↓
|
|
222
|
-
Check/Add notebook → python scripts/run.py notebook_manager.py list/add (with --description)
|
|
223
|
-
↓
|
|
224
|
-
Activate notebook → python scripts/run.py notebook_manager.py activate --id ID
|
|
225
|
-
↓
|
|
226
|
-
Ask question → python scripts/run.py ask_question.py --question "..."
|
|
227
|
-
↓
|
|
228
|
-
See "Is that ALL you need?" → Ask follow-ups until complete
|
|
229
|
-
↓
|
|
230
|
-
Synthesize and respond to user
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
## Troubleshooting
|
|
234
|
-
|
|
235
|
-
| Problem | Solution |
|
|
236
|
-
|---------|----------|
|
|
237
|
-
| ModuleNotFoundError | Use `run.py` wrapper |
|
|
238
|
-
| Authentication fails | Browser must be visible for setup! --show-browser |
|
|
239
|
-
| Rate limit (50/day) | Wait or switch Google account |
|
|
240
|
-
| Browser crashes | `python scripts/run.py cleanup_manager.py --preserve-library` |
|
|
241
|
-
| Notebook not found | Check with `notebook_manager.py list` |
|
|
242
|
-
|
|
243
|
-
## Best Practices
|
|
244
|
-
|
|
245
|
-
1. **Always use run.py** - Handles environment automatically
|
|
246
|
-
2. **Check auth first** - Before any operations
|
|
247
|
-
3. **Follow-up questions** - Don't stop at first answer
|
|
248
|
-
4. **Browser visible for auth** - Required for manual login
|
|
249
|
-
5. **Include context** - Each question is independent
|
|
250
|
-
6. **Synthesize answers** - Combine multiple responses
|
|
251
|
-
|
|
252
|
-
## Limitations
|
|
253
|
-
|
|
254
|
-
- No session persistence (each question = new browser)
|
|
255
|
-
- Rate limits on free Google accounts (50 queries/day)
|
|
256
|
-
- Manual upload required (user must add docs to NotebookLM)
|
|
257
|
-
- Browser overhead (few seconds per question)
|
|
258
|
-
|
|
259
|
-
## Resources (Skill Structure)
|
|
260
|
-
|
|
261
|
-
**Important directories and files:**
|
|
262
|
-
|
|
263
|
-
- `scripts/` - All automation scripts (ask_question.py, notebook_manager.py, etc.)
|
|
264
|
-
- `data/` - Local storage for authentication and notebook library
|
|
265
|
-
- `references/` - Extended documentation:
|
|
266
|
-
- `api_reference.md` - Detailed API documentation for all scripts
|
|
267
|
-
- `troubleshooting.md` - Common issues and solutions
|
|
268
|
-
- `usage_patterns.md` - Best practices and workflow examples
|
|
269
|
-
- `.venv/` - Isolated Python environment (auto-created on first run)
|
|
270
|
-
- `.gitignore` - Protects sensitive data from being committed
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
# NotebookLM Skill API Reference
|
|
2
|
-
|
|
3
|
-
Complete API documentation for all NotebookLM skill modules.
|
|
4
|
-
|
|
5
|
-
## Important: Always Use run.py Wrapper
|
|
6
|
-
|
|
7
|
-
**All commands must use the `run.py` wrapper to ensure proper environment:**
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# ✅ CORRECT:
|
|
11
|
-
python scripts/run.py [script_name].py [arguments]
|
|
12
|
-
|
|
13
|
-
# ❌ WRONG:
|
|
14
|
-
python scripts/[script_name].py [arguments] # Will fail without venv!
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Core Scripts
|
|
18
|
-
|
|
19
|
-
### ask_question.py
|
|
20
|
-
Query NotebookLM with automated browser interaction.
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
# Basic usage
|
|
24
|
-
python scripts/run.py ask_question.py --question "Your question"
|
|
25
|
-
|
|
26
|
-
# With specific notebook
|
|
27
|
-
python scripts/run.py ask_question.py --question "..." --notebook-id notebook-id
|
|
28
|
-
|
|
29
|
-
# With direct URL
|
|
30
|
-
python scripts/run.py ask_question.py --question "..." --notebook-url "https://..."
|
|
31
|
-
|
|
32
|
-
# Show browser (debugging)
|
|
33
|
-
python scripts/run.py ask_question.py --question "..." --show-browser
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**Parameters:**
|
|
37
|
-
- `--question` (required): Question to ask
|
|
38
|
-
- `--notebook-id`: Use notebook from library
|
|
39
|
-
- `--notebook-url`: Use URL directly
|
|
40
|
-
- `--show-browser`: Make browser visible
|
|
41
|
-
|
|
42
|
-
**Returns:** Answer text with follow-up prompt appended
|
|
43
|
-
|
|
44
|
-
### notebook_manager.py
|
|
45
|
-
Manage notebook library with CRUD operations.
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
# Smart Add (discover content first)
|
|
49
|
-
python scripts/run.py ask_question.py --question "What is the content of this notebook? What topics are covered? Provide a complete overview briefly and concisely" --notebook-url "[URL]"
|
|
50
|
-
# Then add with discovered info
|
|
51
|
-
python scripts/run.py notebook_manager.py add \
|
|
52
|
-
--url "https://notebooklm.google.com/notebook/..." \
|
|
53
|
-
--name "Name" \
|
|
54
|
-
--description "Description" \
|
|
55
|
-
--topics "topic1,topic2"
|
|
56
|
-
|
|
57
|
-
# Direct add (when you know the content)
|
|
58
|
-
python scripts/run.py notebook_manager.py add \
|
|
59
|
-
--url "https://notebooklm.google.com/notebook/..." \
|
|
60
|
-
--name "Name" \
|
|
61
|
-
--description "What it contains" \
|
|
62
|
-
--topics "topic1,topic2"
|
|
63
|
-
|
|
64
|
-
# List notebooks
|
|
65
|
-
python scripts/run.py notebook_manager.py list
|
|
66
|
-
|
|
67
|
-
# Search notebooks
|
|
68
|
-
python scripts/run.py notebook_manager.py search --query "keyword"
|
|
69
|
-
|
|
70
|
-
# Activate notebook
|
|
71
|
-
python scripts/run.py notebook_manager.py activate --id notebook-id
|
|
72
|
-
|
|
73
|
-
# Remove notebook
|
|
74
|
-
python scripts/run.py notebook_manager.py remove --id notebook-id
|
|
75
|
-
|
|
76
|
-
# Show statistics
|
|
77
|
-
python scripts/run.py notebook_manager.py stats
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**Commands:**
|
|
81
|
-
- `add`: Add notebook (requires --url, --name, --topics)
|
|
82
|
-
- `list`: Show all notebooks
|
|
83
|
-
- `search`: Find notebooks by keyword
|
|
84
|
-
- `activate`: Set default notebook
|
|
85
|
-
- `remove`: Delete from library
|
|
86
|
-
- `stats`: Display library statistics
|
|
87
|
-
|
|
88
|
-
### auth_manager.py
|
|
89
|
-
Handle Google authentication and browser state.
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
# Setup (browser visible for login)
|
|
93
|
-
python scripts/run.py auth_manager.py setup
|
|
94
|
-
|
|
95
|
-
# Check status
|
|
96
|
-
python scripts/run.py auth_manager.py status
|
|
97
|
-
|
|
98
|
-
# Re-authenticate
|
|
99
|
-
python scripts/run.py auth_manager.py reauth
|
|
100
|
-
|
|
101
|
-
# Clear authentication
|
|
102
|
-
python scripts/run.py auth_manager.py clear
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
**Commands:**
|
|
106
|
-
- `setup`: Initial authentication (browser MUST be visible)
|
|
107
|
-
- `status`: Check if authenticated
|
|
108
|
-
- `reauth`: Clear and re-setup
|
|
109
|
-
- `clear`: Remove all auth data
|
|
110
|
-
|
|
111
|
-
### cleanup_manager.py
|
|
112
|
-
Clean skill data with preservation options.
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
# Preview cleanup
|
|
116
|
-
python scripts/run.py cleanup_manager.py
|
|
117
|
-
|
|
118
|
-
# Execute cleanup
|
|
119
|
-
python scripts/run.py cleanup_manager.py --confirm
|
|
120
|
-
|
|
121
|
-
# Keep library
|
|
122
|
-
python scripts/run.py cleanup_manager.py --confirm --preserve-library
|
|
123
|
-
|
|
124
|
-
# Force without prompt
|
|
125
|
-
python scripts/run.py cleanup_manager.py --confirm --force
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**Options:**
|
|
129
|
-
- `--confirm`: Actually perform cleanup
|
|
130
|
-
- `--preserve-library`: Keep notebook library
|
|
131
|
-
- `--force`: Skip confirmation prompt
|
|
132
|
-
|
|
133
|
-
### run.py
|
|
134
|
-
Script wrapper that handles environment setup.
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# Usage
|
|
138
|
-
python scripts/run.py [script_name].py [arguments]
|
|
139
|
-
|
|
140
|
-
# Examples
|
|
141
|
-
python scripts/run.py auth_manager.py status
|
|
142
|
-
python scripts/run.py ask_question.py --question "..."
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
**Automatic actions:**
|
|
146
|
-
1. Creates `.venv` if missing
|
|
147
|
-
2. Installs dependencies
|
|
148
|
-
3. Activates environment
|
|
149
|
-
4. Executes target script
|
|
150
|
-
|
|
151
|
-
## Python API Usage
|
|
152
|
-
|
|
153
|
-
### Using subprocess with run.py
|
|
154
|
-
|
|
155
|
-
```python
|
|
156
|
-
import subprocess
|
|
157
|
-
import json
|
|
158
|
-
|
|
159
|
-
# Always use run.py wrapper
|
|
160
|
-
result = subprocess.run([
|
|
161
|
-
"python", "scripts/run.py", "ask_question.py",
|
|
162
|
-
"--question", "Your question",
|
|
163
|
-
"--notebook-id", "notebook-id"
|
|
164
|
-
], capture_output=True, text=True)
|
|
165
|
-
|
|
166
|
-
answer = result.stdout
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Direct imports (after venv exists)
|
|
170
|
-
|
|
171
|
-
```python
|
|
172
|
-
# Only works if venv is already created and activated
|
|
173
|
-
from notebook_manager import NotebookLibrary
|
|
174
|
-
from auth_manager import AuthManager
|
|
175
|
-
|
|
176
|
-
library = NotebookLibrary()
|
|
177
|
-
notebooks = library.list_notebooks()
|
|
178
|
-
|
|
179
|
-
auth = AuthManager()
|
|
180
|
-
is_auth = auth.is_authenticated()
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
## Data Storage
|
|
184
|
-
|
|
185
|
-
Location: `~/.claude/skills/notebooklm/data/`
|
|
186
|
-
|
|
187
|
-
```
|
|
188
|
-
data/
|
|
189
|
-
├── library.json # Notebook metadata
|
|
190
|
-
├── auth_info.json # Auth status
|
|
191
|
-
└── browser_state/ # Browser cookies
|
|
192
|
-
└── state.json
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
**Security:** Protected by `.gitignore`, never commit.
|
|
196
|
-
|
|
197
|
-
## Environment Variables
|
|
198
|
-
|
|
199
|
-
Optional `.env` file configuration:
|
|
200
|
-
|
|
201
|
-
```env
|
|
202
|
-
HEADLESS=false # Browser visibility
|
|
203
|
-
SHOW_BROWSER=false # Default display
|
|
204
|
-
STEALTH_ENABLED=true # Human behavior
|
|
205
|
-
TYPING_WPM_MIN=160 # Typing speed
|
|
206
|
-
TYPING_WPM_MAX=240
|
|
207
|
-
DEFAULT_NOTEBOOK_ID= # Default notebook
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
## Error Handling
|
|
211
|
-
|
|
212
|
-
Common patterns:
|
|
213
|
-
|
|
214
|
-
```python
|
|
215
|
-
# Using run.py prevents most errors
|
|
216
|
-
result = subprocess.run([
|
|
217
|
-
"python", "scripts/run.py", "ask_question.py",
|
|
218
|
-
"--question", "Question"
|
|
219
|
-
], capture_output=True, text=True)
|
|
220
|
-
|
|
221
|
-
if result.returncode != 0:
|
|
222
|
-
error = result.stderr
|
|
223
|
-
if "rate limit" in error.lower():
|
|
224
|
-
# Wait or switch accounts
|
|
225
|
-
pass
|
|
226
|
-
elif "not authenticated" in error.lower():
|
|
227
|
-
# Run auth setup
|
|
228
|
-
subprocess.run(["python", "scripts/run.py", "auth_manager.py", "setup"])
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
## Rate Limits
|
|
232
|
-
|
|
233
|
-
Free Google accounts: 50 queries/day
|
|
234
|
-
|
|
235
|
-
Solutions:
|
|
236
|
-
1. Wait for reset (midnight PST)
|
|
237
|
-
2. Switch accounts with `reauth`
|
|
238
|
-
3. Use multiple Google accounts
|
|
239
|
-
|
|
240
|
-
## Advanced Patterns
|
|
241
|
-
|
|
242
|
-
### Parallel Queries
|
|
243
|
-
|
|
244
|
-
```python
|
|
245
|
-
import concurrent.futures
|
|
246
|
-
import subprocess
|
|
247
|
-
|
|
248
|
-
def query(question, notebook_id):
|
|
249
|
-
result = subprocess.run([
|
|
250
|
-
"python", "scripts/run.py", "ask_question.py",
|
|
251
|
-
"--question", question,
|
|
252
|
-
"--notebook-id", notebook_id
|
|
253
|
-
], capture_output=True, text=True)
|
|
254
|
-
return result.stdout
|
|
255
|
-
|
|
256
|
-
# Run multiple queries simultaneously
|
|
257
|
-
with concurrent.futures.ThreadPoolExecutor(max_workers=3) as executor:
|
|
258
|
-
futures = [
|
|
259
|
-
executor.submit(query, q, nb)
|
|
260
|
-
for q, nb in zip(questions, notebooks)
|
|
261
|
-
]
|
|
262
|
-
results = [f.result() for f in futures]
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### Batch Processing
|
|
266
|
-
|
|
267
|
-
```python
|
|
268
|
-
def batch_research(questions, notebook_id):
|
|
269
|
-
results = []
|
|
270
|
-
for question in questions:
|
|
271
|
-
result = subprocess.run([
|
|
272
|
-
"python", "scripts/run.py", "ask_question.py",
|
|
273
|
-
"--question", question,
|
|
274
|
-
"--notebook-id", notebook_id
|
|
275
|
-
], capture_output=True, text=True)
|
|
276
|
-
results.append(result.stdout)
|
|
277
|
-
time.sleep(2) # Avoid rate limits
|
|
278
|
-
return results
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
## Module Classes
|
|
282
|
-
|
|
283
|
-
### NotebookLibrary
|
|
284
|
-
- `add_notebook(url, name, topics)`
|
|
285
|
-
- `list_notebooks()`
|
|
286
|
-
- `search_notebooks(query)`
|
|
287
|
-
- `get_notebook(notebook_id)`
|
|
288
|
-
- `activate_notebook(notebook_id)`
|
|
289
|
-
- `remove_notebook(notebook_id)`
|
|
290
|
-
|
|
291
|
-
### AuthManager
|
|
292
|
-
- `is_authenticated()`
|
|
293
|
-
- `setup_auth(headless=False)`
|
|
294
|
-
- `get_auth_info()`
|
|
295
|
-
- `clear_auth()`
|
|
296
|
-
- `validate_auth()`
|
|
297
|
-
|
|
298
|
-
### BrowserSession (internal)
|
|
299
|
-
- Handles browser automation
|
|
300
|
-
- Manages stealth behavior
|
|
301
|
-
- Not intended for direct use
|
|
302
|
-
|
|
303
|
-
## Best Practices
|
|
304
|
-
|
|
305
|
-
1. **Always use run.py** - Ensures environment
|
|
306
|
-
2. **Check auth first** - Before operations
|
|
307
|
-
3. **Handle rate limits** - Implement retries
|
|
308
|
-
4. **Include context** - Questions are independent
|
|
309
|
-
5. **Clean sessions** - Use cleanup_manager
|