diff --git a/README.md b/README.md index 86ab5e2..8da15a1 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ firecrawl scrape https://firecrawl.dev https://firecrawl.dev/blog https://docs.f | `--include-tags ` | Only include specific HTML tags | | `--exclude-tags ` | Exclude specific HTML tags | | `--max-age ` | Maximum age of cached content in milliseconds | +| `--lockdown` | Enable lockdown mode for the scrape | | `-o, --output ` | Save output to file | | `--json` | Output as JSON format | | `--pretty` | Pretty print JSON output | diff --git a/src/commands/scrape.ts b/src/commands/scrape.ts index 271acb6..ed2376d 100644 --- a/src/commands/scrape.ts +++ b/src/commands/scrape.ts @@ -118,6 +118,10 @@ export async function executeScrape( scrapeParams.profile = options.profile; } + if (options.lockdown) { + scrapeParams.lockdown = true; + } + // Execute scrape with timing - only wrap the scrape call in try-catch const requestStartTime = Date.now(); diff --git a/src/index.ts b/src/index.ts index 1faec01..c6d6786 100644 --- a/src/index.ts +++ b/src/index.ts @@ -173,6 +173,7 @@ function createScrapeCommand(): Command { '--no-save-changes', 'Load existing profile data without saving changes (default: saves changes)' ) + .option('--lockdown', 'Enable lockdown mode for the scrape', false) .action(async (positionalArgs, options) => { // Collect URLs from positional args and --url option @@ -288,6 +289,7 @@ function createDownloadCommand(): Command { '--languages ', 'Comma-separated language codes for scraping (e.g., en,es)' ) + .option('--lockdown', 'Enable lockdown mode for the scrape', false) .option('-y, --yes', 'Skip confirmation prompt', false) .option( '-k, --api-key ', diff --git a/src/types/scrape.ts b/src/types/scrape.ts index dbdb9b1..517c436 100644 --- a/src/types/scrape.ts +++ b/src/types/scrape.ts @@ -62,6 +62,8 @@ export interface ScrapeOptions { name: string; saveChanges?: boolean; }; + /** Enable lockdown mode for the scrape */ + lockdown?: boolean; } export interface ScrapeResult { diff --git a/src/utils/options.ts b/src/utils/options.ts index e8c382b..75cec42 100644 --- a/src/utils/options.ts +++ b/src/utils/options.ts @@ -121,5 +121,6 @@ export function parseScrapeOptions(options: any): ScrapeOptions { location, query: options.query, profile, + lockdown: options.lockdown, }; }