Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/goose-cli/src/commands/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,20 @@ use goose::providers::{create, providers, retry_operation, RetryConfig};
use goose::session::SessionType;
use serde_json::Value;
use std::collections::HashMap;
use std::io::IsTerminal;

// useful for light themes where there is no discernible colour contrast between
// cursor-selected and cursor-unselected items.
const MULTISELECT_VISIBILITY_HINT: &str = "<";

pub async fn handle_configure() -> anyhow::Result<()> {
if !std::io::stdin().is_terminal() {
anyhow::bail!(
"goose configure requires an interactive terminal.\n\
If you installed via 'curl ... | bash', run 'goose configure' separately after installation."
);
}

let config = Config::global();

if !config.exists() {
Expand Down
10 changes: 9 additions & 1 deletion download_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,15 @@ if [ "$CONFIGURE" = true ]; then
echo ""
echo "Configuring goose"
echo ""
"$GOOSE_BIN_DIR/$OUT_FILE" configure
if [ -t 0 ]; then
"$GOOSE_BIN_DIR/$OUT_FILE" configure
elif [ -r /dev/tty ]; then
"$GOOSE_BIN_DIR/$OUT_FILE" configure < /dev/tty
Comment on lines +315 to +316

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Verify /dev/tty is openable before using it for configure

The new non-interactive branch assumes [ -r /dev/tty ] means stdin can be redirected from /dev/tty, but in many CI/container contexts /dev/tty is readable yet not attached to a controlling terminal; < /dev/tty then fails with No such device or address. Because the script runs with set -e, this aborts installation instead of falling back to the intended “skip configure” path, so curl ... | bash automation can still fail unexpectedly.

Useful? React with 👍 / 👎.

else
echo "Non-interactive shell detected (e.g. 'curl ... | bash')."
echo "Skipping 'goose configure' — please run it manually after installation:"
echo " $GOOSE_BIN_DIR/$OUT_FILE configure"
fi
else
echo "Skipping 'goose configure', you may need to run this manually later"
fi
Expand Down
Loading