diff --git a/src/cli.py b/src/cli.py new file mode 100644 index 0000000..1999093 --- /dev/null +++ b/src/cli.py @@ -0,0 +1,37 @@ +"""Command‑line interface for the research brief generator. + +Usage: + python -m src.cli "Your research question" + +The CLI will: +1. Build the LangGraph. +2. Run the graph with the supplied topic. +3. Print the outline, step‑by‑step notes, and final brief. +""" + +import asyncio +import sys +from .brief import build_graph + +def main(): + if len(sys.argv) < 2: + print("Usage: python -m src.cli \"Your research question\"") + sys.exit(1) + topic = sys.argv[1] + graph = build_graph() + state = { + "topic": topic, + "outline": None, + "step_index": 0, + "notes": [], + "final_brief": None, + } + result = asyncio.run(graph.invoke(state)) + # The graph already prints progress. + # Print final brief if not already printed. + if result.get("final_brief"): + print("\n=== Final Brief ===") + print(result["final_brief"]) + +if __name__ == "__main__": + main() \ No newline at end of file