CLI Command-Line Options for main.py in qiaomu‑anything‑to‑notebooklm

The main.py entry point accepts a positional input path or URL and two optional flags, --deep‑analysis and --to‑feishu, to orchestrate document processing, AI-powered questioning, and Feishu document generation.

The qiaomu‑anything‑to‑notebooklm repository provides a streamlined Python CLI tool for extracting content from EPUBs, PDFs, web pages, and podcasts, then uploading them to Google's NotebookLM for analysis. Knowing the exact CLI command-line options for main.py ensures you can trigger the correct processing pipeline for your specific use case.

Positional Arguments

main.py requires exactly one positional argument that specifies what content to process.

Argument Description
<input> A local file path (EPUB, PDF, TXT, MD), a directory, or a web URL pointing to an article, YouTube video, or podcast.

The script automatically detects the input type—whether it is a local document, a directory of files, or a remote URL—and routes it through the appropriate preprocessor before uploading to NotebookLM.

Optional Flags

Two Boolean switches extend the default upload behavior.

--deep‑analysis

Enabling deep analysis mode triggers a multi-step workflow. After uploading the source material to NotebookLM, the script generates three rounds of progressive questions, submits them to the NotebookLM API, captures the answers, and optionally persists the results to a JSON file. This flag transforms a simple upload into an interactive research session.

--to‑feishu

The --to‑feishu flag depends on --deep‑analysis. When both are present, the final synthesized report—containing the generated questions and NotebookLM's responses—is automatically formatted as a markdown document and posted to Feishu (Lark). This option is ignored if deep analysis is not activated.

Usage Examples

Here are practical commands demonstrating each CLI command-line option.

Upload a single PDF without additional analysis:

python main.py reports/quarterly_review.pdf

Process a web article with deep analysis to generate structured questions and answers:

python main.py https://example.com/tech-article.html --deep-analysis

Run deep analysis and automatically create a Feishu document from the results:

python main.py my_notes.epub --deep-analysis --to-feishu

Argument Validation

According to the source code in main/main.py, the main() function validates arguments immediately upon execution (lines 15–23). If the positional <input> argument is missing or invalid, the script exits with a usage message. No additional flags—such as output directories or API key overrides—are exposed via the CLI; configuration is handled internally or through environment variables.

Key supporting files invoked based on input type include:

Summary

  • main.py requires one positional <input> argument pointing to a file, directory, or URL.
  • The --deep‑analysis flag enables a three-round questioning workflow with NotebookLM.
  • The --to‑feishu flag posts deep analysis results to Feishu, but only when combined with --deep‑analysis.
  • Argument validation occurs at the start of the main() function in main/main.py (lines 15–23).
  • The tool auto-detects input types and delegates to helper scripts like get_podcast_transcript.py for specialized formats.

Frequently Asked Questions

What types of input does main.py support?

main.py accepts EPUB, PDF, TXT, and Markdown files, as well as web URLs pointing to articles, YouTube videos, podcasts, and X (Twitter) posts. The script detects the input type and routes it through the appropriate extraction logic before uploading to NotebookLM.

Can I use --to-feishu without --deep-analysis?

No. The --to‑feishu flag is designed to publish the output of the deep analysis workflow. If you invoke main.py with only --to‑feishu, the flag has no effect because there is no generated report to post. Always pair --to‑feishu with --deep‑analysis.

Where does the argument validation happen in the source code?

Argument validation and the usage message are implemented at the beginning of the main() function in main/main.py, specifically between lines 15 and 23. This ensures that missing or malformed inputs trigger an immediate error before any network or file operations begin.

How does main.py handle podcast or video URLs?

When the input is detected as a podcast or video URL, main.py invokes scripts/get_podcast_transcript.py to extract or transcribe the audio content into text before proceeding with the upload and optional analysis phases.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →