The Deep Research Agent CLI lets you run a full research pipeline — planning, searching, fetching, and synthesizing — directly from your terminal. Pass a question as a positional argument or via a flag, optionally stream verbose step-by-step output, and either print the final report to stdout or write it straight to a file.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/IconDean/research-agent/llms.txt
Use this file to discover all available pages before exploring further.
Synopsis
Flags and Arguments
| Flag | Type | Default | Description |
|---|---|---|---|
question | positional string | — | The research question to investigate |
-q, --query | string | — | Alternative way to pass the research question |
--verbose | boolean flag | false | Print every step event (plan, searches, gap analysis) |
-o, --output | file path | — | Save the markdown report to a file instead of stdout |
Invocation Styles
Both the positional argument and the-q / --query flag accept the same research question. Use whichever fits your workflow — they are functionally identical.
Default Behavior
Without any extra flags the agent writes progress messages to stderr and prints the final report to stdout, preceded by a separator line so you can reliably split them in scripts.🔍 for a search query being issued, 📄 for a page being fetched, and 🚫 for a URL that was rejected by the credibility filter.
Verbose Mode
Add--verbose to see every internal step: the research plan, each individual search and fetch, and gap-analysis passes between iterations.
[EVENT_TYPE] detail, for example:
Saving to a File
Use-o or --output with a file path to write the markdown report directly to disk instead of printing to stdout. Progress messages still go to stderr.
-o with --verbose to capture a full log of progress events while writing the report to a file:
Piping and Scripting
Because progress goes to stderr and the report goes to stdout, you can redirect each stream independently in shell scripts.The separator line (
====...====) is printed to stdout immediately before the report, so downstream tools that parse stdout will receive it. If you need clean markdown only, strip the first line of output in your script.Error Conditions
Missing Question
If you runpython main.py without a question (neither positional nor -q), the CLI prints the full help text followed by a usage example, then exits with code 1:
Missing API Key
IfGEMINI_API_KEY is not set in research_agent/.env, the agent raises:
Exit Codes
| Code | Meaning |
|---|---|
0 | Research completed successfully |
1 | Error — missing question, missing API key, or research failure |