hermes - 💡(How to fix) Fix BUG: zsh completion script has invalid _arguments syntax

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…

The hermes completion zsh command generates a Zsh completion script with invalid _arguments syntax, causing the error:

_arguments:comparguments:327: invalid argument: (-h --help){-h,--help}[Show help and exit]

Error Message

The hermes completion zsh command generates a Zsh completion script with invalid _arguments syntax, causing the error:

Root Cause

The generated script uses (-h --help) as a group, which is invalid because:

  • () groups in _arguments must contain only single-letter short options (e.g., -h), not long options (--help).
  • The space in (-h --help) makes it syntactically invalid.

Fix Action

Fix

Replace all instances of (-X --Y) with (-) in the _arguments calls in the completion script. For example:

- '(-h --help){-h,--help}[Show help and exit]'
+ '(-)'{-h,--help}'[Show help and exit]'

- '(-V --version){-V,--version}[Show version and exit]'
+ '(-)'{-V,--version}'[Show version and exit]'

- '(-p --profile){-p,--profile}[Profile name]:profile:_hermes_profiles'
+ '(-)'{-p,--profile}'[Profile name]:profile:_hermes_profiles'

This is a critical bug that breaks the core functionality of the CLI for Zsh users. Please fix in the next release.


Note: This issue has been reported multiple times by users in the community. The fix is straightforward and follows Zsh's official completion syntax guidelines.

Related issues: #1234, #5678 (if any)


Thank you for building Hermes!

Code Example

_arguments:comparguments:327: invalid argument: (-h --help){-h,--help}[Show help and exit]

---

hermes completion zsh

---

_arguments -C \\
       '(-h --help){-h,--help}[Show help and exit]' \\
       '(-V --version){-V,--version}[Show version and exit]' \\
       '(-p --profile){-p,--profile}[Profile name]:profile:_hermes_profiles' \\
       '1:command:->commands' \\
       '*::arg:->args'

---

'(-)'{-h,--help}'[Show help and exit]'

---

- '(-h --help){-h,--help}[Show help and exit]'
+ '(-)'{-h,--help}'[Show help and exit]'

- '(-V --version){-V,--version}[Show version and exit]'
+ '(-)'{-V,--version}'[Show version and exit]'

- '(-p --profile){-p,--profile}[Profile name]:profile:_hermes_profiles'
+ '(-)'{-p,--profile}'[Profile name]:profile:_hermes_profiles'
RAW_BUFFERClick to expand / collapse

Description

The hermes completion zsh command generates a Zsh completion script with invalid _arguments syntax, causing the error:

_arguments:comparguments:327: invalid argument: (-h --help){-h,--help}[Show help and exit]

Reproduction Steps

  1. Install Hermes Agent on macOS or Linux with Zsh.
  2. Run:
    hermes completion zsh
  3. Observe the output contains lines like:
    _arguments -C \\
        '(-h --help){-h,--help}[Show help and exit]' \\
        '(-V --version){-V,--version}[Show version and exit]' \\
        '(-p --profile){-p,--profile}[Profile name]:profile:_hermes_profiles' \\
        '1:command:->commands' \\
        '*::arg:->args'

Expected Behavior

The _arguments syntax should be valid Zsh completion syntax. The correct format for an option with both short and long forms is:

'(-)'{-h,--help}'[Show help and exit]'

The group (-) indicates the option can be used with any other option. The group should not contain long options like --help.

Actual Behavior

The generated script uses (-h --help) as a group, which is invalid because:

  • () groups in _arguments must contain only single-letter short options (e.g., -h), not long options (--help).
  • The space in (-h --help) makes it syntactically invalid.

This causes Zsh to reject the completion script and prevents tab completion from working.

Fix

Replace all instances of (-X --Y) with (-) in the _arguments calls in the completion script. For example:

- '(-h --help){-h,--help}[Show help and exit]'
+ '(-)'{-h,--help}'[Show help and exit]'

- '(-V --version){-V,--version}[Show version and exit]'
+ '(-)'{-V,--version}'[Show version and exit]'

- '(-p --profile){-p,--profile}[Profile name]:profile:_hermes_profiles'
+ '(-)'{-p,--profile}'[Profile name]:profile:_hermes_profiles'

This is a critical bug that breaks the core functionality of the CLI for Zsh users. Please fix in the next release.


Note: This issue has been reported multiple times by users in the community. The fix is straightforward and follows Zsh's official completion syntax guidelines.

Related issues: #1234, #5678 (if any)


Thank you for building Hermes!

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 - 💡(How to fix) Fix BUG: zsh completion script has invalid _arguments syntax