Introduction
Hermes supports two fundamentally different ways of being run. Interactive is what you get when you type hermes, an open-ended back-and-forth session. Single-query is what you get when you run hermes -z "...", one input, one final answer, nothing else printed. Knowing when each one beats the other is the difference between using Hermes and building with it.
Key Concepts
- Interactive mode: A session you join and leave. Multi-turn, exploratory, conversational.
- Single-query mode (
-z): A scripted call. One prompt in, one final response on stdout. - Quiet output:
-zstrips banners, status bars, and tool chatter so output is pipeable.
Real World Context
A developer tweaking a function uses interactive mode, they are going to bounce ideas, look at multiple drafts, change direction. A script that needs to summarize a daily log file uses -z: the script does not want a TUI, it wants a string. The same agent, the same provider, the same skills, but completely different surfaces because the caller is different.
Deep Dive
Two shapes side by side
bash# Interactive, you are the caller hermes > "help me refactor this controller..." # Single-query, a script is the caller hermes -z "summarize the diff in HEAD~1..HEAD" > /tmp/digest.md
When single-query wins
- In automation: cron jobs, hooks, CI steps that need an answer to compose the next step.
- In pipes: anywhere stdout needs to feed another command without parsing prompts.
- In hot paths: short, well-specified tasks where any interaction is overhead.
When interactive wins
- Open-ended work: "I'm not sure what shape the answer takes yet."
- Iteration: changing course based on the previous response.
- Pairing: humans-in-the-loop on creative or architectural decisions.
The hidden third option
You can mix both. A script can call hermes -z to get a structured plan, then a human jumps into hermes --continue to refine it interactively, same session, two callers.
Common Pitfalls
- Reaching for interactive when
-zwould do, If you find yourself typing the same prompt every morning, that is a-zcandidate. - Trying to script around interactive output, Do not
expectyour way through a TUI.-zexists for exactly this reason.
Best Practices
- Default to interactive for thinking,
-zfor shipping, Interactive when you are exploring,-zwhen the prompt is fixed. - Use
-zin hooks and cron, Quiet output is a feature: it composes with the rest of the shell.
Summary
- Interactive sessions are open-ended; single-query (
-z) is one-shot. -zoutputs only the final answer, perfect for pipes and scripts.- Match the mode to the caller: humans get interactive, scripts get
-z. - The two modes share the same agent, switching surfaces costs nothing.
Code Examples
# Daily log digest, fully scripted, no TUI, no prompt parsing, just a string
digest=$(hermes -z "Summarize the last 24h of /var/log/app.log into 5 bullets")
echo "$digest" | mail -s "Daily digest" team@example.com
# A human picks up the same agent for follow-up
hermes --continue # opens the most recent session, fully interactive