CLI gen: emit --wait/--poll-interval/--wait-timeout for create+poll operations
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 92
- Forks
- 8
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 4
Description
Part of #338.
Today
AutoSDK already detects create→poll→terminal patterns at the SDK level via --auto-detect-status-polling, generating <Method>WaitAsync companions. The CLI generator does not use this signal. Users have to chain shell commands:
JOB=$(firecrawl api crawling crawl-urls --request-json '{...}' | jq -r .id)
while true; do STATUS=$(firecrawl api crawling get-crawl-status --id "$JOB" | jq -r .status); [[ "$STATUS" == "completed" ]] && break; sleep 5; done
Target
firecrawl crawl https://example.com --wait --poll-interval 5s --wait-timeout 30m
Proposed approach
- When
EndPoint.PollingMetadataindicates this operation is the create side of a detected create→poll pair, emit three additional options:--wait(Option<bool>, default false)--poll-interval(Option<TimeSpan>, default00:00:02) — parsed viaCliRuntime.ParseDurationhelper that accepts2s/30m/1h/raw seconds.--wait-timeout(Option<TimeSpan>, default00:30:00) — same parser.
- When
--waitis set, the generated action calls the existing<Method>WaitAsynchelper (already generated by the SDK side) instead of returning after create. - The wait helper already handles terminal state detection — CLI just consumes it.
- Output is the terminal-state response, formatted via the gap-#4 formatter (or
--jsonfor raw). - Add
CliRuntime.ParseDurationto the generatedCliRuntime.cstemplate.
Vendor extension
x-cli-wait: true|false|always on an operation can force/suppress wait support when auto-detection misses or is wrong (e.g. operations with status-polling-shaped responses that aren't actually long-running).
Acceptance criteria
- Firecrawl
crawl,scrape(batch variant),extract,deep-research,llmstxtcommands all accept--waitafter regeneration. - Runway.Cli polling commands work via generated
--waitwithout hand-written wrappers. --poll-interval 250ms,--poll-interval 5s,--poll-interval 1hall parse correctly.- Without
--wait, behavior is unchanged (returns the create response).
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
Trace how the CLI generator consumes EndPoint.PollingMetadata and inspect the existing SDK-side WaitAsync helper and generated CliRuntime.cs template. Add the generated wait options, duration parsing, and x-cli-wait handling without changing the default create response. Regenerate the Firecrawl and Runway.Cli commands and verify the listed duration values and terminal-state output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100