Skip to content

Improve non-interactive handling in CLI and install script#8995

Open
begelundmuller wants to merge 12 commits intomainfrom
begelundmuller/auto-detect-non-interactive
Open

Improve non-interactive handling in CLI and install script#8995
begelundmuller wants to merge 12 commits intomainfrom
begelundmuller/auto-detect-non-interactive

Conversation

@begelundmuller
Copy link
Contributor

@begelundmuller begelundmuller commented Mar 9, 2026

This PR has various refactors that improve our handling of non-interactive environments (such as coding agents):

  • Adds detection for non-interactive shells (CI, agents, etc.) in CLI and scripts/install.sh
  • Updates scripts/install.sh to default to local directory installs in non-interactive mode
  • Simplifies the various interactive prompt helpers (e.g. SelectPrompt, ConfirmPrompt, InferProjectName)
  • Guards all interactive prompts with ch.Interactive checks so commands fail clearly in non-interactive mode

Contributes to https://linear.app/rilldata/issue/PLAT-433/get-claude-to-vibe-code-a-rill-project-without-any-prior-manual-setup

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@begelundmuller begelundmuller changed the title Auto-detect non-interactive environments in CLI and install script Improve non-interactive handling in CLI and install script Mar 9, 2026
@begelundmuller begelundmuller self-assigned this Mar 9, 2026
@begelundmuller begelundmuller requested a review from k-anshul March 10, 2026 13:24
}
if !ok {
return nil
if ch.Interactive {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be disabled in non-interactive mode just to be safe ?

if ch.Interactive {
confirm, err := cmdutil.ConfirmPrompt(fmt.Sprintf("Are you sure you want to delete user %q?", email), "", false)
if err != nil {
if err := cmdutil.ConfirmPrompt(fmt.Sprintf("Are you sure you want to delete user %q?", email), false); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to other comment, maybe destructive sudo commands should be disabled in non-interactive mode ?

if !ok {
ch.PrintfWarn("Aborted\n")
return nil
if ch.Interactive {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to sudo commands maybe this should not be allowed in non-interactive mode as well ?


# If the install directory is not set, or the previous installation path requires sudo, we default to installing in the current directory
if [ -z "$INSTALL_DIR" ] || ! installDirIsWritable; then
printf "Non-interactive shell detected; defaulting to install in current directory.\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be also state that Non-interactive shell detected; Previous installation at '/usr/local/bin' requires elevated permissions; defaulting to install in current directory.

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.

2 participants