fix(scrape): treat --full-page-screenshot as the screenshot format
What's wrong
--full-page-screenshot goes into the request but not into the output formats. The flag also doesn't replace a plain screenshot format. This causes two failures:
firecrawl scrape https://example.com --full-page-screenshotprints only the markdown. The API returns a screenshot URL, but the CLI never shows it, so the user pays for a screenshot they never see.--screenshotworks becausehandleScrapeCommandaddsscreenshotto the output formats for that flag only.firecrawl scrape https://example.com -f screenshot --full-page-screenshotsendsformats: ["screenshot", {"type":"screenshot","fullPage":true}]. The v2 scrape schema has the refineYou may only specify one screenshot format, so the command fails with that error.
Reproduced against a local fake /v2/scrape that applies the same one-screenshot rule:
$ firecrawl scrape https://example.com --full-page-screenshot --api-url http://127.0.0.1:38471
# Hello
$ firecrawl scrape https://example.com -f screenshot --full-page-screenshot --api-url http://127.0.0.1:38471
Error: You may only specify one screenshot format
Fix
executeScrape: whenfullPageScreenshotis set, drop a plainscreenshotentry before adding{ type: 'screenshot', fullPage: true }.handleScrapeCommand: countfullPageScreenshotas a screenshot when choosing the output shape, the same way--screenshotis counted.handleAllScrapeCommandalready does this.
After the fix the two commands above print {"markdown":"# Hello","screenshot":"https://…"} and the formatted Screenshot: https://… block.
Tests
Two new cases in src/__tests__/commands/scrape.test.ts:
--format markdown,screenshotplusfullPageScreenshotsends exactly one screenshot format.handleScrapeCommandwithfullPageScreenshotprints the screenshot URL next to the markdown.
Both fail on main and pass with the fix. pnpm run format:check, pnpm run type-check, pnpm run build and pnpm test (642 tests) pass.
This PR was prepared with an AI coding agent (Claude). I reproduced the bug and checked the fix and tests before opening it.
Summary by cubic
Fixes --full-page-screenshot so the screenshot URL is included in CLI output instead of being silently dropped. The flag now replaces any plain screenshot output format, preventing the "You may only specify one screenshot format" API error.