hermes - ✅(Solved) Fix feat(cli): add --initial PROMPT to hermes chat for seeded interactive sessions [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#19675Fetched 2026-05-05 06:05:37
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×1

Root Cause

  • hermes chat -q QUERY runs once and exits
  • hermes -z PROMPT is oneshot, also exits
  • hermes chat --resume <id> requires a pre-existing session and adds no new turn
  • piping to stdin hangs because chat needs a tty

Fix Action

Fix / Workaround

why not a workaround

PR fix notes

PR #20031: feat(cli): add initial chat prompt flag

Description (problem / solution / changelog)

Summary

  • add hermes chat -i/--initial for a seeded first prompt that keeps the classic chat REPL open
  • forward the new flag through cmd_chat into cli.main()
  • queue the initial prompt at interactive startup so existing cli.chat() handling, tools, skills, memory, and session setup are reused

Fixes #19675

Tests

  • scripts/run_tests.sh tests/hermes_cli/test_chat_skills_flag.py tests/cli/test_cli_init.py
  • git diff --check

Changed files

  • cli.py (modified, +8/-2)
  • hermes_cli/_parser.py (modified, +5/-0)
  • hermes_cli/main.py (modified, +1/-0)
  • tests/cli/test_cli_init.py (modified, +34/-0)
  • tests/hermes_cli/test_chat_skills_flag.py (modified, +24/-0)
RAW_BUFFERClick to expand / collapse

hermes chat is fully interactive, but there is no way to start it with a first user message already in the conversation. The single-query options all break interactivity:

  • hermes chat -q QUERY runs once and exits
  • hermes -z PROMPT is oneshot, also exits
  • hermes chat --resume <id> requires a pre-existing session and adds no new turn
  • piping to stdin hangs because chat needs a tty

That blocks launchers and wrappers that want to open hermes in a fresh terminal tab pre-seeded with context: thread-resolution prompts, project briefings, agent handoffs from claude or codex, and so on. claude "PROMPT" and codex "PROMPT" both accept a positional initial prompt and keep the REPL alive afterwards; hermes has no equivalent.

proposal

Add -i / --initial PROMPT to hermes chat:

  1. accept a prompt string with the same rules as -q
  2. inject it as the first user message in the conversation
  3. run that turn through cli.chat() so tools, skills, memory, and AGENTS.md load normally
  4. fall through to interactive cli.run() instead of returning

touch points

The diff is small:

  • hermes_cli/_parser.py:237: register -i, --initial next to -q, --query
  • hermes_cli/main.py:1316-1340: thread args.initial into the kwargs forwarded to cli.main()
  • cli.py:11976: add an if initial: branch that runs one turn and falls through to cli.run() at line 12039, instead of returning at line 12036 like the existing if query or image: branch does

why not a workaround

  • pty-driven send-keys (kitty send-text, tmux send-keys) is terminal-specific, races against Rich/Textual UI startup, and breaks on multi-line prompts without bracketed-paste tricks
  • a plugin that calls cli._pending_input.put(msg) works in-process but every user has to install and enable it
  • both reimplement logic the CLI already has for -q

related merged PRs

Small chat-flag PRs have been accepted before:

  • #4314 added --max-turns
  • #11024 tightened -Q quiet mode

extent analysis

TL;DR

Add an -i / --initial option to hermes chat to allow starting the conversation with a predefined user message.

Guidance

  • Implement the proposed -i / --initial option in hermes_cli/_parser.py and hermes_cli/main.py to accept and inject the initial prompt.
  • Modify cli.py to run the initial prompt as the first turn and then fall through to interactive mode.
  • Test the new option with various prompts to ensure it works as expected and doesn't break existing functionality.
  • Consider adding documentation for the new option to help users understand its usage.

Example

No code snippet is provided as the issue already includes a detailed proposal for the changes.

Notes

The proposed solution seems to be a straightforward addition to the existing codebase, but it's essential to test it thoroughly to avoid introducing any regressions.

Recommendation

Apply the proposed workaround by adding the -i / --initial option to hermes chat, as it provides a clean and terminal-agnostic solution that leverages the existing CLI logic.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix feat(cli): add --initial PROMPT to hermes chat for seeded interactive sessions [1 pull requests, 1 participants]