tursodatabase / turso-cli

Command line interface to Turso.
https://turso.tech
MIT License
215 stars 35 forks source link

[RFE] self updating cli #266

Closed dyasny closed 1 year ago

dyasny commented 1 year ago

As a user I'd like to be able to update the cli client using a command like turso update

This is a very common feature for such tools

CodingDoug commented 1 year ago

This makes sense when the CLI is installed from get.tur.so piped to a shell installer, but I'm curious how would you expect it to work if the installation came from homebrew or some other package manager that retains its own metadata about the current installation?

dyasny commented 1 year ago

This makes sense when the CLI is installed from get.tur.so piped to a shell installer, but I'm curious how would you expect it to work if the installation came from homebrew or some other package manager that retains its own metadata about the current installation?

Well, I suppose you should be able to just update via brew, of course. We could set a flag that detects non get.tur.so installs and when turso update is executed, we check for the flag and warn the user that the initial install was done via a package manager and it is recommended to update via the same package manager.

athoscouto commented 1 year ago

@CodingDoug we could use flyctl as a reference here. They allow homebrew installation and have logic to both detect and update it. Code here.

CodingDoug commented 1 year ago

we could use flyctl as a reference here.

That's cool!

glommer commented 1 year ago

@athoscouto another option is that the cli binary could be a wrapper that calls ~/.turso/bin/real-cli, and we then auto-download real-cli