Skip to content

Show workspace folder + git branch in Hermes status #12267

@timfewi

Description

@timfewi

Title

Show workspace current folder + git branch in Hermes status

Summary

Enhance the Hermes CLI status experience by displaying the user’s current workspace context (current folder + git branch when available) in:

  • the TUI footer/status bar
  • the hermes status command output

This helps users quickly confirm where they are working and which branch they’re on, without opening a separate shell command.

Motivation / Problem

Today, the Hermes status UI primarily focuses on model/provider/session metrics. When working across multiple repos/workspaces, it’s easy to lose track of the current directory and active git branch.

Proposed Change

  1. TUI status bar (footer)
  • Add workspace_short: a compact representation of the current folder.
  • Add git_branch: a short git branch name when the current folder is inside a git repo.
  • Make the status bar width-aware so workspace/branch labels don’t wrap or create duplicate rows on narrow terminals.
  • Avoid excessive git calls by caching the branch lookup briefly.
  1. hermes status command
  • Print two additional environment lines:
    • Current Folder: <resolved path>
    • Git Branch: <branch> or (not a git repo) when lookup fails.
  1. Tests
  • Add/extend unit tests to cover snapshot fields (workspace_short, git_branch) and width-aware status bar rendering.

Acceptance Criteria

  • Running hermes status includes “Current Folder” and “Git Branch” lines.
  • When executed inside a git repo, “Git Branch” displays the current branch.
  • When executed outside a git repo, “Git Branch” shows (not a git repo).
  • The TUI footer/status bar remains single-line and readable on narrow terminal widths.

Notes / Implementation Details

  • Workspace and git branch are derived from TERMINAL_CWD when set, otherwise from the current process working directory.
  • Git branch resolution is best-effort and should never break status rendering if git is unavailable.

Labels (optional)

  • ui
  • cli
  • status-bar

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions