Skip to content

promtop: show the version in the terminal UI, the web page and promtop version - #8

Merged
igorrius merged 2 commits into
mainfrom
version-info
Oct 29, 2026
Merged

igorrius merged 2 commits into
mainfrom
version-info

Conversation

@igorrius

Copy link
Copy Markdown
Owner

Why

promtop -version printed dev for anything but a release build, because go install does not set ldflags. Neither the terminal UI nor the web page showed a version, and the flag was missing from the README.

What

internal/version.Get works out the version in this order:

Build Shown
release (goreleaser ldflags) 0.3.0
go install …@v0.3.0 module version, 0.3.0
local build from git the tag or commit Go stamps, e.g. 0.3.0+dirty
promtop/dash inside a service promtop's dependency version, never the service's commit

Where it shows:

  • promtop version, as well as -version.
  • The help screen (?): "promtop 0.3.0 — live terminal view…".
  • The web page header, next to the name. This includes the w key's dashboard and dash. The value comes in the frame's version field.
  • dash uses the same package for its User-Agent.

Tests

  • internal/version covers each build kind, including a replaced dependency.
  • There are tests for the help screen, the web frame and the version command.
  • make test and golangci-lint pass.
  • On the demo, the event stream carries "version":"0.3.0+dirty".

This PR is independent of #7.

🤖 Generated with Claude Code

https://claude.ai/code/session_01US3HyE2LFapBHwkSQRKHsv

…p version

-version printed "dev" for anything but a release build, and neither the
terminal UI nor the web page showed a version at all.

internal/version picks it from the release ldflags, else the module
version (go install …@v0.3.0, or promtop/dash built into a service),
else the git tag or commit of a local build. The help screen (?) and
the web page next to the name show it, the w key's dashboard and dash
included; "promtop version" prints it like -version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01US3HyE2LFapBHwkSQRKHsv
@igorrius igorrius self-assigned this Oct 29, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01US3HyE2LFapBHwkSQRKHsv
@igorrius
igorrius merged commit 72b0592 into main Oct 29, 2026
5 checks passed
@igorrius
igorrius deleted the version-info branch October 29, 2026 16:14
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