From 36cea05fcdc4753aed47b14a97325851ed822290 Mon Sep 17 00:00:00 2001 From: ege-arhan Date: Sun, 4 Oct 2026 18:49:59 +0000 Subject: [PATCH 1/2] docs(cli): clarify that --output json requires an extraction strategy for structured content Closes #2334 --- crawl4ai/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crawl4ai/cli.py b/crawl4ai/cli.py index 4473cd54c..052cd48d6 100644 --- a/crawl4ai/cli.py +++ b/crawl4ai/cli.py @@ -1021,7 +1021,7 @@ def cdp_cmd(user_data_dir: Optional[str], port: int, browser_type: str, headless @click.option("--schema", "-s", type=click.Path(exists=True), help="JSON schema for extraction") @click.option("--browser", "-b", type=str, callback=parse_key_values, help="Browser parameters as key1=value1,key2=value2") @click.option("--crawler", "-c", type=str, callback=parse_key_values, help="Crawler parameters as key1=value1,key2=value2") -@click.option("--output", "-o", type=click.Choice(["all", "json", "markdown", "md", "markdown-fit", "md-fit"]), default="all") +@click.option("--output", "-o", type=click.Choice(["all", "json", "markdown", "md", "markdown-fit", "md-fit"]), default="all", help="Output format: all, json (requires extraction strategy for structured content), markdown, md, markdown-fit, md-fit") @click.option("--output-file", "-O", type=click.Path(), help="Output file path (default: stdout)") @click.option("--bypass-cache", "-bc", is_flag=True, default=True, help="Bypass cache when crawling") @click.option("--question", "-q", help="Ask a question about the crawled content") @@ -1579,7 +1579,7 @@ def shrink_cmd(profile_name: str, level: str, dry_run: bool): @click.option("--schema", "-s", type=click.Path(exists=True), help="JSON schema for extraction") @click.option("--browser", "-b", type=str, callback=parse_key_values, help="Browser parameters as key1=value1,key2=value2") @click.option("--crawler", "-c", type=str, callback=parse_key_values, help="Crawler parameters as key1=value1,key2=value2") -@click.option("--output", "-o", type=click.Choice(["all", "json", "markdown", "md", "markdown-fit", "md-fit"]), default="all") +@click.option("--output", "-o", type=click.Choice(["all", "json", "markdown", "md", "markdown-fit", "md-fit"]), default="all", help="Output format: all, json (requires extraction strategy for structured content), markdown, md, markdown-fit, md-fit") @click.option("--bypass-cache", is_flag=True, default=True, help="Bypass cache when crawling") @click.option("--question", "-q", help="Ask a question about the crawled content") @click.option("--verbose", "-v", is_flag=True) From 2229adc6a2f78aebd1bb86d7cf4139ae4d2dbccc Mon Sep 17 00:00:00 2001 From: ege-arhan Date: Mon, 12 Oct 2026 11:08:05 +0000 Subject: [PATCH 2/2] docs(cli): update -o json help text per maintainer review --- crawl4ai/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crawl4ai/cli.py b/crawl4ai/cli.py index 052cd48d6..068e68b1a 100644 --- a/crawl4ai/cli.py +++ b/crawl4ai/cli.py @@ -1021,7 +1021,7 @@ def cdp_cmd(user_data_dir: Optional[str], port: int, browser_type: str, headless @click.option("--schema", "-s", type=click.Path(exists=True), help="JSON schema for extraction") @click.option("--browser", "-b", type=str, callback=parse_key_values, help="Browser parameters as key1=value1,key2=value2") @click.option("--crawler", "-c", type=str, callback=parse_key_values, help="Crawler parameters as key1=value1,key2=value2") -@click.option("--output", "-o", type=click.Choice(["all", "json", "markdown", "md", "markdown-fit", "md-fit"]), default="all", help="Output format: all, json (requires extraction strategy for structured content), markdown, md, markdown-fit, md-fit") +@click.option("--output", "-o", type=click.Choice(["all", "json", "markdown", "md", "markdown-fit", "md-fit"]), default="all", help="json = extracted data only (needs -j or -e). Use 'all' (default) for the full crawl result.") @click.option("--output-file", "-O", type=click.Path(), help="Output file path (default: stdout)") @click.option("--bypass-cache", "-bc", is_flag=True, default=True, help="Bypass cache when crawling") @click.option("--question", "-q", help="Ask a question about the crawled content") @@ -1579,7 +1579,7 @@ def shrink_cmd(profile_name: str, level: str, dry_run: bool): @click.option("--schema", "-s", type=click.Path(exists=True), help="JSON schema for extraction") @click.option("--browser", "-b", type=str, callback=parse_key_values, help="Browser parameters as key1=value1,key2=value2") @click.option("--crawler", "-c", type=str, callback=parse_key_values, help="Crawler parameters as key1=value1,key2=value2") -@click.option("--output", "-o", type=click.Choice(["all", "json", "markdown", "md", "markdown-fit", "md-fit"]), default="all", help="Output format: all, json (requires extraction strategy for structured content), markdown, md, markdown-fit, md-fit") +@click.option("--output", "-o", type=click.Choice(["all", "json", "markdown", "md", "markdown-fit", "md-fit"]), default="all", help="json = extracted data only (needs -j or -e). Use 'all' (default) for the full crawl result.") @click.option("--bypass-cache", is_flag=True, default=True, help="Bypass cache when crawling") @click.option("--question", "-q", help="Ask a question about the crawled content") @click.option("--verbose", "-v", is_flag=True)