Skip to content

feat(ux): add progress spinner for long-running commands #75

Description

@fredaluliu

Background

Long-running commands like instance create, tool create currently show no progress feedback. Users see a blank screen for 5-10 seconds without knowing if the CLI is working or hung.

Proposal

Add a progress spinner for commands that take >2s, with -o json silencing:

  • Define ProgressFunc(step string, status Status) callback
  • Text mode: show spinner (e.g. via pterm library) with step description
  • -o json mode: spinner is no-op, stdout stays pure JSON
  • On completion: replace spinner with checkmark/cross

Affected Commands

  • agr instance create (waiting for instance to start)
  • agr tool create (waiting for tool to become ACTIVE)
  • agr instance debug (creating debug tool + waiting)
  • agr pre-cache-image-task create (submitting task)

Expected Behavior

$ agr instance create --tool-id sdt-xxx
⣾ Creating instance...
✓ Instance created: sandbox-abc123
$ agr instance create --tool-id sdt-xxx -o json
{"SchemaVersion":"agr.v1", ...}

Implementation Notes

  • Go library: pterm or briandowns/spinner
  • Spinner writes to stderr (never pollute stdout)
  • Respect --no-color and NO_COLOR env
  • Respect --non-interactive (no spinner)

Category

UX / Safety

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions