From d95158b90f64430f1abcc5a2d58599edbf3c5bc0 Mon Sep 17 00:00:00 2001 From: Amp Date: Thu, 26 Nov 2026 15:38:10 +0000 Subject: [PATCH] Respect -n before prompting for an organization With several stored tokens and no default organization, running a command with -n at a terminal reached the organization picker, which failed with a bare "Required." instead of explaining how to choose an organization. Amp-Thread-ID: https://ampcode.com/threads/T-073981ab-5fb5-4154-bd75-f7e64fc0af05 Co-authored-by: Ryan Chandler --- app/Concerns/HasAClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Concerns/HasAClient.php b/app/Concerns/HasAClient.php index ed25919d..502bcd4c 100644 --- a/app/Concerns/HasAClient.php +++ b/app/Concerns/HasAClient.php @@ -116,7 +116,7 @@ function () use ($apiTokens) { } } - if (! stream_isatty(STDIN) || $this->isNonInteractiveEnvironment()) { + if (! $this->isInteractiveSession()) { throw new RuntimeException('Multiple API tokens found. Run `cloud repo:config --organization=` to set a default for this repository, or use `cloud auth:token` to manage tokens.'); }