From ca95e43c1e9c645297f96b51f69a67d7445ec1cc Mon Sep 17 00:00:00 2001 From: Abimael Martell Date: Mon, 1 Jun 2026 11:21:21 -0700 Subject: [PATCH 1/2] Add redact-pii scrape flag --- README.md | 1 + skills/firecrawl-scrape/SKILL.md | 1 + src/__tests__/commands/scrape.test.ts | 16 ++++++++++++++++ src/__tests__/utils/options.test.ts | 13 +++++++++++++ src/commands/scrape.ts | 4 ++++ src/index.ts | 5 +++++ src/types/scrape.ts | 2 ++ src/utils/options.ts | 1 + 8 files changed, 43 insertions(+) diff --git a/README.md b/README.md index 2d26d76ac0..3d72d06b83 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,7 @@ firecrawl scrape https://firecrawl.dev https://firecrawl.dev/blog https://docs.f | `--exclude-tags ` | Exclude specific HTML tags | | `--max-age ` | Maximum age of cached content in milliseconds | | `--lockdown` | Enable lockdown mode for the scrape | +| `--redact-pii` | Redact personally identifiable information from output | | `--schema ` | JSON schema for structured extraction | | `--schema-file ` | Path to JSON schema file for structured extraction | | `--actions ` | JSON actions array to run during scrape | diff --git a/skills/firecrawl-scrape/SKILL.md b/skills/firecrawl-scrape/SKILL.md index 86b8be1f9a..6c6612756c 100644 --- a/skills/firecrawl-scrape/SKILL.md +++ b/skills/firecrawl-scrape/SKILL.md @@ -50,6 +50,7 @@ firecrawl scrape "https://example.com/pricing" --query "What is the enterprise p | `--wait-for ` | Wait for JS rendering before scraping | | `--include-tags ` | Only include these HTML tags | | `--exclude-tags ` | Exclude these HTML tags | +| `--redact-pii` | Redact personally identifiable information from output | | `-o, --output ` | Output file path | ## Tips diff --git a/src/__tests__/commands/scrape.test.ts b/src/__tests__/commands/scrape.test.ts index e57e8c5b86..aaeae6b967 100644 --- a/src/__tests__/commands/scrape.test.ts +++ b/src/__tests__/commands/scrape.test.ts @@ -350,6 +350,22 @@ describe('executeScrape', () => { }); }); + it('should include redactPII when provided', async () => { + const mockResponse = { markdown: '# Test' }; + mockClient.scrape.mockResolvedValue(mockResponse); + + await executeScrape({ + url: 'https://example.com', + redactPII: true, + }); + + expect(mockClient.scrape).toHaveBeenCalledWith('https://example.com', { + formats: ['markdown'], + integration: 'cli', + redactPII: true, + }); + }); + it('should not include location parameter when not provided', async () => { const mockResponse = { markdown: '# Test' }; mockClient.scrape.mockResolvedValue(mockResponse); diff --git a/src/__tests__/utils/options.test.ts b/src/__tests__/utils/options.test.ts index 5e7f5e34ca..eaed0f5ab3 100644 --- a/src/__tests__/utils/options.test.ts +++ b/src/__tests__/utils/options.test.ts @@ -304,6 +304,17 @@ describe('Option Parsing Utilities', () => { expect(result.timing).toBe(true); }); + it('should parse redactPii option from the CLI flag', () => { + const options = { + url: 'https://example.com', + redactPii: true, + }; + + const result = parseScrapeOptions(options); + + expect(result.redactPII).toBe(true); + }); + it('should handle undefined format', () => { const options = { url: 'https://example.com', @@ -328,6 +339,7 @@ describe('Option Parsing Utilities', () => { output: '.firecrawl/output.json', pretty: true, timing: true, + redactPii: true, }; const result = parseScrapeOptions(options); @@ -345,6 +357,7 @@ describe('Option Parsing Utilities', () => { output: '.firecrawl/output.json', pretty: true, timing: true, + redactPII: true, }); }); diff --git a/src/commands/scrape.ts b/src/commands/scrape.ts index e9a10d0529..67b31bbd7b 100644 --- a/src/commands/scrape.ts +++ b/src/commands/scrape.ts @@ -137,6 +137,10 @@ export async function executeScrape( scrapeParams.lockdown = true; } + if (options.redactPII) { + scrapeParams.redactPII = 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 5354767331..6fd3350105 100644 --- a/src/index.ts +++ b/src/index.ts @@ -371,6 +371,11 @@ function createScrapeCommand(): Command { 'Load existing profile data without saving changes (default: saves changes)' ) .option('--lockdown', 'Enable lockdown mode for the scrape', false) + .option( + '--redact-pii', + 'Redact personally identifiable information from returned content', + false + ) .option('--schema ', 'JSON schema for structured extraction') .option('--schema-file ', 'Path to JSON schema file') .option('--actions ', 'JSON actions array to run during scrape') diff --git a/src/types/scrape.ts b/src/types/scrape.ts index 1387108ca7..6cdbe89e8c 100644 --- a/src/types/scrape.ts +++ b/src/types/scrape.ts @@ -70,6 +70,8 @@ export interface ScrapeOptions { }; /** Enable lockdown mode for the scrape */ lockdown?: boolean; + /** Redact personally identifiable information from returned content */ + redactPII?: boolean; } export interface ScrapeResult { diff --git a/src/utils/options.ts b/src/utils/options.ts index 75cec42dea..878e6b5f54 100644 --- a/src/utils/options.ts +++ b/src/utils/options.ts @@ -122,5 +122,6 @@ export function parseScrapeOptions(options: any): ScrapeOptions { query: options.query, profile, lockdown: options.lockdown, + redactPII: options.redactPii ?? options.redactPII, }; } From 3dbbe4395e5b07e0eff87fbba406013afde12d9e Mon Sep 17 00:00:00 2001 From: Abimael Martell Date: Mon, 1 Jun 2026 11:26:18 -0700 Subject: [PATCH 2/2] Bump CLI version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13462a14c6..15d4dcc803 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firecrawl-cli", - "version": "1.18.5", + "version": "1.18.6", "description": "Command-line interface for Firecrawl. Scrape, crawl, and extract data from any website directly from your terminal.", "main": "dist/index.js", "bin": {