fix: install and log in the DeepSQL CLI during install.sh - #27
Merged
Conversation
Previously install.sh only reported the CLI's install/update status at the end of a run — it never installed it, so a fresh self-host following the README end to end had no `deepsql` command at all, and never logged it in against the stack it just created. setup_deepsql_cli() now: - installs @deepsql/mcp via `npm i -g` when missing, retrying once with non-interactive `sudo -n` (never an interactive sudo prompt buried in an otherwise unattended installer) - logs the CLI in as the admin account install.sh just created, via the --password/--password-stdin flow, using the already-required DEEPSQL_INITIAL_ADMIN_EMAIL/DEEPSQL_INITIAL_ADMIN_PASSWORD - skips login if a token already exists for this URL, so re-running install.sh (upgrades, credential rotation) doesn't pile up tokens under `deepsql whoami` Every step stays non-fatal, consistent with the rest of the script: install or login failure prints the manual command and falls through rather than aborting. Verified against a live self-hosted stack: detects an existing install, skips a redundant login when already authorized, and (separately, on a fresh venv) performs a clean install + password-stdin login end to end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously install.sh only reported the CLI's install/update status at the
end of a run — it never installed it, so a fresh self-host following the
README end to end had no
deepsqlcommand at all, and never logged it inagainst the stack it just created.
setup_deepsql_cli() now:
npm i -gwhen missing, retrying once withnon-interactive
sudo -n(never an interactive sudo prompt buried in anotherwise unattended installer)
--password/--password-stdin flow, using the already-required
DEEPSQL_INITIAL_ADMIN_EMAIL/DEEPSQL_INITIAL_ADMIN_PASSWORD
install.sh (upgrades, credential rotation) doesn't pile up tokens under
deepsql whoamiEvery step stays non-fatal, consistent with the rest of the script: install
or login failure prints the manual command and falls through rather than
aborting.
Verified against a live self-hosted stack: detects an existing install,
skips a redundant login when already authorized, and (separately, on a
fresh venv) performs a clean install + password-stdin login end to end.