feat: Add crawl and map commands #3
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new CLI commands (
crawlandmap) to the Firecrawl CLI, enabling users to crawl websites and discover URLs directly from the terminal. Both commands support asynchronous job handling with status checking and wait modes.Changes
New Commands
firecrawl crawlfirecrawl crawl <url>- Returns job ID immediately for async processingfirecrawl crawl <job-id> --status- Check status of existing crawl job (auto-detects UUID format)firecrawl crawl <url> --wait- Waits for crawl completion with optional progress displayfirecrawl mapfirecrawl map <url>- Discovers and lists URLs on a websiteFeatures
--wait --progressfor crawl operationsImplementation Details
src/commands/crawl.ts- Crawl command implementationsrc/commands/map.ts- Map command implementationsrc/types/crawl.ts- Type definitions for crawl commandsrc/types/map.ts- Type definitions for map commandsrc/utils/job.ts- Utility functions for job ID detection and URL validationsrc/index.ts- Registered new commands with full option supportTesting
src/__tests__/commands/crawl.test.ts- 19 tests covering all crawl functionalitysrc/__tests__/commands/map.test.ts- 14 tests covering all map functionalitysrc/__tests__/utils/job.test.ts- 8 tests for utility functionsUsage Examples
Start a crawl and get job ID
Check crawl status
Start crawl and wait for completion
Map URLs on a site
Map with JSON output