Description
Most CLI tools nowadays notify users of updates that can be installed (i.e. ngrok, gh cli, etc.). In many cases, they can update themselves.
This is currently impossible to achieve from within dotnet global tools, since the tool files are locked while it's running, and therefore a dotnet update
command fails since it attempts to delete the version being replaced.
Since the dotnet install
tool can know the originating source for a tool, and there is a built-in API in nuget to check for updates (see this example of how to show pending updates for a global tool, it should be in principle possible to remember the source feed location and check for updates periodically (before, during or after) when the tool is used. I currently run this concurrently in the background while the tool runs and show the updates afterwards.
Ideally, dotnet itself would check for updates and offer to update tools.
/cc @baronfel