Skip to content

Update: step-by-step progress and # download bar - #258

Merged
vicgupta merged 1 commit into
mainfrom
update-progress
Oct 30, 2026
Merged

vicgupta merged 1 commit into
mainfrom
update-progress

Conversation

@vicgupta

Copy link
Copy Markdown
Owner

tinyagent --update now reports every step and shows a # bar while downloading.

  • Step lines on stderr: current version, query latest release (found vX / already up to date), select asset, download checksums, download binary (URL, then size), verify checksum, install, done.
  • Failures name the step: error: update failed at verify checksum: ... (exit 1).
  • # bar only when stderr is a terminal (existing isTerminal tty helpers): known Content-Length → redrawn [####....] 42% 3.8 MiB / 9.0 MiB; unknown → one # per 256 KiB then the total. Non-TTY: plain lines, no \r.
  • --json: update.step events then update.result on stdout; no bar, stderr only for the error line.
  • Final message still goes to stdout as before.

Tests (fakes, httptest, no network): progress bar known/unknown length, step order and content (TTY and non-TTY), up-to-date path, errors naming the step, JSON reporter, runUpdate text/JSON/error. Docs: README Updating section + feature bullet, new docs/subcommands.md#updating, json-output.md pointer.

--update now prints one 'update: <step>: <detail>' line per step to stderr
(current version, query latest release, select asset, download checksums,
download binary, verify checksum, install, done), and every failure names
its step ('update failed at <step>: ...'). When stderr is a terminal the
binary download draws a '#' bar: percent and bytes with a known
Content-Length, one '#' per 256 KiB otherwise. Non-terminal output has no
carriage returns. With --json, steps and the result are JSONL events on
stdout.
@vicgupta
vicgupta merged commit f975128 into main Oct 30, 2026
1 check passed
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.

1 participant