Skip to content

Conversation

@nobita2041
Copy link
Contributor

@nobita2041 nobita2041 commented Jan 20, 2026

Summary

  • Fix error when scraping with --format links and --format images (arrays now converted to newline-separated strings)
  • Add support for multiple formats: --format markdown,links,images
  • Single format outputs raw content (backward compatible)
  • Multiple formats output JSON with all requested data
  • Case-insensitive format input (rawHtml, RAWHTML both work)
  • Add format validation with helpful error messages

Usage

# Single format (raw content output)
firecrawl scrape https://example.com --format markdown

# Multiple formats (JSON output)
firecrawl scrape https://example.com --format markdown,links,images --pretty

Test plan

  • All 80 tests pass with bun run test
  • Single format outputs raw content (backward compatible)
  • Multiple formats output JSON with requested data
  • Invalid format shows error with valid options
  • Case-insensitive input works (rawHtml, RAWHTML)
  • cubic review passes with no issues

🤖 Generated with Claude Code

nobita2041 and others added 2 commits January 20, 2026 20:25
The links and images formats return arrays from Firecrawl API,
but writeOutput expected a string, causing endsWith() to fail.

Now converts arrays to newline-separated strings for CLI-friendly output.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Allow comma-separated formats: --format markdown,links,images
- Single format outputs raw content (backward compatible)
- Multiple formats output JSON with all requested data
- Case-insensitive format input (rawHtml, RAWHTML both work)
- Add format validation with helpful error messages
- Update help text to clarify multiple format usage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@nobita2041 nobita2041 changed the title Fix array format output for links and images Add multiple format support for scrape command Jan 20, 2026
@abimaelmartell
Copy link
Member

thank you for the contribution!

@abimaelmartell abimaelmartell merged commit c61bafc into firecrawl:main Jan 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants