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

> Explore the CLI command-line options for main.py in qiaomu-anything-to-notebooklm. Learn how to process documents and generate Feishu docs with simple commands.

- Repository: [向阳乔木/qiaomu-anything-to-notebooklm](https://github.com/joeseesun/qiaomu-anything-to-notebooklm)
- Tags: api-reference
- Published: 2026-05-16

---

**The [`main.py`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/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`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/main.py) ensures you can trigger the correct processing pipeline for your specific use case.

## Positional Arguments

[`main.py`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/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:

```bash
python main.py reports/quarterly_review.pdf

```

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

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

```

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

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

```

## Argument Validation

According to the source code in [`main/main.py`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/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:
- **[`scripts/get_podcast_transcript.py`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/scripts/get_podcast_transcript.py)** – Fetches transcripts when the input is a podcast or video URL.
- **[`scripts/fetch_url.sh`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/scripts/fetch_url.sh)** – Retrieves raw content for X (Twitter) posts before processing.

## Summary

- [`main.py`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/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`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/main/main.py) (lines 15–23).
- The tool auto-detects input types and delegates to helper scripts like [`get_podcast_transcript.py`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/get_podcast_transcript.py) for specialized formats.

## Frequently Asked Questions

### What types of input does main.py support?

[`main.py`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/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`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/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`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/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`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/main.py) invokes [`scripts/get_podcast_transcript.py`](https://github.com/joeseesun/qiaomu-anything-to-notebooklm/blob/main/scripts/get_podcast_transcript.py) to extract or transcribe the audio content into text before proceeding with the upload and optional analysis phases.