Feature: nlm read-note, nlm notes --full flag #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature: Read Note Commands
Summary
This PR adds commands to read note content from NotebookLM notebooks. It depends on PR #1 (GetNotes parsing fix) which adds the
Contentfield to theSourcestruct.Features
1.
nlm read-note <notebook-id> <note-id>Display the content of a specific note. First list notes to get the ID, then read the note:
2.
nlm notes <notebook-id> --fullDump all notes with their full content. Useful for piping to files or other tools for processing:
Example use case: A notebook with 7 notes, each ~50 lines, would output ~400 lines of content that can be piped to a file or processed by other tools:
Changes
cmd/nlm/main.goread-notecommand--fullflagreadNote()functionlistNotes()updatedshowFullparameterTesting
1. Unit Tests (
gen/service/notes_parser_test.go)Added unit tests for the parsing logic to ensure stability against malformed API data:
nilinput, non-array inputs, empty arraysRun with locally:
go test ./gen/service/... -v2. CLI Command Tests (
cmd/nlm/main_test.go)Updated
cmd/nlm/testdata/note_commands.txtto cover new commands:nlm note <id> --fullargument validationnlm read-noteusage and auth validationRun locally:
go test ./cmd/nlm/... -v3. Manual Verification
Verified against live API(my Google Pro acct to my notebook):
Usage Flow
nlm notes <notebook-id>nlm read-note <notebook-id> <note-id>nlm notes <notebook-id> --full > all_notes.mdDependencies
This PR depends on #17 (GetNotes parsing fix) which:
Contentfield toSourcestruct