@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.
Files changed (74) hide show
  1. package/bundles/antigravity-plugin/agents/code-reviewer.md +2 -2
  2. package/bundles/antigravity-plugin/plugin.json +1 -1
  3. package/bundles/antigravity-plugin/scripts/enforcement_inventory.py +1 -1
  4. package/bundles/antigravity-plugin/scripts/oss_review.py +10 -2
  5. package/bundles/antigravity-plugin/skills/_registry.md +0 -1
  6. package/bundles/antigravity-plugin/skills/brainstorming/SKILL.md +2 -2
  7. package/bundles/antigravity-plugin/skills/cross-review/SKILL.md +5 -2
  8. package/bundles/antigravity-plugin/skills/explainer-doc/SKILL.md +1 -1
  9. package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +1 -1
  10. package/bundles/antigravity-plugin/skills/spawn-session/SKILL.md +2 -2
  11. package/bundles/antigravity-plugin-extras/plugin.json +1 -1
  12. package/bundles/antigravity-plugin-extras/skills/_registry.md +1 -19
  13. package/bundles/codex/.codex/skills/docs/explainer-doc/SKILL.md +1 -1
  14. package/bundles/codex/.codex/skills/workflow/brainstorming/SKILL.md +2 -2
  15. package/bundles/manifest.json +3 -3
  16. package/package.json +1 -1
  17. package/bundles/antigravity-plugin-extras/skills/competitive-ads-extractor/SKILL.md +0 -294
  18. package/bundles/antigravity-plugin-extras/skills/content-research-writer/SKILL.md +0 -539
  19. package/bundles/antigravity-plugin-extras/skills/domain-name-brainstormer/SKILL.md +0 -213
  20. package/bundles/antigravity-plugin-extras/skills/humanizer/SKILL.md +0 -194
  21. package/bundles/antigravity-plugin-extras/skills/image-enhancer/SKILL.md +0 -100
  22. package/bundles/antigravity-plugin-extras/skills/invoice-organizer/SKILL.md +0 -447
  23. package/bundles/antigravity-plugin-extras/skills/job-application/SKILL.md +0 -188
  24. package/bundles/antigravity-plugin-extras/skills/lead-research-assistant/SKILL.md +0 -200
  25. package/bundles/antigravity-plugin-extras/skills/meeting-insights-analyzer/SKILL.md +0 -328
  26. package/bundles/antigravity-plugin-extras/skills/notebooklm/AUTHENTICATION.md +0 -154
  27. package/bundles/antigravity-plugin-extras/skills/notebooklm/SKILL.md +0 -270
  28. package/bundles/antigravity-plugin-extras/skills/notebooklm/references/api_reference.md +0 -309
  29. package/bundles/antigravity-plugin-extras/skills/notebooklm/references/troubleshooting.md +0 -376
  30. package/bundles/antigravity-plugin-extras/skills/notebooklm/references/usage_patterns.md +0 -338
  31. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/__init__.py +0 -81
  32. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/ask_question.py +0 -256
  33. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/auth_manager.py +0 -358
  34. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_session.py +0 -255
  35. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_utils.py +0 -107
  36. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/cleanup_manager.py +0 -302
  37. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/config.py +0 -44
  38. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/notebook_manager.py +0 -410
  39. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/run.py +0 -102
  40. package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/setup_environment.py +0 -204
  41. package/bundles/antigravity-plugin-extras/skills/onboard-project/SKILL.md +0 -192
  42. package/bundles/antigravity-plugin-extras/skills/pipeline-state/SKILL.md +0 -208
  43. package/bundles/antigravity-plugin-extras/skills/raffle-winner-picker/SKILL.md +0 -159
  44. package/bundles/antigravity-plugin-extras/skills/relay/SKILL.md +0 -246
  45. package/bundles/antigravity-plugin-extras/skills/requesting-code-review/SKILL.md +0 -105
  46. package/bundles/antigravity-plugin-extras/skills/requesting-code-review/code-reviewer.md +0 -146
  47. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/LICENSE.txt +0 -202
  48. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/SKILL.md +0 -646
  49. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/color_palettes.py +0 -302
  50. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/easing.py +0 -230
  51. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/frame_composer.py +0 -469
  52. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/gif_builder.py +0 -246
  53. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/typography.py +0 -357
  54. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/validators.py +0 -264
  55. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/visual_effects.py +0 -494
  56. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/requirements.txt +0 -4
  57. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/bounce.py +0 -106
  58. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/explode.py +0 -331
  59. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/fade.py +0 -329
  60. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/flip.py +0 -291
  61. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/kaleidoscope.py +0 -211
  62. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/morph.py +0 -329
  63. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/move.py +0 -293
  64. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/pulse.py +0 -268
  65. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/shake.py +0 -127
  66. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/slide.py +0 -291
  67. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/spin.py +0 -269
  68. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/wiggle.py +0 -300
  69. package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/zoom.py +0 -312
  70. package/bundles/antigravity-plugin-extras/skills/state-tracking/SKILL.md +0 -131
  71. package/bundles/antigravity-plugin-extras/skills/video-downloader/SKILL.md +0 -107
  72. package/bundles/antigravity-plugin-extras/skills/youtube-transcript/SKILL.md +0 -416
  73. package/bundles/codex/.codex/skills/workflow/golden-plan/SKILL.md +0 -586
  74. /package/bundles/{antigravity-plugin → antigravity-plugin-extras}/skills/golden-plan/SKILL.md +0 -0
@@ -1,376 +0,0 @@
1
- # NotebookLM Skill Troubleshooting Guide
2
-
3
- ## Quick Fix Table
4
-
5
- | Error | Solution |
6
- |-------|----------|
7
- | ModuleNotFoundError | Use `python scripts/run.py [script].py` |
8
- | Authentication failed | Browser must be visible for setup |
9
- | Browser crash | `python scripts/run.py cleanup_manager.py --preserve-library` |
10
- | Rate limit hit | Wait 1 hour or switch accounts |
11
- | Notebook not found | `python scripts/run.py notebook_manager.py list` |
12
- | Script not working | Always use run.py wrapper |
13
-
14
- ## Critical: Always Use run.py
15
-
16
- Most issues are solved by using the run.py wrapper:
17
-
18
- ```bash
19
- # ✅ CORRECT - Always:
20
- python scripts/run.py auth_manager.py status
21
- python scripts/run.py ask_question.py --question "..."
22
-
23
- # ❌ WRONG - Never:
24
- python scripts/auth_manager.py status # ModuleNotFoundError!
25
- ```
26
-
27
- ## Common Issues and Solutions
28
-
29
- ### Authentication Issues
30
-
31
- #### Not authenticated error
32
- ```
33
- Error: Not authenticated. Please run auth setup first.
34
- ```
35
-
36
- **Solution:**
37
- ```bash
38
- # Check status
39
- python scripts/run.py auth_manager.py status
40
-
41
- # Setup authentication (browser MUST be visible!)
42
- python scripts/run.py auth_manager.py setup
43
- # User must manually log in to Google
44
-
45
- # If setup fails, try re-authentication
46
- python scripts/run.py auth_manager.py reauth
47
- ```
48
-
49
- #### Authentication expires frequently
50
- **Solution:**
51
- ```bash
52
- # Clear old authentication
53
- python scripts/run.py cleanup_manager.py --preserve-library
54
-
55
- # Fresh authentication setup
56
- python scripts/run.py auth_manager.py setup --timeout 15
57
-
58
- # Use persistent browser profile
59
- export PERSIST_AUTH=true
60
- ```
61
-
62
- #### Google blocks automated login
63
- **Solution:**
64
- 1. Use dedicated Google account for automation
65
- 2. Enable "Less secure app access" if available
66
- 3. ALWAYS use visible browser:
67
- ```bash
68
- python scripts/run.py auth_manager.py setup
69
- # Browser MUST be visible - user logs in manually
70
- # NO headless parameter exists - use --show-browser for debugging
71
- ```
72
-
73
- ### Browser Issues
74
-
75
- #### Browser crashes or hangs
76
- ```
77
- TimeoutError: Waiting for selector failed
78
- ```
79
-
80
- **Solution:**
81
- ```bash
82
- # Kill hanging processes
83
- pkill -f chromium
84
- pkill -f chrome
85
-
86
- # Clean browser state
87
- python scripts/run.py cleanup_manager.py --confirm --preserve-library
88
-
89
- # Re-authenticate
90
- python scripts/run.py auth_manager.py reauth
91
- ```
92
-
93
- #### Browser not found error
94
- **Solution:**
95
- ```bash
96
- # Install Chromium via run.py (automatic)
97
- python scripts/run.py auth_manager.py status
98
- # run.py will install Chromium automatically
99
-
100
- # Or manual install if needed
101
- cd ~/.claude/skills/notebooklm
102
- source .venv/bin/activate
103
- python -m patchright install chromium
104
- ```
105
-
106
- ### Rate Limiting
107
-
108
- #### Rate limit exceeded (50 queries/day)
109
- **Solutions:**
110
-
111
- **Option 1: Wait**
112
- ```bash
113
- # Check when limit resets (usually midnight PST)
114
- date -d "tomorrow 00:00 PST"
115
- ```
116
-
117
- **Option 2: Switch accounts**
118
- ```bash
119
- # Clear current auth
120
- python scripts/run.py auth_manager.py clear
121
-
122
- # Login with different account
123
- python scripts/run.py auth_manager.py setup
124
- ```
125
-
126
- **Option 3: Rotate accounts**
127
- ```python
128
- # Use multiple accounts
129
- accounts = ["account1", "account2"]
130
- for account in accounts:
131
- # Switch account on rate limit
132
- subprocess.run(["python", "scripts/run.py", "auth_manager.py", "reauth"])
133
- ```
134
-
135
- ### Notebook Access Issues
136
-
137
- #### Notebook not found
138
- **Solution:**
139
- ```bash
140
- # List all notebooks
141
- python scripts/run.py notebook_manager.py list
142
-
143
- # Search for notebook
144
- python scripts/run.py notebook_manager.py search --query "keyword"
145
-
146
- # Add notebook if missing
147
- python scripts/run.py notebook_manager.py add \
148
- --url "https://notebooklm.google.com/..." \
149
- --name "Name" \
150
- --topics "topics"
151
- ```
152
-
153
- #### Access denied to notebook
154
- **Solution:**
155
- 1. Check if notebook is still shared publicly
156
- 2. Re-add notebook with updated URL
157
- 3. Verify correct Google account is used
158
-
159
- #### Wrong notebook being used
160
- **Solution:**
161
- ```bash
162
- # Check active notebook
163
- python scripts/run.py notebook_manager.py list | grep "active"
164
-
165
- # Activate correct notebook
166
- python scripts/run.py notebook_manager.py activate --id correct-id
167
- ```
168
-
169
- ### Virtual Environment Issues
170
-
171
- #### ModuleNotFoundError
172
- ```
173
- ModuleNotFoundError: No module named 'patchright'
174
- ```
175
-
176
- **Solution:**
177
- ```bash
178
- # ALWAYS use run.py - it handles venv automatically!
179
- python scripts/run.py [any_script].py
180
-
181
- # run.py will:
182
- # 1. Create .venv if missing
183
- # 2. Install dependencies
184
- # 3. Run the script
185
- ```
186
-
187
- #### Wrong Python version
188
- **Solution:**
189
- ```bash
190
- # Check Python version (needs 3.8+)
191
- python --version
192
-
193
- # If wrong version, specify correct Python
194
- python3.8 scripts/run.py auth_manager.py status
195
- ```
196
-
197
- ### Network Issues
198
-
199
- #### Connection timeouts
200
- **Solution:**
201
- ```bash
202
- # Increase timeout
203
- export TIMEOUT_SECONDS=60
204
-
205
- # Check connectivity
206
- ping notebooklm.google.com
207
-
208
- # Use proxy if needed
209
- export HTTP_PROXY=http://proxy:port
210
- export HTTPS_PROXY=http://proxy:port
211
- ```
212
-
213
- ### Data Issues
214
-
215
- #### Corrupted notebook library
216
- ```
217
- JSON decode error when listing notebooks
218
- ```
219
-
220
- **Solution:**
221
- ```bash
222
- # Backup current library
223
- cp ~/.claude/skills/notebooklm/data/library.json library.backup.json
224
-
225
- # Reset library
226
- rm ~/.claude/skills/notebooklm/data/library.json
227
-
228
- # Re-add notebooks
229
- python scripts/run.py notebook_manager.py add --url ... --name ...
230
- ```
231
-
232
- #### Disk space full
233
- **Solution:**
234
- ```bash
235
- # Check disk usage
236
- df -h ~/.claude/skills/notebooklm/data/
237
-
238
- # Clean up
239
- python scripts/run.py cleanup_manager.py --confirm --preserve-library
240
- ```
241
-
242
- ## Debugging Techniques
243
-
244
- ### Enable verbose logging
245
- ```bash
246
- export DEBUG=true
247
- export LOG_LEVEL=DEBUG
248
- python scripts/run.py ask_question.py --question "Test" --show-browser
249
- ```
250
-
251
- ### Test individual components
252
- ```bash
253
- # Test authentication
254
- python scripts/run.py auth_manager.py status
255
-
256
- # Test notebook access
257
- python scripts/run.py notebook_manager.py list
258
-
259
- # Test browser launch
260
- python scripts/run.py ask_question.py --question "test" --show-browser
261
- ```
262
-
263
- ### Save screenshots on error
264
- Add to scripts for debugging:
265
- ```python
266
- try:
267
- # Your code
268
- except Exception as e:
269
- page.screenshot(path=f"error_{timestamp}.png")
270
- raise e
271
- ```
272
-
273
- ## Recovery Procedures
274
-
275
- ### Complete reset
276
- ```bash
277
- #!/bin/bash
278
- # Kill processes
279
- pkill -f chromium
280
-
281
- # Backup library if exists
282
- if [ -f ~/.claude/skills/notebooklm/data/library.json ]; then
283
- cp ~/.claude/skills/notebooklm/data/library.json ~/library.backup.json
284
- fi
285
-
286
- # Clean everything
287
- cd ~/.claude/skills/notebooklm
288
- python scripts/run.py cleanup_manager.py --confirm --force
289
-
290
- # Remove venv
291
- rm -rf .venv
292
-
293
- # Reinstall (run.py will handle this)
294
- python scripts/run.py auth_manager.py setup
295
-
296
- # Restore library if backup exists
297
- if [ -f ~/library.backup.json ]; then
298
- mkdir -p ~/.claude/skills/notebooklm/data/
299
- cp ~/library.backup.json ~/.claude/skills/notebooklm/data/library.json
300
- fi
301
- ```
302
-
303
- ### Partial recovery (keep data)
304
- ```bash
305
- # Keep auth and library, fix execution
306
- cd ~/.claude/skills/notebooklm
307
- rm -rf .venv
308
-
309
- # run.py will recreate venv automatically
310
- python scripts/run.py auth_manager.py status
311
- ```
312
-
313
- ## Error Messages Reference
314
-
315
- ### Authentication Errors
316
- | Error | Cause | Solution |
317
- |-------|-------|----------|
318
- | Not authenticated | No valid auth | `run.py auth_manager.py setup` |
319
- | Authentication expired | Session old | `run.py auth_manager.py reauth` |
320
- | Invalid credentials | Wrong account | Check Google account |
321
- | 2FA required | Security challenge | Complete in visible browser |
322
-
323
- ### Browser Errors
324
- | Error | Cause | Solution |
325
- |-------|-------|----------|
326
- | Browser not found | Chromium missing | Use run.py (auto-installs) |
327
- | Connection refused | Browser crashed | Kill processes, restart |
328
- | Timeout waiting | Page slow | Increase timeout |
329
- | Context closed | Browser terminated | Check logs for crashes |
330
-
331
- ### Notebook Errors
332
- | Error | Cause | Solution |
333
- |-------|-------|----------|
334
- | Notebook not found | Invalid ID | `run.py notebook_manager.py list` |
335
- | Access denied | Not shared | Re-share in NotebookLM |
336
- | Invalid URL | Wrong format | Use full NotebookLM URL |
337
- | No active notebook | None selected | `run.py notebook_manager.py activate` |
338
-
339
- ## Prevention Tips
340
-
341
- 1. **Always use run.py** - Prevents 90% of issues
342
- 2. **Regular maintenance** - Clear browser state weekly
343
- 3. **Monitor queries** - Track daily count to avoid limits
344
- 4. **Backup library** - Export notebook list regularly
345
- 5. **Use dedicated account** - Separate Google account for automation
346
-
347
- ## Getting Help
348
-
349
- ### Diagnostic information to collect
350
- ```bash
351
- # System info
352
- python --version
353
- cd ~/.claude/skills/notebooklm
354
- ls -la
355
-
356
- # Skill status
357
- python scripts/run.py auth_manager.py status
358
- python scripts/run.py notebook_manager.py list | head -5
359
-
360
- # Check data directory
361
- ls -la ~/.claude/skills/notebooklm/data/
362
- ```
363
-
364
- ### Common questions
365
-
366
- **Q: Why doesn't this work in Claude web UI?**
367
- A: Web UI has no network access. Use local Claude Code.
368
-
369
- **Q: Can I use multiple Google accounts?**
370
- A: Yes, use `run.py auth_manager.py reauth` to switch.
371
-
372
- **Q: How to increase rate limit?**
373
- A: Use multiple accounts or upgrade to Google Workspace.
374
-
375
- **Q: Is this safe for my Google account?**
376
- A: Use dedicated account for automation. Only accesses NotebookLM.
@@ -1,338 +0,0 @@
1
- # NotebookLM Skill Usage Patterns
2
-
3
- Advanced patterns for using the NotebookLM skill effectively.
4
-
5
- ## Critical: Always Use run.py
6
-
7
- **Every command must use the run.py wrapper:**
8
- ```bash
9
- # ✅ CORRECT:
10
- python scripts/run.py auth_manager.py status
11
- python scripts/run.py ask_question.py --question "..."
12
-
13
- # ❌ WRONG:
14
- python scripts/auth_manager.py status # Will fail!
15
- ```
16
-
17
- ## Pattern 1: Initial Setup
18
-
19
- ```bash
20
- # 1. Check authentication (using run.py!)
21
- python scripts/run.py auth_manager.py status
22
-
23
- # 2. If not authenticated, setup (Browser MUST be visible!)
24
- python scripts/run.py auth_manager.py setup
25
- # Tell user: "Please log in to Google in the browser window"
26
-
27
- # 3. Add first notebook - ASK USER FOR DETAILS FIRST!
28
- # Ask: "What does this notebook contain?"
29
- # Ask: "What topics should I tag it with?"
30
- python scripts/run.py notebook_manager.py add \
31
- --url "https://notebooklm.google.com/notebook/..." \
32
- --name "User provided name" \
33
- --description "User provided description" \ # NEVER GUESS!
34
- --topics "user,provided,topics" # NEVER GUESS!
35
- ```
36
-
37
- **Critical Notes:**
38
- - Virtual environment created automatically by run.py
39
- - Browser MUST be visible for authentication
40
- - ALWAYS discover content via query OR ask user for notebook metadata
41
-
42
- ## Pattern 2: Adding Notebooks (Smart Discovery!)
43
-
44
- **When user shares a NotebookLM URL:**
45
-
46
- **OPTION A: Smart Discovery (Recommended)**
47
- ```bash
48
- # 1. Query the notebook to discover its content
49
- python scripts/run.py ask_question.py \
50
- --question "What is the content of this notebook? What topics are covered? Provide a complete overview briefly and concisely" \
51
- --notebook-url "[URL]"
52
-
53
- # 2. Use discovered info to add it
54
- python scripts/run.py notebook_manager.py add \
55
- --url "[URL]" \
56
- --name "[Based on content]" \
57
- --description "[From discovery]" \
58
- --topics "[Extracted topics]"
59
- ```
60
-
61
- **OPTION B: Ask User (Fallback)**
62
- ```bash
63
- # If discovery fails, ask user:
64
- "What does this notebook contain?"
65
- "What topics does it cover?"
66
-
67
- # Then add with user-provided info:
68
- python scripts/run.py notebook_manager.py add \
69
- --url "[URL]" \
70
- --name "[User's answer]" \
71
- --description "[User's description]" \
72
- --topics "[User's topics]"
73
- ```
74
-
75
- **NEVER:**
76
- - Guess what's in a notebook
77
- - Use generic descriptions
78
- - Skip discovering content
79
-
80
- ## Pattern 3: Daily Research Workflow
81
-
82
- ```bash
83
- # Check library
84
- python scripts/run.py notebook_manager.py list
85
-
86
- # Research with comprehensive questions
87
- python scripts/run.py ask_question.py \
88
- --question "Detailed question with all context" \
89
- --notebook-id notebook-id
90
-
91
- # Follow-up when you see "Is that ALL you need to know?"
92
- python scripts/run.py ask_question.py \
93
- --question "Follow-up question with previous context"
94
- ```
95
-
96
- ## Pattern 4: Follow-Up Questions (CRITICAL!)
97
-
98
- When NotebookLM responds with "EXTREMELY IMPORTANT: Is that ALL you need to know?":
99
-
100
- ```python
101
- # 1. STOP - Don't respond to user yet
102
- # 2. ANALYZE - Is answer complete?
103
- # 3. If gaps exist, ask follow-up:
104
- python scripts/run.py ask_question.py \
105
- --question "Specific follow-up with context from previous answer"
106
-
107
- # 4. Repeat until complete
108
- # 5. Only then synthesize and respond to user
109
- ```
110
-
111
- ## Pattern 5: Multi-Notebook Research
112
-
113
- ```python
114
- # Query different notebooks for comparison
115
- python scripts/run.py notebook_manager.py activate --id notebook-1
116
- python scripts/run.py ask_question.py --question "Question"
117
-
118
- python scripts/run.py notebook_manager.py activate --id notebook-2
119
- python scripts/run.py ask_question.py --question "Same question"
120
-
121
- # Compare and synthesize answers
122
- ```
123
-
124
- ## Pattern 6: Error Recovery
125
-
126
- ```bash
127
- # If authentication fails
128
- python scripts/run.py auth_manager.py status
129
- python scripts/run.py auth_manager.py reauth # Browser visible!
130
-
131
- # If browser crashes
132
- python scripts/run.py cleanup_manager.py --preserve-library
133
- python scripts/run.py auth_manager.py setup # Browser visible!
134
-
135
- # If rate limited
136
- # Wait or switch accounts
137
- python scripts/run.py auth_manager.py reauth # Login with different account
138
- ```
139
-
140
- ## Pattern 7: Batch Processing
141
-
142
- ```bash
143
- #!/bin/bash
144
- NOTEBOOK_ID="notebook-id"
145
- QUESTIONS=(
146
- "First comprehensive question"
147
- "Second comprehensive question"
148
- "Third comprehensive question"
149
- )
150
-
151
- for question in "${QUESTIONS[@]}"; do
152
- echo "Asking: $question"
153
- python scripts/run.py ask_question.py \
154
- --question "$question" \
155
- --notebook-id "$NOTEBOOK_ID"
156
- sleep 2 # Avoid rate limits
157
- done
158
- ```
159
-
160
- ## Pattern 8: Automated Research Script
161
-
162
- ```python
163
- #!/usr/bin/env python
164
- import subprocess
165
-
166
- def research_topic(topic, notebook_id):
167
- # Comprehensive question
168
- question = f"""
169
- Explain {topic} in detail:
170
- 1. Core concepts
171
- 2. Implementation details
172
- 3. Best practices
173
- 4. Common pitfalls
174
- 5. Examples
175
- """
176
-
177
- result = subprocess.run([
178
- "python", "scripts/run.py", "ask_question.py",
179
- "--question", question,
180
- "--notebook-id", notebook_id
181
- ], capture_output=True, text=True)
182
-
183
- return result.stdout
184
- ```
185
-
186
- ## Pattern 9: Notebook Organization
187
-
188
- ```python
189
- # Organize by domain - with proper metadata
190
- # ALWAYS ask user for descriptions!
191
-
192
- # Backend notebooks
193
- add_notebook("Backend API", "Complete API documentation", "api,rest,backend")
194
- add_notebook("Database", "Schema and queries", "database,sql,backend")
195
-
196
- # Frontend notebooks
197
- add_notebook("React Docs", "React framework documentation", "react,frontend")
198
- add_notebook("CSS Framework", "Styling documentation", "css,styling,frontend")
199
-
200
- # Search by domain
201
- python scripts/run.py notebook_manager.py search --query "backend"
202
- python scripts/run.py notebook_manager.py search --query "frontend"
203
- ```
204
-
205
- ## Pattern 10: Integration with Development
206
-
207
- ```python
208
- # Query documentation during development
209
- def check_api_usage(api_endpoint):
210
- result = subprocess.run([
211
- "python", "scripts/run.py", "ask_question.py",
212
- "--question", f"Parameters and response format for {api_endpoint}",
213
- "--notebook-id", "api-docs"
214
- ], capture_output=True, text=True)
215
-
216
- # If follow-up needed
217
- if "Is that ALL you need" in result.stdout:
218
- # Ask for examples
219
- follow_up = subprocess.run([
220
- "python", "scripts/run.py", "ask_question.py",
221
- "--question", f"Show code examples for {api_endpoint}",
222
- "--notebook-id", "api-docs"
223
- ], capture_output=True, text=True)
224
-
225
- return combine_answers(result.stdout, follow_up.stdout)
226
- ```
227
-
228
- ## Best Practices
229
-
230
- ### 1. Question Formulation
231
- - Be specific and comprehensive
232
- - Include all context in each question
233
- - Request structured responses
234
- - Ask for examples when needed
235
-
236
- ### 2. Notebook Management
237
- - **ALWAYS ask user for metadata**
238
- - Use descriptive names
239
- - Add comprehensive topics
240
- - Keep URLs current
241
-
242
- ### 3. Performance
243
- - Batch related questions
244
- - Use parallel processing for different notebooks
245
- - Monitor rate limits (50/day)
246
- - Switch accounts if needed
247
-
248
- ### 4. Error Handling
249
- - Always use run.py to prevent venv issues
250
- - Check auth before operations
251
- - Implement retry logic
252
- - Have fallback notebooks ready
253
-
254
- ### 5. Security
255
- - Use dedicated Google account
256
- - Never commit data/ directory
257
- - Regularly refresh auth
258
- - Track all access
259
-
260
- ## Common Workflows for Claude
261
-
262
- ### Workflow 1: User Sends NotebookLM URL
263
-
264
- ```python
265
- # 1. Detect URL in message
266
- if "notebooklm.google.com" in user_message:
267
- url = extract_url(user_message)
268
-
269
- # 2. Check if in library
270
- notebooks = run("notebook_manager.py list")
271
-
272
- if url not in notebooks:
273
- # 3. ASK USER FOR METADATA (CRITICAL!)
274
- name = ask_user("What should I call this notebook?")
275
- description = ask_user("What does this notebook contain?")
276
- topics = ask_user("What topics does it cover?")
277
-
278
- # 4. Add with user-provided info
279
- run(f"notebook_manager.py add --url {url} --name '{name}' --description '{description}' --topics '{topics}'")
280
-
281
- # 5. Use the notebook
282
- answer = run(f"ask_question.py --question '{user_question}'")
283
- ```
284
-
285
- ### Workflow 2: Research Task
286
-
287
- ```python
288
- # 1. Understand task
289
- task = "Implement feature X"
290
-
291
- # 2. Formulate comprehensive questions
292
- questions = [
293
- "Complete implementation guide for X",
294
- "Error handling for X",
295
- "Performance considerations for X"
296
- ]
297
-
298
- # 3. Query with follow-ups
299
- for q in questions:
300
- answer = run(f"ask_question.py --question '{q}'")
301
-
302
- # Check if follow-up needed
303
- if "Is that ALL you need" in answer:
304
- # Ask more specific question
305
- follow_up = run(f"ask_question.py --question 'Specific detail about {q}'")
306
-
307
- # 4. Synthesize and implement
308
- ```
309
-
310
- ## Tips and Tricks
311
-
312
- 1. **Always use run.py** - Prevents all venv issues
313
- 2. **Ask for metadata** - Never guess notebook contents
314
- 3. **Use verbose questions** - Include all context
315
- 4. **Follow up automatically** - When you see the prompt
316
- 5. **Monitor rate limits** - 50 queries per day
317
- 6. **Batch operations** - Group related queries
318
- 7. **Export important answers** - Save locally
319
- 8. **Version control notebooks** - Track changes
320
- 9. **Test auth regularly** - Before important tasks
321
- 10. **Document everything** - Keep notes on notebooks
322
-
323
- ## Quick Reference
324
-
325
- ```bash
326
- # Always use run.py!
327
- python scripts/run.py [script].py [args]
328
-
329
- # Common operations
330
- run.py auth_manager.py status # Check auth
331
- run.py auth_manager.py setup # Login (browser visible!)
332
- run.py notebook_manager.py list # List notebooks
333
- run.py notebook_manager.py add ... # Add (ask user for metadata!)
334
- run.py ask_question.py --question ... # Query
335
- run.py cleanup_manager.py ... # Clean up
336
- ```
337
-
338
- **Remember:** When in doubt, use run.py and ask the user for notebook details!