From b548dfed3e90db72340358ee0f1f2638105c883a Mon Sep 17 00:00:00 2001 From: Octoturge Date: Wed, 26 Aug 2026 23:58:46 +0200 Subject: [PATCH] cli-setup-wizard: explain why SSH/GPG key setup got skipped The SSH/GPG key-generation question only fires when gh/tea are actually logged in (DID_GITHUB/DID_GITEA), which is correct - but if login was declined, failed, or never completed, the section was skipped with zero explanation. From the user's side that looked like a missing feature rather than an unfinished login. Confirmed on a live workspace: gh was never installed, and tea was installed but `tea login add` never actually completed (no ~/.config/tea/config.yml), so the gate correctly stayed closed - the user just had no way to know why. Now prints a one-line hint (only when gh or tea is installed at all) pointing at the login command and the --force re-run. --- templates/3d-printing/cli-setup-wizard.sh | 6 ++++++ templates/cobol/cli-setup-wizard.sh | 6 ++++++ templates/default/cli-setup-wizard.sh | 6 ++++++ templates/python/cli-setup-wizard.sh | 6 ++++++ templates/ttrpg/cli-setup-wizard.sh | 6 ++++++ templates/web/cli-setup-wizard.sh | 6 ++++++ 6 files changed, 36 insertions(+) diff --git a/templates/3d-printing/cli-setup-wizard.sh b/templates/3d-printing/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/3d-printing/cli-setup-wizard.sh +++ b/templates/3d-printing/cli-setup-wizard.sh @@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then fi fi fi +elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then + # gh and/or tea are installed but neither is actually logged in yet (login + # was declined, failed, or never completed) - say why the key-generation + # question above got skipped instead of just silently not asking. + echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet." + echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force" fi echo "" diff --git a/templates/cobol/cli-setup-wizard.sh b/templates/cobol/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/cobol/cli-setup-wizard.sh +++ b/templates/cobol/cli-setup-wizard.sh @@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then fi fi fi +elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then + # gh and/or tea are installed but neither is actually logged in yet (login + # was declined, failed, or never completed) - say why the key-generation + # question above got skipped instead of just silently not asking. + echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet." + echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force" fi echo "" diff --git a/templates/default/cli-setup-wizard.sh b/templates/default/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/default/cli-setup-wizard.sh +++ b/templates/default/cli-setup-wizard.sh @@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then fi fi fi +elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then + # gh and/or tea are installed but neither is actually logged in yet (login + # was declined, failed, or never completed) - say why the key-generation + # question above got skipped instead of just silently not asking. + echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet." + echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force" fi echo "" diff --git a/templates/python/cli-setup-wizard.sh b/templates/python/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/python/cli-setup-wizard.sh +++ b/templates/python/cli-setup-wizard.sh @@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then fi fi fi +elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then + # gh and/or tea are installed but neither is actually logged in yet (login + # was declined, failed, or never completed) - say why the key-generation + # question above got skipped instead of just silently not asking. + echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet." + echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force" fi echo "" diff --git a/templates/ttrpg/cli-setup-wizard.sh b/templates/ttrpg/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/ttrpg/cli-setup-wizard.sh +++ b/templates/ttrpg/cli-setup-wizard.sh @@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then fi fi fi +elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then + # gh and/or tea are installed but neither is actually logged in yet (login + # was declined, failed, or never completed) - say why the key-generation + # question above got skipped instead of just silently not asking. + echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet." + echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force" fi echo "" diff --git a/templates/web/cli-setup-wizard.sh b/templates/web/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/web/cli-setup-wizard.sh +++ b/templates/web/cli-setup-wizard.sh @@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then fi fi fi +elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then + # gh and/or tea are installed but neither is actually logged in yet (login + # was declined, failed, or never completed) - say why the key-generation + # question above got skipped instead of just silently not asking. + echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet." + echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force" fi echo ""