diff --git a/cli.py b/cli.py index fc1f9f820..aa98de5aa 100755 --- a/cli.py +++ b/cli.py @@ -4356,6 +4356,7 @@ def main( base_url: str = None, max_turns: int = None, verbose: bool = False, + quiet: bool = False, compact: bool = False, list_tools: bool = False, list_toolsets: bool = False, @@ -4498,10 +4499,23 @@ def main( # Handle single query mode if query: - cli.show_banner() - cli.console.print(f"[bold blue]Query:[/] {query}") - cli.chat(query) - cli._print_exit_summary() + if quiet: + # Quiet mode: suppress banner, spinner, tool previews. + # Only print the final response and parseable session info. + cli.tool_progress_mode = "off" + cli.agent = cli._init_agent() + if cli.agent: + cli.agent.quiet_mode = True + result = cli.agent.run_conversation(query) + response = result.get("final_response", "") if isinstance(result, dict) else str(result) + if response: + print(response) + print(f"\nsession_id: {cli.session_id}") + else: + cli.show_banner() + cli.console.print(f"[bold blue]Query:[/] {query}") + cli.chat(query) + cli._print_exit_summary() return # Run interactive mode diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 21b4ec89f..031acba71 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -486,6 +486,7 @@ def cmd_chat(args): "provider": getattr(args, "provider", None), "toolsets": args.toolsets, "verbose": args.verbose, + "quiet": getattr(args, "quiet", False), "query": args.query, "resume": getattr(args, "resume", None), "worktree": getattr(args, "worktree", False), @@ -1918,6 +1919,11 @@ For more help on a command: action="store_true", help="Verbose output" ) + chat_parser.add_argument( + "-Q", "--quiet", + action="store_true", + help="Quiet mode for programmatic use: suppress banner, spinner, and tool previews. Only output the final response and session info." + ) chat_parser.add_argument( "--resume", "-r", metavar="SESSION_ID",