Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
c9b0d50
Merge pull request #4 from tmc/devin/1734643229-fix-windows-chrome-de…
tmc Dec 19, 2024
1c512fe
nlm: simplify create command output
tmc Dec 5, 2024
03eacf6
api: add YouTube source support and improve error handling
tmc Dec 25, 2024
d7d0db7
nlm: improve batch execute response handling and auth flow
tmc Jan 14, 2025
dd279a3
api: improve MIME type detection and file upload handling
tmc Jan 14, 2025
c1b0111
batchexecute: Add chunked response handling, improve tests, and updat…
tmc Mar 9, 2025
70b6338
nlm: Add basic integration test
tmc Mar 9, 2025
1501d36
nlm: Add -mime flag for specifying MIME type with file and stdin sources
tmc Mar 9, 2025
fc89ac7
batchexecute: Fix syntax error in chunked response handler
tmc Mar 9, 2025
4a30ff1
nlm: Clean up main.go formatting
tmc Mar 9, 2025
eed0f60
internal/api: Handle JSON content as text when adding sources
tmc Mar 9, 2025
51b521b
batchexecute: Fix regression in JSON file handling and response parsing
tmc Mar 9, 2025
abf147f
batchexecute: Enhance response parser with robust error handling
tmc Mar 9, 2025
cd1e474
nlm: Enhance JSON handling with improved error messages
tmc Mar 9, 2025
d0df958
batchexecute: Improve chunked response parser reliability and tests
tmc May 22, 2025
fd3449b
api: Add sophisticated chunked response parser for NotebookLM API
tmc May 22, 2025
e95942d
beproto: Add build tools and development infrastructure
tmc May 22, 2025
75f41c0
internal/auth: Enhance authentication with profile scanning and valid…
tmc May 22, 2025
601f968
api: Improve API client with better error handling and testing
tmc May 22, 2025
8efa9ba
internal/httprr: Add HTTP request recording and replay for API testing
tmc May 22, 2025
0d55919
nlm: Clean up main.go formatting and improve readability
tmc May 22, 2025
4a2591e
nlm: Add comprehensive test suite for CLI functionality
tmc Jun 29, 2025
f408025
nlm: Format code with consistent whitespace and indentation
tmc Jun 29, 2025
d045320
nlm: Remove temporary test files
tmc Jun 29, 2025
079853c
httprr: Enhance HTTP request recording with NotebookLM support
tmc Jun 29, 2025
60171e0
internal/httprr: Refine NotebookLM HTTP recording and testing
tmc Jun 30, 2025
e688e04
internal/auth: Fix Brave browser authentication support
tmc Jul 16, 2025
e148af0
internal/batchexecute: Add debug output for chunked response parsing
tmc Jul 16, 2025
58866e9
internal/api: Add comprehensive httprr recording test framework
tmc Jul 17, 2025
bae2e6b
docs: Add comprehensive authentication and troubleshooting documentation
tmc Jul 17, 2025
47f2958
internal/beprotojson: Add support for empty array codes in API responses
tmc Jul 17, 2025
367f36a
internal/api: Enhance project listing with empty response handling
tmc Jul 22, 2025
bf397ab
proto/notebooklm: Add orchestration and sharing service definitions
tmc Jul 22, 2025
cde1685
cmd/nlm: Add security isolation tests and update dependencies
tmc Jul 22, 2025
b318d7c
proto: Add arg_format annotations to orchestration service methods
tmc Jul 22, 2025
354944d
codegen: Implement missing arg_format patterns in encoder template
tmc Jul 22, 2025
1496e91
cmd/nlm: fix security isolation test expectations and identify profil…
tmc Jul 22, 2025
0a44dc0
nlm: Enhance CLI with security fixes and new commands
tmc Jul 22, 2025
972ff83
cmd/nlm: add notebook sharing commands and proto definitions
tmc Jul 24, 2025
fefc17e
cmd/nlm: add tests for orchestration and sharing functionality
tmc Jul 24, 2025
85de4af
internal/batchexecute: add network resilience with retry logic
tmc Jul 24, 2025
fff34e2
cmd/nlm: enhance CLI test suite with auth parsing and network failure…
tmc Jul 29, 2025
14bc67d
cmd/nlm: improve test isolation and add notes command validation
tmc Jul 29, 2025
e8ff900
internal/batchexecute: mask sensitive authentication data in debug ou…
tmc Aug 29, 2025
5ff47c2
internal/batchexecute: improve chunked response parsing with proper p…
tmc Aug 29, 2025
89e5895
cmd/nlm: add interactive chat interface to emulate web UI
tmc Aug 29, 2025
0c74e60
cmd/nlm: add comprehensive scriptutil tests for all CLI commands
tmc Aug 29, 2025
de21c03
cmd/nlm: fix test expectations to match actual CLI behavior
tmc Aug 29, 2025
d89e555
internal/batchexecute: add comprehensive error handling for API respo…
tmc Aug 29, 2025
68fee3e
proto: update protobuf definitions and build configuration
tmc Aug 29, 2025
fffac7c
cmd/nlm: complete GenerateMagicView implementation and comprehensive …
tmc Aug 29, 2025
1745422
cmd/nlm: add comprehensive content transformation commands
tmc Aug 31, 2025
e41971e
docs: add comprehensive API status report
tmc Aug 31, 2025
dd1007e
docs: add dead code analysis and remove orphaned editNote function
tmc Aug 31, 2025
c8889d6
test: Add comprehensive pathway testing framework
tmc Aug 31, 2025
8302cf0
internal/api: simplify client implementation to use generated service…
tmc Aug 31, 2025
eb86b8f
all: remove obsolete test files and artifacts
tmc Aug 31, 2025
e2133d6
all: clean up codebase and remove unused files
tmc Sep 1, 2025
c64908a
internal/rpc/argbuilder: add generalized RPC argument encoding system
tmc Sep 2, 2025
a748c7f
cmd/nlm: fix command argument validation in CLI tests
tmc Sep 5, 2025
21a5049
cmd/nlm: fix network resilience and input handling tests
tmc Sep 5, 2025
321cbe4
cmd/nlm: add credential refresh command and clean up temporary docs
tmc Sep 8, 2025
814917d
internal/rpc: add gRPC endpoint support for modern API integration
tmc Sep 8, 2025
9f3da11
internal/rpc/argbuilder: add GenerateFreeFormStreamed test case
tmc Sep 8, 2025
3708a3f
internal/rpc: generalize RPC argument encoding
tmc Sep 10, 2025
7169be9
cmd/nlm: complete video overview creation and httprr test cleanup
tmc Sep 16, 2025
0317d92
cmd/nlm: add interactive chat and content transformation commands
tmc Sep 16, 2025
bad931d
internal/beprotojson: handle scalar values in message fields gracefully
tmc Sep 16, 2025
2cc02d6
cmd/nlm: add debug flags and improve interactive chat handling
tmc Sep 16, 2025
d45860b
api: improve GenerateFreeFormStreamed integration and source handling
tmc Sep 16, 2025
dc7af73
cmd/nlm: add robust error handling and timeout support for chat
tmc Sep 16, 2025
a3138cb
cmd/nlm: mask sensitive profile names in debug output
tmc Sep 16, 2025
dfe437c
tests: remove corrupted httprr recordings
tmc Sep 17, 2025
1077ee6
cmd/nlm: add persistent chat sessions and streaming callback support
tmc Sep 17, 2025
c444258
cmd/nlm: add beprotojson debug options and fix ListRecentlyViewedProj…
tmc Sep 17, 2025
e9347f4
tests: simplify test infrastructure and fix beprotojson array handling
tmc Sep 17, 2025
c51a0f6
cmd/nlm: enhance list output with source counts and improve test infr…
tmc Sep 17, 2025
d047894
cmd/nlm: simplify integration test implementation
tmc Sep 17, 2025
aee7108
cmd/nlm: add comprehensive test suite with parallel scripttest execution
tmc Sep 17, 2025
c10a006
cmd/nlm: remove unsupported comprehensive test files
tmc Sep 17, 2025
9d7d495
tests: fix import statements in API test files
tmc Sep 18, 2025
3e3fb5b
auth: add keep-open option for manual authentication support
tmc Sep 19, 2025
9f7b1d6
auth: add graceful browser shutdown to avoid crash detection
tmc Sep 19, 2025
c116268
auth: simplify keep-open logic by removing retry mechanisms
tmc Sep 19, 2025
420572f
auth: optimize profile copying by selecting only essential authentica…
tmc Sep 19, 2025
9896589
tests: add integration build tags to API test files
tmc Sep 19, 2025
1b3b652
fix: builds: linux + windows
amitnovick Nov 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
.env

**/.claude/settings.local.json

# Binaries (files only, not directories)
/nlm
/nlm_test
/nlm_new
/cmd/nlm/nlm
/cmd/nlm/nlm_test

# Coverage files
coverage.html
coverage.out

# Browser data (should never be committed)
Default/
Local State
Cookies
Login Data
Web Data
*.db
*.db-*
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: all build test clean install

all: build

build:
go build -o nlm ./cmd/nlm

install:
go install ./cmd/nlm

test:
go test ./...

clean:
rm -f nlm

generate:
cd proto && go tool buf generate
126 changes: 123 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Generation Commands:

Other Commands:
auth Setup authentication
batch <commands> Execute multiple commands in batch
```

<details>
Expand Down Expand Up @@ -112,7 +113,70 @@ First, authenticate with your Google account:
nlm auth
```

This will launch Chrome to authenticate with your Google account. The authentication tokens will be saved in `.env` file.
This will launch your default Chromium-based browser to authenticate with your Google account. The authentication tokens will be saved in `~/.nlm/env` file.

### Browser Support

The tool supports multiple browsers:
- **Google Chrome** (default)
- **Chrome Canary**
- **Brave Browser**
- **Chromium**
- **Microsoft Edge**

### Brave Browser Authentication

If you use Brave Browser, the tool will automatically detect and use it:

```bash
# The tool will automatically find and use Brave profiles
nlm auth

# Force authentication with all available profiles (including Brave)
nlm auth --all

# Check which profiles have NotebookLM access
nlm auth --notebooks

# Use a specific Brave profile
nlm auth --profile "Profile 1"
```

### Profile Management

The authentication system automatically scans for browser profiles and prioritizes them based on:
- Profiles that already have NotebookLM cookies
- Most recently used profiles
- Profiles with existing notebooks

To see available profiles:
```bash
nlm auth --all --notebooks
```

### Advanced Authentication Options

```bash
# Try all available browser profiles
nlm auth --all

# Use a specific browser profile
nlm auth --profile "Work Profile"

# Check notebook access for profiles
nlm auth --notebooks

# Enable debug output to see authentication process
nlm auth --debug
```

### Environment Variables

- `NLM_AUTH_TOKEN`: Authentication token (stored in ~/.nlm/env)
- `NLM_COOKIES`: Authentication cookies (stored in ~/.nlm/env)
- `NLM_BROWSER_PROFILE`: Chrome/Brave profile to use (default: "Default")

These are typically managed by the `auth` command, but can be manually configured if needed.

## Usage 💻

Expand Down Expand Up @@ -147,11 +211,18 @@ nlm add <notebook-id> document.pdf
# Add source from stdin
echo "Some text" | nlm add <notebook-id> -

# Add content from stdin with specific MIME type
cat data.xml | nlm add <notebook-id> - -mime="text/xml"
cat data.json | nlm add <notebook-id> - -mime="application/json"

# Rename a source
nlm rename-source <source-id> "New Title"

# Remove a source
nlm rm-source <notebook-id> <source-id>

# Add a YouTube video as a source
nlm add <notebook-id> https://www.youtube.com/watch?v=dQw4w9WgXcQ
```

### Note Operations
Expand Down Expand Up @@ -186,6 +257,17 @@ nlm audio-share <notebook-id>
nlm audio-share <notebook-id> --public
```

### Batch Mode

Execute multiple commands in a single request for better performance:

```bash
# Create a notebook and add multiple sources in one batch request
nlm batch "create 'My Research Notebook'" "add NOTEBOOK_ID https://example.com/article" "add NOTEBOOK_ID research.pdf"
```

The batch mode reduces latency by sending multiple commands in a single network request.

## Examples 📋

Create a notebook and add some content:
Expand All @@ -196,6 +278,7 @@ notebook_id=$(nlm create "Research Notes" | grep -o 'notebook [^ ]*' | cut -d' '
# Add some sources
nlm add $notebook_id https://example.com/research-paper
nlm add $notebook_id research-data.pdf
nlm add $notebook_id https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Create an audio overview
nlm audio-create $notebook_id "summarize in a professional tone"
Expand All @@ -218,14 +301,51 @@ nlm -debug list

- `NLM_AUTH_TOKEN`: Authentication token (stored in ~/.nlm/env)
- `NLM_COOKIES`: Authentication cookies (stored in ~/.nlm/env)
- `NLM_BROWSER_PROFILE`: Chrome profile to use for authentication (default: "Default")
- `NLM_BROWSER_PROFILE`: Chrome/Brave profile to use for authentication (default: "Default")

These are typically managed by the `auth` command, but can be manually configured if needed.

## Troubleshooting 🔧

If you encounter issues with authentication, API errors, or file uploads, please see the [Troubleshooting Guide](TROUBLESHOOTING.md) for detailed solutions to common problems.

## Recent Improvements 🚀

### 1. Enhanced MIME Type Detection

We've improved the way files are uploaded to NotebookLM with more accurate MIME type detection:
- Multi-stage detection process using content analysis and file extensions
- Better handling of text versus binary content
- Improved error handling and diagnostics
- Manual MIME type specification with new `-mime` flag for precise control

### 2. YouTube Source Support

You can now easily add YouTube videos as sources to your notebooks:
- Automatic detection of various YouTube URL formats
- Support for standard youtube.com links and shortened youtu.be URLs
- Proper extraction and processing of video content

### 3. Improved Batch Execute Handling

The batch mode has been enhanced for better performance and reliability:
- Chunked response handling for larger responses
- More robust authentication flow
- Better error handling and recovery
- Improved request ID generation for API stability

### 4. File Upload Enhancements

File upload capabilities have been refined:
- Support for more file formats
- Better handling of large files
- Enhanced error reporting and diagnostics
- New `-mime` flag for explicitly specifying content type for any file or stdin input

## Contributing 🤝

Contributions are welcome! Please feel free to submit a Pull Request.

## License 📄

MIT License - see [LICENSE](LICENSE) for details.
MIT License - see [LICENSE](LICENSE) for details.
Loading