Skip to content

Respect -n before prompting for an organization - #312

Open
ryangjchandler wants to merge 1 commit into
mainfrom
fix-org-picker-no-interaction
Open

ryangjchandler wants to merge 1 commit into
mainfrom
fix-org-picker-no-interaction

Conversation

@ryangjchandler

@ryangjchandler ryangjchandler commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

With API tokens for more than one organization and no default organization set for the repository, running a command non-interactively from a terminal still opens the organization picker. That prompt can't be answered, so the command fails with no hint about what is missing:

$ cloud deploy my-app production -n
{"error":true,"message":"Required."}

--json without -n is worse: it waits at the hidden picker with no output.

After this change, -n, --no-interaction, and --json print the existing "Multiple API tokens found" message, which says how to choose an organization. Running without those flags still shows the picker.

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 <ryan@laravel.com>
@ryangjchandler
ryangjchandler marked this pull request as ready for review November 26, 2026 15:42
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