container icon indicating copy to clipboard operation
container copied to clipboard

Add Environment Variable for Progress Mode

Open nrthakur opened this issue 7 months ago • 5 comments

Type of Change

  • [ ] Bug fix
  • [x] New feature
  • [ ] Breaking change
  • [x] Documentation update

Motivation and Context

Environment Variable for Progress Mode

Adds support for a CONTAINER_CLI_PROGRESS environment variable that allows users to set their preferred default progress mode (none, ansi, plain) without passing --progress on every command.

This follows the same pattern as BUILDKIT_PROGRESS and aligns with the project's transition from macOS user defaults to environment variables for configuration.

Precedence: --progress flag → CONTAINER_CLI_PROGRESS env var → default (ansi)

Affected commands: container image pull, container image push, container run

Note: ~color mode support is commented out, pending merge of #1384. Once merged, uncommenting case color in the enum and updating the help text is all that's needed.~

Closes #1406

Testing

  • [x] Tested locally
  • [x] Added/updated tests
  • [x] Added/updated docs

Test Instructions

# Default (ansi) — no flag, no env var
container image pull alpine

# Env var sets mode
CONTAINER_CLI_PROGRESS=plain container image pull alpine

# Flag overrides env var
CONTAINER_CLI_PROGRESS=plain container --progress ansi image pull alpine

# Env var disables progress
CONTAINER_CLI_PROGRESS=none container image pull alpine

# Invalid env var falls back to default (ansi)
CONTAINER_CLI_PROGRESS=bogus container image pull alpine

nrthakur avatar Apr 10 '26 07:04 nrthakur

@nrthakur You'll likely have a few more conflicts to fix since the plan is to merge #1392 next.

jglogan avatar Apr 10 '26 16:04 jglogan

@nrthakur You'll likely have a few more conflicts to fix since the plan is to merge #1392 next.

@jglogan game over

jk 😛 ~fixing these for now~ fixed; will address conflicts introduced by #1392

Thanks for the heads up!

nrthakur avatar Apr 10 '26 16:04 nrthakur

@nrthakur Did you resolve the conflicts? I currently see two files.

jglogan avatar Apr 11 '26 02:04 jglogan

@nrthakur Did you resolve the conflicts? I currently see two files.

@jglogan Oops, should've been more clear, I had fixed the conflicts introduced by merging my colour PR this morning. Just addressed the conflicts introduced by #1392

This PR should be in a reviewable state now. Thanks!

nrthakur avatar Apr 11 '26 04:04 nrthakur

Hi @jglogan Any updates with this 👀

nrthakur avatar May 27 '26 18:05 nrthakur