Skip to content

Rich CLI progress not visible when output captured by non-TTY (subprocess/pipe) #579

@bm-clawd

Description

@bm-clawd

Problem

bm reindex --embeddings uses Rich progress bars that render correctly in a real terminal but are not visible when output is captured by a subprocess or piped (non-TTY context). This affects tools/plugins that shell out to bm CLI commands.

Observed Behavior

When called from a plugin subprocess:

Project: claw
  Building vector embeddings...
[... 74 seconds of silence ...]
    Embedding entities... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%

The progress bar only appears at completion because Rich detects non-TTY and doesn't flush incremental updates.

Expected Behavior

When not connected to a TTY, fall back to simple log-style progress lines:

Embedded 10/66 entities...
Embedded 20/66 entities...

Impact

Low for direct CLI users. Confusing for plugin/tooling integrations — looks like a hang on slower hardware (74s on Intel Mac at 394% CPU).

Note

This is a known Rich library behavior. Fix options:

  • Detect non-TTY and use Console(force_terminal=False) with plain text fallback
  • Add --no-rich / --plain flag
  • Log progress lines alongside Rich output

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions