Skip to content

Add global --quiet, --no-input, and --yes flags#4726

Open
simonfaltum wants to merge 9 commits intomainfrom
simonfaltum/global-interaction-flags
Open

Add global --quiet, --no-input, and --yes flags#4726
simonfaltum wants to merge 9 commits intomainfrom
simonfaltum/global-interaction-flags

Conversation

@simonfaltum
Copy link
Member

@simonfaltum simonfaltum commented Mar 12, 2026

Why

CLI users in CI/CD pipelines and scripts need control over the CLI's interactive behavior. Currently there's no way to suppress progress output, prevent prompts from blocking automation, or auto-approve confirmations without per-command flags.

Changes

Before: No global flags for controlling output verbosity, interactivity, or confirmations. Scripts had to work around interactive prompts.
Now: Three new global flags on the root command, stored in the cmdio Capabilities struct alongside existing TTY detection:

  • --quiet / -q (env: DATABRICKS_QUIET): Suppresses non-essential output. Spinners become no-ops, LogString/Log calls are silenced, and only Error-severity diagnostics render. Data output (stdout) is never affected.
  • --no-input (env: DATABRICKS_NO_INPUT): Disables all interactive prompts. Prompt functions return ErrNoInput (or the default value if one exists).
  • --yes / -y (env: DATABRICKS_YES): Auto-approves all yes/no confirmation prompts. Precedence: --yes (approve) > --no-input (error) > normal prompting. Non-interactive guards in deploy/destroy/completion/bind are updated to also check --yes.

apps import already had its own local -q/--quiet flag that suppresses informational messages during import. The two flags are bridged: passing the global --quiet also sets the local quiet behavior in apps import, and passing the local -q on apps import also activates the global cmdio quiet mode (suppressing spinners, etc.). Both flags continue to work as before.

Open items

  • API field deny list: The flag names quiet, no_input, yes should be added to a global reject list for top-level field names in auto-generated API commands, so future API parameters don't collide with these global flags. This needs a change in the codegen pipeline (or universe API linters), tracked separately.
  • I/O completeness audit: All output in the CLI currently goes through cmdio (LogString, Log, Render, spinners). A follow-up could add a lint rule or test verifying no direct fmt.Fprintf(os.Stderr, ...) calls bypass cmdio, so --quiet is truly global.

Test plan

  • Unit tests for all gated functions (LogString, Log, spinner, diagnostics, Ask, AskYesOrNo, AskSelect, Select, Secret, RunSelect)
  • Unit tests for flag precedence (--yes > --no-input > normal)
  • Unit tests for env var support (DATABRICKS_QUIET, DATABRICKS_NO_INPUT, DATABRICKS_YES)
  • Unit tests for Ask() returning default value when --no-input + default provided
  • Data output (Render) not affected by --quiet
  • Command-level test for --yes wiring through completion install
  • make lintfull passes
  • make checks passes

Add three new global flags to control CLI interaction behavior in
CI/CD pipelines and scripts:

- --quiet/-q (DATABRICKS_QUIET): suppresses non-essential output
  (spinners, LogString/Log calls, non-error diagnostics)
- --no-input (DATABRICKS_NO_INPUT): disables all interactive prompts,
  returning ErrNoInput or default values where available
- --yes/-y (DATABRICKS_YES): auto-approves yes/no confirmation prompts

Precedence for AskYesOrNo: --yes > --no-input > normal prompting.

Non-interactive guards in deploy, destroy, and completion install are
updated to also accept --yes as an alternative to --auto-approve.

Co-authored-by: Isaac
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Mar 12, 2026

Commit: 2989950

Run: 23057127914

Env 💥​PANIC ❌​FAIL 🟨​KNOWN 🤯​MISS 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 8 7 268 787 11:48
🔄​ aws windows 3 7 7 268 785 12:32
💥​ aws-ucws linux 1 3 1 11 7 7 350 702 131:58
🔄​ aws-ucws windows 4 7 7 364 700 26:40
🔄​ azure linux 2 9 271 785 11:44
💚​ azure windows 2 9 273 783 7:45
🔄​ azure-ucws linux 7 1 9 364 698 36:19
🔄​ azure-ucws windows 7 1 9 366 696 25:36
💚​ gcp linux 2 9 267 788 11:32
💚​ gcp windows 2 9 269 786 10:58
39 interesting tests: 11 MISS, 10 flaky, 7 SKIP, 6 RECOVERED, 3 FAIL, 1 KNOWN, 1 PANIC
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 💚​R 🔄​f 🟨​K 💚​R 🔄​f 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/resources/apps/inline_config ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/resources/model_serving_endpoints/basic 🙈​s 🙈​s ✅​p 🔄​f 🙈​s 🙈​s ✅​p ✅​p 🙈​s 🙈​s
🔄​ TestAccept/bundle/resources/model_serving_endpoints/basic/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p 🔄​f ✅​p ✅​p
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/bundle/resources/permissions/dashboards/create/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestAccept/bundle/resources/permissions/dashboards/create/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
❌​ TestAccept/bundle/resources/permissions/jobs/delete_one/cloud 🙈​s 🙈​s ❌​F ✅​p 🙈​s 🙈​s 🔄​f 🔄​f 🙈​s 🙈​s
🔄​ TestAccept/bundle/resources/permissions/jobs/delete_one/cloud/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p 🔄​f ✅​p
❌​ TestAccept/bundle/resources/permissions/jobs/delete_one/cloud/DATABRICKS_BUNDLE_ENGINE=terraform ❌​F ✅​p ✅​p 🔄​f
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
❌​ TestAccept/ssh/connect-serverless-gpu 🙈​s 🙈​s ❌​F ✅​p 🙈​s 🙈​s 🔄​f 🔄​f 🙈​s 🙈​s
🔄​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 🔄​f 🔄​f 💚​R 🔄​f 🔄​f 💚​R 💚​R
🤯​ TestSyncEnsureRemotePathIsUsableIfRepoDoesntExist ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncEnsureRemotePathIsUsableIfRepoExists ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncEnsureRemotePathIsUsableInWorkspace ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
💥​ TestSyncFullFileSync ✅​p ✅​p 💥​P ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncIncrementalFileOverwritesFolder ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncIncrementalFileSync ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncIncrementalSyncFileToPythonNotebook ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncIncrementalSyncPythonNotebookDelete ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncIncrementalSyncPythonNotebookToFile ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncNestedFolderDoesntFailOnNonEmptyDirectory ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncNestedFolderSync ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🤯​ TestSyncNestedSpacePlusAndHashAreEscapedSync ✅​p ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestFetchRepositoryInfoAPI_FromRepo ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p 🔄​f 🔄​f ✅​p ✅​p
Top 50 slowest tests (at least 2 minutes):
duration env testname
6:29 azure-ucws windows TestAccept/bundle/resources/volumes/recreate/DATABRICKS_BUNDLE_ENGINE=direct
6:18 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
6:00 aws-ucws windows TestAccept/bundle/resources/volumes/recreate/DATABRICKS_BUNDLE_ENGINE=direct
5:40 azure-ucws linux TestAccept/ssh/connect-serverless-gpu
5:15 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
5:12 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:51 aws-ucws linux TestAccept/bundle/resources/model_serving_endpoints/basic/DATABRICKS_BUNDLE_ENGINE=terraform
4:50 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:47 azure-ucws linux TestAccept/bundle/deploy/files/no-snapshot-sync/DATABRICKS_BUNDLE_ENGINE=terraform
4:37 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:31 azure-ucws windows TestAccept/bundle/deployment/bind/job/generate-and-bind/DATABRICKS_BUNDLE_ENGINE=direct
4:30 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:27 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:20 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:19 azure-ucws linux TestAccept/bundle/deploy/files/no-snapshot-sync/DATABRICKS_BUNDLE_ENGINE=direct
4:18 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:15 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:09 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:08 aws-ucws windows TestAccept/bundle/resources/volumes/recreate/DATABRICKS_BUNDLE_ENGINE=terraform
4:08 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:07 aws-ucws windows TestAccept/bundle/deploy/files/no-snapshot-sync/DATABRICKS_BUNDLE_ENGINE=direct
3:52 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:50 aws-ucws linux TestAccept/bundle/resources/alerts/with_file/DATABRICKS_BUNDLE_ENGINE=direct
3:49 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:46 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:45 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:43 azure-ucws windows TestAccept/bundle/resources/volumes/recreate/DATABRICKS_BUNDLE_ENGINE=terraform
3:39 aws-ucws windows TestAccept/bundle/resources/permissions/jobs/delete_one/cloud/DATABRICKS_BUNDLE_ENGINE=direct
3:36 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:36 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:31 aws-ucws windows TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=terraform
3:29 azure-ucws linux TestAccept/bundle/deployment/bind/job/generate-and-bind/DATABRICKS_BUNDLE_ENGINE=terraform
3:25 gcp windows TestAccept/bundle/resources/jobs/check-metadata/DATABRICKS_BUNDLE_ENGINE=direct
3:23 azure-ucws windows TestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_15.4_LTS
3:21 aws-ucws linux TestAccept/bundle/resources/permissions/dashboards/create/DATABRICKS_BUNDLE_ENGINE=terraform
3:20 aws-ucws windows TestSparkJarTaskDeployAndRunOnWorkspace/Databricks_Runtime_14.3_LTS
3:20 aws-ucws linux TestAccept/bundle/resources/jobs/check-metadata/DATABRICKS_BUNDLE_ENGINE=terraform
3:18 aws-ucws linux TestAccept/bundle/resources/dashboards/generate_inplace/DATABRICKS_BUNDLE_ENGINE=terraform
3:10 azure-ucws linux TestAccept/bundle/resources/model_serving_endpoints/basic/DATABRICKS_BUNDLE_ENGINE=terraform
3:07 azure-ucws windows TestAccept/bundle/resources/model_serving_endpoints/basic/DATABRICKS_BUNDLE_ENGINE=terraform
3:05 aws-ucws linux TestAccept/bundle/resources/alerts/with_file/DATABRICKS_BUNDLE_ENGINE=terraform
3:04 aws-ucws windows TestAccept/bundle/resources/alerts/with_file/DATABRICKS_BUNDLE_ENGINE=terraform
3:03 aws-ucws linux TestAccept/bundle/resources/permissions/jobs/delete_one/cloud/DATABRICKS_BUNDLE_ENGINE=direct
3:00 aws windows TestAccept/bundle/deploy/files/no-snapshot-sync/DATABRICKS_BUNDLE_ENGINE=direct
2:59 azure-ucws linux TestFilerWorkspaceFilesExtensionsDelete
2:58 azure-ucws windows TestAccept/bundle/deploy/files/no-snapshot-sync/DATABRICKS_BUNDLE_ENGINE=terraform
2:56 aws-ucws windows TestAccept/bundle/resources/permissions/jobs/delete_one/cloud/DATABRICKS_BUNDLE_ENGINE=terraform
2:54 aws linux TestAccept/bundle/resources/dashboards/generate_inplace/DATABRICKS_BUNDLE_ENGINE=terraform
2:54 azure-ucws windows TestAccept/bundle/deploy/files/no-snapshot-sync/DATABRICKS_BUNDLE_ENGINE=direct
2:53 aws-ucws linux TestAccept/bundle/resources/jobs/no-git-provider/DATABRICKS_BUNDLE_ENGINE=terraform

Add --no-input, --quiet, and --yes to all help output golden files.
Update error messages to mention --auto-approve or --yes.

Co-authored-by: Isaac
Copy link
Contributor

@shreyas-goenka shreyas-goenka left a comment

Choose a reason for hiding this comment

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

Note: This review was posted by Claude (AI assistant). Shreyas will do a separate, more thorough review pass.

Priority: LOW-MEDIUM — Strong implementation with minor issues

LOW: Description casing inconsistency

Flag descriptions use inconsistent casing (some start with uppercase, others lowercase). Minor but worth standardizing.

LOW: tools/gofumpt artifact

There appears to be a formatting change from tools/gofumpt mixed into this PR. Consider separating formatting-only changes.

What looks good

  • Clean implementation of --quiet, --no-input, and --yes flags
  • Good integration with existing cmdio capabilities system
  • Proper propagation through the command tree
  • Well-structured capability checks
  • Correct interaction between the three flags

Overall a solid PR. The issues are minor.

Use env.GetBool for the global interaction flags and derive new cmdio contexts when quiet, no-input, or yes is enabled so commands do not mutate shared I/O state.
…ands

Fix four issues with the global interaction flags:

1. configure: check IsNoInput alongside IsPromptSupported so --no-input
   correctly routes to the non-interactive path.

2. auth prompts: add IsNoInput checks to promptForHost, promptForAccountID,
   and promptForWorkspaceID so --no-input prevents raw promptui prompts.

3. logout: allow --yes to bypass the prompt-supported guard so
   AskYesOrNo can auto-approve in non-interactive environments.

4. apps import: remove local --quiet flag that shadowed the root
   persistent --quiet, and read from cmdio.IsQuiet(ctx) instead.

Also revert the unrelated tools/gofumpt addition to .gitignore.
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.

3 participants