CLI Subsystem

CLI Subsystem An architecture diagram generated by Archify. AuthSource · precedence resolver · cli/ · imports no notebooklm._* except _app and browser_capture AuthSource precedence resolver CLI Context · context.json · cli/ · imports no notebooklm._* except _app and browser_capture · active notebook CLI Context context.json active notebook ID Resolver · partial-id match · cli/ · imports no notebooklm._* except _app and browser_capture ID Resolver partial-id match Root Group · notebooklm_cli.py · cli/ · imports no notebooklm._* except _app and browser_capture · SectionedGroup Root Group notebooklm_cli.py SectionedGroup Click Command · cli/*_cmd.py · cli/ · imports no notebooklm._* except _app and browser_capture Click Command cli/*_cmd.py Auth Runtime · one asyncio.run · cli/ · imports no notebooklm._* except _app and browser_capture · ADR-0004 Auth Runtime one asyncio.run ADR-0004 CLI Services · plans · retry · wait · cli/ · imports no notebooklm._* except _app and browser_capture · ADR-0008 CLI Services plans · retry · wait ADR-0008 NotebookLMClient · opened per command · Architecture component NotebookLMClient opened per command Error Handler · exit-code policy · cli/ · imports no notebooklm._* except _app and browser_capture · ADR-0015 Error Handler exit-code policy ADR-0015 Rendering · rich · text · JSON · cli/ · imports no notebooklm._* except _app and browser_capture Rendering rich · text · JSON Login Services · interactive · cookies · token · cli/ · imports no notebooklm._* except _app and browser_capture Login Services interactive · cookies · token Credential Sources · browser · cookies · OAuth · Architecture component · sanctioned import Credential Sources browser · cookies · OAuth sanctioned import dispatch with_auth workflow public API resolve auth active profile partial ids raises stdout login flow capture cli/ · imports no notebooklm._* except _app and browser_capture Legend Frontend Backend Database Security

Thin adapter

  • • Commands own Click options, rendering and exit codes; services own workflows
  • • The CLI never builds batchexecute payloads or imports rpc/

One loop per command

  • • cli/runtime.py holds the single asyncio.run bridge for sync Click handlers
  • • Auth precedence is --storage, then NOTEBOOKLM_AUTH_JSON, then the active profile

Output contract

  • • Under --json, failures use the byte-stable typed error envelope
  • • Parse-time Click errors stay Click-owned and are not re-wrapped