mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-10 18:14:50 +08:00
When stdin is not a terminal (pipe or redirect) and no prompt is given on the command line, claw was starting the interactive REPL and printing the startup banner, then consuming the pipe without sending anything to the API. Fix: in parse_args, when rest.is_empty() and stdin is not a terminal, read stdin synchronously and dispatch as CliAction::Prompt instead of Repl. Empty pipe still falls through to Repl (interactive launch with no input). Before: echo 'hello' | claw -> startup banner + REPL start After: echo 'hello' | claw -> dispatches as one-shot prompt 159 CLI tests pass, fmt clean.