hermes - 💡(How to fix) Fix Feature Request: Self-diagnosis for command hijacking conflicts in hermes doctor [1 pull requests]

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…

Fix Action

Fixed

Code Example

# User mistakenly installs wrong package
npm install -g hermes-cli

# Now 'hermes' points to the wrong binary
which hermes
# → ~/.npm-global/bin/hermes (wrong!)

# Hermes doctor doesn't detect this conflict
hermes doctor
# → All checks pass (but command is hijacked)

---

# In hermes_cli/doctor.py

def check_command_hijacking():
    """Check if hermes command is hijacked by other packages."""
    hermes_path = shutil.which("hermes")
    expected_path = get_hermes_binary_path()
    
    if hermes_path != expected_path:
        return DiagnosticResult(
            status="warning",
            message=f"hermes command points to {hermes_path}, expected {expected_path}",
            suggestion="Check for conflicting npm packages: npm list -g hermes hermes-cli"
        )
    
    # Check npm global conflicts
    npm_packages = run("npm list -g --depth=0 2>/dev/null")
    if "hermes" in npm_packages or "hermes-cli" in npm_packages:
        return DiagnosticResult(
            status="warning", 
            message="Found conflicting npm packages",
            suggestion="Run: npm uninstall -g hermes hermes-cli"
        )
RAW_BUFFERClick to expand / collapse

title: "Feature Request: Self-diagnosis for command hijacking conflicts in hermes doctor" labels: ["enhancement", "cli"] assignees: []

Problem

When a user accidentally installs a conflicting npm package with a similar name (e.g., hermes-cli which is a Brazilian travel agency search tool, not Hermes Agent), the hermes command gets hijacked. Hermes currently cannot detect this issue.

Example Scenario

# User mistakenly installs wrong package
npm install -g hermes-cli

# Now 'hermes' points to the wrong binary
which hermes
# → ~/.npm-global/bin/hermes (wrong!)

# Hermes doctor doesn't detect this conflict
hermes doctor
# → All checks pass (but command is hijacked)

Requested Functionality

  1. Command path verification: hermes doctor should check if the hermes command points to the correct binary
  2. Conflict detection: Detect common conflicts from npm global packages named hermes, hermes-cli, etc.
  3. Actionable suggestions: Provide fix commands (e.g., npm uninstall -g hermes-cli)
  4. Optional auto-fix: Auto-fix symlink issues when user approves

Suggested Implementation

# In hermes_cli/doctor.py

def check_command_hijacking():
    """Check if hermes command is hijacked by other packages."""
    hermes_path = shutil.which("hermes")
    expected_path = get_hermes_binary_path()
    
    if hermes_path != expected_path:
        return DiagnosticResult(
            status="warning",
            message=f"hermes command points to {hermes_path}, expected {expected_path}",
            suggestion="Check for conflicting npm packages: npm list -g hermes hermes-cli"
        )
    
    # Check npm global conflicts
    npm_packages = run("npm list -g --depth=0 2>/dev/null")
    if "hermes" in npm_packages or "hermes-cli" in npm_packages:
        return DiagnosticResult(
            status="warning", 
            message="Found conflicting npm packages",
            suggestion="Run: npm uninstall -g hermes hermes-cli"
        )

Constraints

  • Cross-platform: works on Linux, macOS, Windows (native + WSL)
  • Should not break existing functionality
  • Low priority warning (not blocking operations)

Impact

This would prevent user confusion when they accidentally install wrong packages with similar names, making Hermes more self-healing and robust.

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 Feature Request: Self-diagnosis for command hijacking conflicts in hermes doctor [1 pull requests]