Skip to content

Add progress bar to knife ssh command#167

Open
aknarts wants to merge 1 commit into
chef:mainfrom
aknarts:add-ssh-progress-bar
Open

Add progress bar to knife ssh command#167
aknarts wants to merge 1 commit into
chef:mainfrom
aknarts:add-ssh-progress-bar

Conversation

@aknarts

@aknarts aknarts commented May 27, 2026

Copy link
Copy Markdown

Description

Display a pinned ANSI progress bar at the bottom of the terminal during knife ssh execution showing completed/total nodes, percentage, and ETA. The bar is automatically enabled when stderr is a TTY and can be controlled with --[no-]progress.

The progress bar:

  • Tracks node completion via exit-status callbacks
  • Clears itself around output lines to avoid collision
  • Shows failed node count in red when applicable
  • Prints a summary line on completion
  • Gracefully degrades (no-op) for non-TTY or single-node runs
Screenshot from 2026-05-27 11-55-16

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

@aknarts aknarts requested review from a team and jaymzh as code owners May 27, 2026 10:13
Display a pinned ANSI progress bar at the bottom of the terminal
during knife ssh execution showing completed/total nodes, percentage,
and ETA. The bar is automatically enabled when stderr is a TTY and
can be controlled with --[no-]progress.

The progress bar:
- Tracks node completion via exit-status callbacks
- Clears itself around output lines to avoid collision
- Shows failed node count in red when applicable
- Prints a summary line on completion
- Gracefully degrades (no-op) for non-TTY or single-node runs

Signed-off-by: Milan Šťastný <mistastn@cisco.com>
@jaymzh jaymzh force-pushed the add-ssh-progress-bar branch from e6d8615 to 66bf885 Compare June 3, 2026 23:13

@jaymzh jaymzh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code breaks the mocks in the unittests, please fix them, @aknarts .

Other than that the code looks sane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants