tryAGI / tryAGI/AutoSDK

CLI gen: --input/--output/--output-dir convenience options on every command

Open
#343 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

  1. --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 #1) — flags override loaded fields.
  2. --output option: when set, writes the rendered output (formatted or JSON depending on --json) to the given path instead of stdout.
  3. --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
    • else → 001.json, 002.json, ...
  4. Add helpers to CliRuntime: ReadInputAsync(string spec) -> string, WriteOutputAsync(string? path, string content), WritePageResultFilesAsync(string dir, IEnumerable<T> items).
  5. 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.