Skip to content

Commit d809f43

Browse files
authored
Skip interactive setup wizard in non-TTY environments (#353)
* Skip interactive setup wizard in non-TTY environments When the install script runs without a terminal (e.g. from Claude Code, CI, or piped input), the interactive setup wizard hangs on TUI prompts. Detect non-TTY and run `basecamp setup claude` non-interactively instead, which installs the agent skill, Claude plugin, and marketplace registration without prompts. Auth remains the only manual step. Also adds BASECAMP_SKIP_SETUP=1 env var for explicit opt-out when a TTY is present. * Let stderr through from non-interactive setup claude Remove 2>/dev/null so failures from 'basecamp setup claude' are visible and diagnosable. Keep || true since the agent setup is best-effort — the binary install already succeeded at this point.
1 parent b0da27f commit d809f43

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

install.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Run this in your terminal:
2222
curl -fsSL https://basecamp.com/install-cli | bash
2323
```
2424

25+
> **Note:** The install script auto-detects non-interactive environments (CI, piped input, coding agents) and skips the interactive setup wizard. You can also explicitly skip it with `BASECAMP_SKIP_SETUP=1`.
26+
2527
Alternatively install manually:
2628

2729
### Option A: Homebrew (macOS/Linux) — Recommended

scripts/install.sh

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
# curl -fsSL https://raw.githubusercontent.com/basecamp/basecamp-cli/main/scripts/install.sh | bash
66
#
77
# Options (via environment):
8-
# BASECAMP_BIN_DIR Where to install binary (default: ~/.local/bin)
9-
# BASECAMP_VERSION Specific version to install (default: latest)
8+
# BASECAMP_BIN_DIR Where to install binary (default: ~/.local/bin)
9+
# BASECAMP_VERSION Specific version to install (default: latest)
10+
# BASECAMP_SKIP_SETUP Set to 1 to skip the interactive setup wizard after install
1011

1112
set -euo pipefail
1213

@@ -328,7 +329,30 @@ main() {
328329
verify_install "$platform"
329330

330331
echo ""
331-
"$BIN_DIR/$binary_name" setup
332+
333+
# Run interactive setup wizard only when stdin is a TTY and not explicitly skipped.
334+
# Non-interactive environments (CI, piped input, coding agents like Claude Code)
335+
# get the agent skill installed and next-step instructions instead — the wizard
336+
# requires interactive prompts that don't work without a terminal.
337+
if [[ "${BASECAMP_SKIP_SETUP:-}" == "1" ]]; then
338+
step "Skipping setup wizard (BASECAMP_SKIP_SETUP=1)"
339+
"$BIN_DIR/$binary_name" setup claude || true
340+
echo ""
341+
echo " Next steps:"
342+
echo " $(bold "basecamp auth login") Authenticate with Basecamp"
343+
echo " $(bold "basecamp setup") Run interactive setup wizard"
344+
echo ""
345+
elif [[ -t 0 ]] && [[ -t 1 ]]; then
346+
"$BIN_DIR/$binary_name" setup
347+
else
348+
info "Skipping interactive setup (no terminal detected)."
349+
"$BIN_DIR/$binary_name" setup claude || true
350+
echo ""
351+
echo " Next steps:"
352+
echo " $(bold "basecamp auth login") Authenticate with Basecamp"
353+
echo " $(bold "basecamp setup") Run interactive setup wizard"
354+
echo ""
355+
fi
332356
}
333357

334358
main "$@"

0 commit comments

Comments
 (0)