redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

Update outdated version warning in output

Open adamaltman opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

There is no good way to alert users to new updates in the CLI tool.

Describe the solution you'd like

I'd like part of the CLI output to check and show the current version versus the running version. If the current version is different, to show this output... something like

A new version of Redocly CLI (1.0.0-beta.105) is available.
Update now: npx @redocly/cli@latest upgrade
Changelog: {TODO}

Optimal would be an integrated changelog information and show every change between the version installed and the current version.

Describe alternatives you've considered

None yet.

Additional context

Consider also the JSON output format so that it can be parsed and programmatically displayed in Workflows.

adamaltman avatar Jul 27 '22 14:07 adamaltman

redoc-cli team just opened a PR for this too: https://github.com/Redocly/redoc/pull/2100/files. We can use same implementation.

RomanHotsiy avatar Jul 27 '22 15:07 RomanHotsiy

Had to revert this as lint fails in Workflows.

tatomyr avatar Sep 13 '22 15:09 tatomyr

This is fails in Workflows because webpack doesn't work with import-lazy

  • We can fork this repo
  • Or we can use this fork, but it has not been updated for some time
  • We can create our own solution

@tatomyr @RomanHotsiy

IgorKarpiuk avatar Dec 16 '22 15:12 IgorKarpiuk

For the target audience using the CLI either themselves at the terminal, or in a CI setup, the version information and upgrade prompt are really valuable. However since some of our commands output JSON or other formats, would we consider sending this to stderr, or maybe only fitting the output to a subset of commands? And would either of those approaches help with the problem we encountered previously where Workflows tripped up on the extra output?

lornajane avatar Apr 04 '23 10:04 lornajane