Read piped stdin and merge it into the parsed CLI arguments.
When stdin is not a TTY (i.e. input is piped), reads all available text
and applies it to the argument namespace. If stdin is a TTY or the piped
input is empty/whitespace-only, the function returns without modifying
args. Leading and trailing whitespace is stripped from piped input.
non_interactive_message is already set (-n), prepends the
piped text to it (the CLI still runs non-interactively):cat context.txt | deepagents -n "summarize this"
# non_interactive_message = "{contents of context.txt}\n\nsummarize this"
initial_prompt is already set (-m, but not -n), prepends
the piped text to it (the CLI still runs interactively):cat error.log | deepagents -m "explain this"
# initial_prompt = "{contents of error.log}\n\nexplain this"
non_interactive_message to the piped text, causing
the CLI to run non-interactively with it as the prompt:echo "fix the typo in README.md" | deepagents
# non_interactive_message = "fix the typo in README.md"apply_stdin_pipe(
args: argparse.Namespace,
) -> None| Name | Type | Description |
|---|---|---|
args* | argparse.Namespace | The parsed argument namespace (mutated in place). |