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
Merged
Changes from 1 commit
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 src/prefect/cli/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ def main(
help="Select a profile for this CLI run.",
is_eager=True,
),
prompt: bool = typer.Option(
None,
help=(
"Toggle prompts for this CLI run. "
"Defaults to detecting an interactive console."
),
),
):
if profile and not prefect.context.get_settings_context().profile.name == profile:
# Generally, the profile should entered by `enter_root_settings_context`.
Expand All @@ -79,6 +86,7 @@ def main(
theme=Theme({"prompt.choices": "bold blue"}),
# `soft_wrap` disables wrapping when `True`
soft_wrap=not PREFECT_CLI_WRAP_LINES.value(),
force_interactive=prompt,
)

if not PREFECT_TEST_MODE:
Expand Down