Skip to content

fix: install and log in the DeepSQL CLI during install.sh - #27

Merged
geekypunk merged 1 commit into
mainfrom
fix/install-cli-auto-login
Aug 9, 2026
Merged

fix: install and log in the DeepSQL CLI during install.sh#27
geekypunk merged 1 commit into
mainfrom
fix/install-cli-auto-login

Conversation

@geekypunk

Copy link
Copy Markdown
Contributor

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.

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.
@geekypunk
geekypunk merged commit 8a8483e into main Aug 9, 2026
7 checks passed
@geekypunk
geekypunk deleted the fix/install-cli-auto-login branch August 9, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant