You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #338. Complements gap #1 (per-parameter flags) and #4 (human formatters).
Today
Generated CLI emits only --request-file (path to a JSON file). No stdin support, no inline JSON, no output-to-file, no multi-file sink for paginated responses.
Firecrawl's Commands/ ships --input file.json|-, --output path.txt, --output-dir dir/ on every high-level command. Implemented entirely in CliRuntime once; reused across commands.
Target
# Read body from file, override one field
firecrawl scrape https://example.com --input ./scrape-config.json --only-main-content
# Read body from stdin
echo '{"formats":["markdown"]}' | firecrawl scrape https://example.com --input -
# Write formatted output to file
firecrawl scrape https://example.com --output result.txt
# Multi-page crawl, one file per page
firecrawl crawl https://example.com --wait --output-dir ./crawl-out/
Proposed approach
--input option (replaces --request-file semantically): accepts a path, - for stdin, or an inline JSON string starting with { or [. The loaded body is merged with per-field flags (gap build(deps): Bump the all group with 1 update #1) — flags override loaded fields.
--output option: when set, writes the rendered output (formatted or JSON depending on --json) to the given path instead of stdout.
--output-dir option: emitted only on commands whose success response is paginated, an array, or has known multi-resource shape (crawl results, batch results, deep-research artifacts). Writes one file per item with a stable naming scheme:
if the item has url → <sanitized-url>.md / .html / .metadata.json
Backward compatibility: keep --request-file and --request-json as hidden aliases for --input (deprecation warning) so the rename doesn't break scripts.
Acceptance criteria
All four invocations above work on regenerated Firecrawl.Cli.
--input - reads stdin correctly when piped.
--output-dir produces one file per page for crawl results.
--request-json / --request-file still work with a deprecation warning.
Part of #338. Complements gap #1 (per-parameter flags) and #4 (human formatters).
Today
Generated CLI emits only
--request-file(path to a JSON file). No stdin support, no inline JSON, no output-to-file, no multi-file sink for paginated responses.Firecrawl's
Commands/ships--input file.json|-,--output path.txt,--output-dir dir/on every high-level command. Implemented entirely inCliRuntimeonce; reused across commands.Target
Proposed approach
--inputoption (replaces--request-filesemantically): accepts a path,-for stdin, or an inline JSON string starting with{or[. The loaded body is merged with per-field flags (gap build(deps): Bump the all group with 1 update #1) — flags override loaded fields.--outputoption: when set, writes the rendered output (formatted or JSON depending on--json) to the given path instead of stdout.--output-diroption: emitted only on commands whose success response is paginated, an array, or has known multi-resource shape (crawl results, batch results, deep-research artifacts). Writes one file per item with a stable naming scheme:url→<sanitized-url>.md/.html/.metadata.json001.json,002.json, ...CliRuntime:ReadInputAsync(string spec) -> string,WriteOutputAsync(string? path, string content),WritePageResultFilesAsync(string dir, IEnumerable<T> items).--request-fileand--request-jsonas hidden aliases for--input(deprecation warning) so the rename doesn't break scripts.Acceptance criteria
--input -reads stdin correctly when piped.--output-dirproduces one file per page for crawl results.--request-json/--request-filestill work with a deprecation warning.