Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefect --prompt/--no-prompt to force toggle interactive CLI sessions #9897

Merged
merged 6 commits into from
Jun 12, 2023

Conversation

zanieb
Copy link
Contributor

@zanieb zanieb commented Jun 12, 2023

Closes #9876

Adds a --prompt/--no-promptoption as well as aPREFECT_CLI_PROMPT` setting to disable interaction.

Example

Due to limitations with typer (and for consistency with our other "global" flags), this must be specified before the command group. For example:

❯ prefect --no-prompt cloud login
When not using an interactive terminal, you must supply a `--key` and `--workspace`.

Similarly, the setting can be used

❯ PREFECT_CLI_PROMPT=0 prefect cloud login                   
When not using an interactive terminal, you must supply a `--key` and `--workspace`.

Prompting can also be forced on in cases where we do not detect a tty.

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. fix, feature, enhancement, docs.

@zanieb zanieb requested a review from a team as a code owner June 12, 2023 15:10
@netlify
Copy link

netlify bot commented Jun 12, 2023

Deploy Preview for prefect-docs-preview ready!

Name Link
🔨 Latest commit 8d6c8ad
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs-preview/deploys/64874a1e0c777d00070438f4
😎 Deploy Preview https://deploy-preview-9897--prefect-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

Sweet!

@zanieb zanieb added the enhancement An improvement of an existing feature label Jun 12, 2023
@zanieb
Copy link
Contributor Author

zanieb commented Jun 12, 2023

@desertaxle just FYI I pushed a setting and some tests

@zanieb zanieb merged commit 3acc992 into main Jun 12, 2023
45 checks passed
@zanieb zanieb deleted the no-prompt branch June 12, 2023 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add additional flag for non-interactive mode
2 participants