Main entry point and CLI loop for deepagents.
Check if CLI optional dependencies are installed.
Check for recommended external tools and return missing tool names.
Skips tools that the user has suppressed via
[warnings].suppress in config.toml.
Format a missing-tool warning for the TUI toast.
Format a missing-tool warning for non-interactive Rich console output.
Parse command line arguments.
Run the Textual CLI interface (async version).
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"Entry point for console script.