tursodatabase/turso-cli

Check if TURSO_API_TOKEN is set before calling login at end of install

Closed this issue · 7 comments

e.g. for headless environments where there's not a browser like in Docker.

Or probably just in general check if the user is in a headless environment. If TURSO_API_TOKEN is set then say something like "you're already logged in!" and if not, say they should set the env var.

Is it not suitable to simply install straight from the releases page and tar -xzf?
e.g. https://github.com/chiselstrike/homebrew-tap/releases/download/$VERSION/homebrew-tap_Linux_x86_64.tar.gz

I believe the install script is built for an interactive install experience. For a headless/automated setup I think you'd want to define these steps yourself.

No I very much want an install script for headless/automated environments. I don't want to have to figure out what the latest version is. I don't want to figure out which architecture I'm on atm. I don't want to decide where to write the binary and how to update $PATH on this particular setup, etc. This is of course why most software in Linux is installed via Apt, etc.

trompx commented

So is there a solution? Just tried installing turso in docker and it failed with:
Error: failed to open browser, please use the --headless command line option E.g. turso auth login --headless

I'd like to install turso then handle the token when I run the docker container.

Hello! For headless environments, CI CDs, we recommend setting environment variable
TURSO_INSTALL_SKIP_SIGNUP=true and then installing. This will skip sign up step. In addition, you also need to set TURSO_API_TOKEN of course.

e.g. https://github.com/tursodatabase/turso-install/blob/f3de660/.github/workflows/test-install.yml

Seems to be solved with TURSO_INSTALL_SKIP_SIGNUP. Closing now. Please reopen @KyleAMathews if that's not fixing the problem for you.