hermes - ✅(Solved) Fix Profile wrapper help should display alias name instead of hardcoded hermes [2 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#15698Fetched 2026-04-26 05:25:44
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×2

Root Cause

1. `hermes_cli/main.py:6278` `prog="hermes"` is hardcoded in the top-level ArgumentParser.

2. `hermes_cli/main.py:6281-6314` The epilog examples text is a static string with `hermes` baked in on every line.

3. `hermes_cli/main.py:6168` and `hermes_cli/profiles.py:241` Generated wrapper scripts use `exec hermes -p {name} "$@"` — the binary name is hardcoded rather than derived from `$0`.

Fix Action

Fixed

PR fix notes

PR #15729: fix(cli): display profile wrapper alias name in help text

Description (problem / solution / changelog)

Summary

Profile wrapper help text now displays the alias name (e.g., june) instead of the hardcoded hermes in usage lines and examples.

Root Cause

Three hardcoded areas prevented wrapper-specific help display:

  1. prog="hermes" was hardcoded in the top-level ArgumentParser
  2. Help epilog examples contained static hermes strings
  3. Wrapper scripts used exec hermes -p {name} without passing the actual binary name

Fix

  • Modified wrapper generation in profiles.py and main.py to set HERMES_CLI_NAME env var from $0
  • Added _cli_prog() helper to respect HERMES_CLI_NAME or fall back to sys.argv[0]
  • Added _examples_epilog(prog) helper to interpolate the program name dynamically
  • Updated ArgumentParser to use _cli_prog() and _examples_epilog()

Regression Coverage

Added test_wrapper_includes_hermes_cli_name_env_var to verify wrapper scripts set the env var.

Testing

  • All 91 tests in tests/hermes_cli/test_profiles.py pass
  • Wrapper script generation verified to include HERMES_CLI_NAME="$(basename "$0")"
  • Manual verification of help text output shows wrapper name in usage and examples

Closes #15698

Changed files

  • gateway/platforms/whatsapp.py (modified, +4/-1)
  • hermes_cli/main.py (modified, +51/-36)
  • hermes_cli/profiles.py (modified, +4/-1)
  • tests/hermes_cli/test_profiles.py (modified, +44/-0)
  • tests/tools/test_file_tools.py (modified, +37/-0)
  • tools/file_tools.py (modified, +6/-6)

PR #15758: fix(cli): profile wrappers show alias name instead of hardcoded 'hermes' in --help (#15698)

Description (problem / solution / changelog)

Problem

When hermes profile add june --alias june creates a wrapper, running june --help showed:

usage: hermes [-h] ...

Examples:
    hermes                        Start interactive chat
    hermes chat -q "Hello"        Single query mode
    ...

The alias name was completely invisible to the user — unhelpful and confusing.

Fixes #15698.

Root cause

Two hard-coded "hermes" strings:

  1. hermes_cli/main.pyArgumentParser(prog="hermes", ...) and the epilog examples block were static strings.
  2. hermes_cli/profiles.py — wrapper scripts were exec hermes -p {name} "$@" with no way to propagate the alias name back into the process.

Fix

1. Wrapper scripts now export HERMES_CLI_NAME

#!/bin/sh
HERMES_CLI_NAME="$(basename "$0")" exec hermes -p june "$@"

$(basename "$0") resolves to the invoked name (the alias), and the env var travels transparently into the hermes process. If the user symlinks the wrapper to another name, that name is also picked up correctly.

remove_wrapper_script identifies our wrappers by checking for "hermes -p", which still matches the new template — no regression.

2. _cli_prog() helper in main.py

def _cli_prog() -> str:
    return os.environ.get("HERMES_CLI_NAME") or Path(sys.argv[0]).name or "hermes"

Priority order:

  1. HERMES_CLI_NAME env var (set by wrapper)
  2. Path(sys.argv[0]).name (handles python -m hermes_cli, direct binary invocation)
  3. "hermes" (ultimate fallback)

prog=_cli_prog() is passed to ArgumentParser, and the epilog examples use an f-string so every hermes <cmd> line becomes june <cmd> automatically.

After fix

$ june --help
usage: june [-h] [--version] ...

Examples:
    june                        Start interactive chat
    june chat -q "Hello"        Single query mode
    june -c                     Resume the most recent session
    ...

For more help on a command:
    june <command> --help

Tests

  • TestWrapperScriptContent (3 tests in test_profiles.py):
    • wrapper contains HERMES_CLI_NAME="$(basename "$0")"
    • wrapper still satisfies remove_wrapper_script's safety check
    • shebang is #!/bin/sh
  • TestCliProg (4 tests in test_cli_prog_name.py):
    • env var used when set
    • falls back to argv[0] basename
    • ultimate fallback is "hermes"
    • env var takes precedence over argv[0]

All 7 new tests pass alongside the existing 89 profile tests (96 total).

Checklist

  • No breaking change — bare hermes --help still shows hermes (env var absent)
  • Existing wrappers re-created via hermes profile add pick up the fix; old wrappers continue to work (they just don't set the env var)
  • remove_wrapper_script still works for new wrappers
  • Epilog and prog= are consistent — no mixed branding

Closes #15698

Changed files

  • hermes_cli/main.py (modified, +46/-35)
  • hermes_cli/profiles.py (modified, +16/-2)
  • tests/hermes_cli/test_cli_prog_name.py (added, +31/-0)
  • tests/hermes_cli/test_profiles.py (modified, +82/-0)

Code Example

usage: hermes [-h] [--version] [--resume SESSION] [--continue [SESSION_NAME]] ...

Examples:
    hermes                        Start interactive chat
    hermes chat -q "Hello"        Single query mode
    hermes -c                     Resume the most recent session
    hermes -c "my project"        Resume a session by name

---

usage: hermes cron edit [-h] [--schedule SCHEDULE] [--prompt PROMPT] ...

---

usage: june [-h] [--version] ...

Examples:
    june                        Start interactive chat
    june chat -q "Hello"        Single query mode
    june -c                     Resume the most recent session
    ...

---

#!/bin/sh
HERMES_CLI_NAME="$(basename "$0")" exec hermes -p "$(basename "$0")" "$@"

---

from pathlib import Path
import os

def _cli_prog() -> str:
    return os.environ.get("HERMES_CLI_NAME") or Path(sys.argv[0]).name or "hermes"

---

def _examples_epilog(prog: str) -> str:
    return f"""...
Examples:
    {prog}                        Start interactive chat
    {prog} chat -q "Hello"        Single query mode
...
"""
RAW_BUFFERClick to expand / collapse

Bug Description

When using Hermes profiles as CLI wrappers (e.g. `june`, `cid`, `luna`), the help text still renders as if the command is always `hermes`.

Actual Behavior

`june --help` shows:

usage: hermes [-h] [--version] [--resume SESSION] [--continue [SESSION_NAME]] ...

Examples:
    hermes                        Start interactive chat
    hermes chat -q "Hello"        Single query mode
    hermes -c                     Resume the most recent session
    hermes -c "my project"        Resume a session by name

`june cron edit --help` shows:

usage: hermes cron edit [-h] [--schedule SCHEDULE] [--prompt PROMPT] ...

Expected Behavior

`june --help` should show:

usage: june [-h] [--version] ...

Examples:
    june                        Start interactive chat
    june chat -q "Hello"        Single query mode
    june -c                     Resume the most recent session
    ...

Steps to Reproduce

  1. Create a profile alias wrapper: hermes profile alias june --name june
  2. Ensure june is in PATH
  3. Run june --help — the usage line and examples still say hermes

Root Cause

1. `hermes_cli/main.py:6278` `prog="hermes"` is hardcoded in the top-level ArgumentParser.

2. `hermes_cli/main.py:6281-6314` The epilog examples text is a static string with `hermes` baked in on every line.

3. `hermes_cli/main.py:6168` and `hermes_cli/profiles.py:241` Generated wrapper scripts use `exec hermes -p {name} "$@"` — the binary name is hardcoded rather than derived from `$0`.

Suggested Fix

1. Make wrapper scripts self-aware

Generated wrappers should pass a display name via env var:

#!/bin/sh
HERMES_CLI_NAME="$(basename "$0")" exec hermes -p "$(basename "$0")" "$@"

2. Respect the env var in `main.py`

Add a small helper:

from pathlib import Path
import os

def _cli_prog() -> str:
    return os.environ.get("HERMES_CLI_NAME") or Path(sys.argv[0]).name or "hermes"

Use `prog=_cli_prog()` in the ArgumentParser call instead of `prog="hermes"`.

3. Interpolate the same name into help examples

The epilog could be a function that takes `prog` and returns the formatted string:

def _examples_epilog(prog: str) -> str:
    return f"""...
Examples:
    {prog}                        Start interactive chat
    {prog} chat -q "Hello"        Single query mode
...
"""

This would let subparsers (cron, auth, config, etc.) also render their help with the correct name.

Environment

  • Hermes CLI (hermes-agent latest)
  • Profile wrappers: `hermes profile add <name> --alias <alias>`
  • Wrappers installed to PATH via `~/.local/bin` or similar

extent analysis

TL;DR

Update the Hermes CLI to respect a display name environment variable and modify the wrapper scripts to pass this variable.

Guidance

  • Modify the generated wrapper scripts to include the display name as an environment variable, as suggested in the issue: HERMES_CLI_NAME="$(basename "$0")" exec hermes -p "$(basename "$0")" "$@"
  • Update the main.py file to respect this environment variable by using the _cli_prog() helper function to determine the program name
  • Interpolate the program name into the help examples using a function like _examples_epilog(prog: str) -> str
  • Verify the changes by running the updated wrapper scripts with the --help flag and checking that the usage line and examples display the correct program name

Example

def _cli_prog() -> str:
    return os.environ.get("HERMES_CLI_NAME") or Path(sys.argv[0]).name or "hermes"

def _examples_epilog(prog: str) -> str:
    return f"""...
Examples:
    {prog}                        Start interactive chat
    {prog} chat -q "Hello"        Single query mode
...
"""

Notes

The suggested fix requires modifying the Hermes CLI code and the generated wrapper scripts. This may require updating the Hermes CLI version or applying a patch.

Recommendation

Apply the suggested workaround by updating the wrapper scripts and the Hermes CLI code to respect the display name environment variable. This will allow the wrapper scripts to display the correct program name in their help text.

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