CLI gen: --input/--output/--output-dir convenience options on every command
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 92
- Forks
- 8
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 4
Description
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
--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 #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:- if the item has
url→<sanitized-url>.md/.html/.metadata.json - else →
001.json,002.json, ...
- if the item has
- Add helpers to
CliRuntime:ReadInputAsync(string spec) -> string,WriteOutputAsync(string? path, string content),WritePageResultFilesAsync(string dir, IEnumerable<T> items). - Backward compatibility: keep
--request-fileand--request-jsonas 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-dirproduces one file per page for crawl results.--request-json/--request-filestill work with a deprecation warning.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating CliRuntime and tracing the existing --request-file and --request-json handling in the generated Firecrawl.Cli commands. Then map which commands have paginated or multi-resource responses. Done means the four example invocations work, output-directory files are created per page, and both legacy options continue working with deprecation warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100