Skip to content

Add completion install, uninstall, and status subcommands - #4581

Merged
simonfaltum merged 18 commits into
mainfrom
simonfaltum/completion-install-uninstall
Feb 24, 2026
Merged

Add completion install, uninstall, and status subcommands#4581
simonfaltum merged 18 commits into
mainfrom
simonfaltum/completion-install-uninstall

Conversation

@simonfaltum

@simonfaltumsimonfaltum commented Feb 23, 2026

Copy link
Copy Markdown
Member

Why

Users currently have to manually configure shell tab completion by piping databricks completion <shell> output into the right RC file. This is error-prone and shell-specific. Adding install/uninstall/status subcommands automates the setup.

Changes

Adds three new subcommands to the existing completion command:

databricks completion
databricks completion bash # Generate bash completion script
databricks completion zsh # Generate zsh completion script
databricks completion fish # Generate fish completion script
databricks completion powershell # Generate powershell completion script
databricks completion install # NEW: Install completions into shell RC file
databricks completion uninstall # NEW: Remove completions from shell RC file
databricks completion status # NEW: Show current completion status

completion install [--shell <shell>] [--auto-approve] — Auto-detects shell from $SHELL, appends an eval shim wrapped in BEGIN/END markers to the appropriate RC file. Fish uses a file drop to ~/.config/fish/completions/ instead. Shows the detected shell and target file and asks for confirmation before writing; --auto-approve skips the prompt (for scripts/agents). If completions are already present (our marker, Homebrew, or an external fish file), reports that and exits without prompting.

completion uninstall [--shell <shell>] [--auto-approve] — Removes the marker block from the RC file (or deletes the fish completions file if it contains our marker). Strict parsing: returns an error if markers are corrupted rather than risking RC file damage. External completions (Homebrew, package manager fish files) are detected and reported but not removed.

completion status [--shell <shell>] — Reports whether completions are installed, detecting our marker block, Homebrew-based zsh installs, and fish file-based installs. Also serves as a dry-run to preview the detected shell and target file before running install.

Shell support: bash, zsh, fish, powershell (pwsh 7+), powershell5 (Windows PowerShell 5.1). Shell detection checks $SHELL first (catches Git Bash/MSYS on Windows), falls back to PATH lookup on Windows. If $SHELL contains an unrecognized value on Windows (e.g. powershell.exe), detection falls through to PATH-based lookup.

Architecture: Core logic lives in libs/completion/ with no cobra dependency, so it can be called from other commands (e.g. a guided setup flow). cmd/completion/ contains thin cobra wrappers. The existing shell generation subcommands (bash/zsh/fish/powershell) are reimplemented with runtime writer resolution to avoid a Cobra OutOrStdout() capture timing issue with the test harness.

Tests

  • Unit tests in libs/completion/ covering shell detection, install/uninstall/status logic, idempotency, marker corruption detection, edge cases (empty files, missing dirs, permission preservation, Windows permission semantics, fish foreign-file ownership, $SHELL=powershell.exe fallback)
  • Acceptance test in acceptance/cmd/completion/ covering the full install → status → idempotent reinstall → uninstall → status round-trip, plus smoke tests for all four shell script generators and --no-descriptions

Add `databricks completion install`, `completion uninstall`, and
`completion status` commands that auto-detect the user's shell and
manage tab completion configuration.
Install appends an eval shim (wrapped in BEGIN/END markers) to the
appropriate RC file. Uninstall removes it. Status reports whether
completions are installed, including detection of Homebrew-based
installs for zsh.
Supported shells: bash, zsh, fish, powershell (pwsh 7+),
powershell5 (Windows PowerShell 5.1).
The core logic lives in libs/completion/ for reusability from other
commands (e.g. guided setup flows). The cmd/completion/ package
provides thin cobra wrappers. Shell script generation subcommands
(bash/zsh/fish/powershell) are reimplemented with runtime writer
resolution to avoid a Cobra output-capture timing issue.
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Feb 23, 2026

Copy link
Copy Markdown
Collaborator

Commit: 5f8440e

Run: 22355354433

Env🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
🟨​aws linux7172687647:07
🟨​aws windows7172707627:02
💚​aws-ucws linux873646807:23
💚​aws-ucws windows873666785:11
💚​azure linux292717626:54
🔄​azure windows1292727605:09
💚​azure-ucws linux293696768:25
💚​azure-ucws windows293716748:30
💚​gcp linux292677656:16
💚​gcp windows292697636:21
16 interesting tests: 7 KNOWN, 7 SKIP, 1 RECOVERED, 1 flaky
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K🟨​K💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
🙈​TestAccept/bundle/resources/permissions🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​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/connection💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
🔄​TestFetchRepositoryInfoAPI_FromRepo✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p✅​p
Top 20 slowest tests (at least 2 minutes):
durationenvtestname
4:16gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:51gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:32aws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:29azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:15gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:08gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:58aws-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:58aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:52aws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:49aws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:49aws-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:46aws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:31azure-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:26azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:25aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:21azure windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:21azure linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:20azure-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:19azure linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:12azure windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

- Fix uninstall removing the trailing newline of the line before the
marker block, which could join adjacent lines
- Fix acceptance test using unbound $TMPDIR on Linux CI; use mktemp -d
- Use zsh in acceptance test to avoid OS-dependent bash RC file path
- Suppress Homebrew detection in test with HOMEBREW_PREFIX=/nonexistent
- Fix install message suggesting 'source' for PowerShell shells
- Tighten uninstall tests to assert exact file content after removal
- Remove unused supportedShells variable (lint)
Windows does not honor Unix permission bits, so the 0o600 written
mode reads back as 0o666. Guard the assertion with runtime.GOOS and
fall back to a write-ability check on Windows.
Two correctness fixes:
- DetectShell: if $SHELL is set but unrecognized on Windows (e.g.
powershell.exe), fall through to detectWindowsShell() instead of
returning "unsupported shell". On non-Windows the error is preserved.
- uninstallFish: only delete the completions file if it contains our
BeginMarker. Foreign files (e.g. installed by a package manager) are
left untouched and wasInstalled=false is returned.
Tests: add TestDetectShellPowershellExeNonWindows, update TestUninstallFish
to use CLI-managed content, add TestUninstallFishForeignFile.
Handle PowerShell-style SHELL values without masking unsupported shells, and avoid overwriting externally managed fish completion files while improving uninstall messaging.
Co-authored-by: Cursor <cursoragent@cursor.com>
Use the shared sethome helper in acceptance tests and normalize displayed file paths so output remains stable across platforms and avoids HOME/UserHomeDir mismatches.
Co-authored-by: Cursor <cursoragent@cursor.com>
Before modifying shell config files, show the detected shell and target
file path and ask the user to confirm. This defends against heuristic
misdetection. The prompt is skipped when --yes is passed or when the
operation is a no-op (already installed / not installed).
In non-interactive mode without --yes, the command returns an error
hinting at the flag, following the same pattern as bundle deploy.
Align with existing CLI convention (bundle deploy/destroy use
--auto-approve). The non-interactive error message now suggests
'databricks completion status' as a dry-run to preview the detected
shell and target file.
Three fixes from review:
- Install command: early-return for any result.Installed (not just
"marker"). Fish external files and Homebrew completions now get
appropriate messages without a useless prompt. The alreadyInstalled
return from Install() is used as a safety net for final messaging.
- Uninstall command: homebrew message no longer shows the misleading
RC file path. Fish external files get "installed externally in <path>".
- installFish: both file-exists branches returned the same value;
simplify to a single os.Stat check.
Without compinit, neither our eval shim nor Homebrew's _databricks
file will be loaded by zsh. Add a shared warnIfCompinitMissing helper
that checks for "compinit" in .zshrc and prints actionable guidance.
The warning appears on install (after success or already-installed),
status (when installed), and uninstall (when completions remain via
an external method like Homebrew).
The eval shim in .zshrc and Homebrew's _databricks in site-functions
are separate files that coexist. Don't block explicit install when the
user has Homebrew completions — print an informational note and
proceed with the normal prompt/install flow.
External fish files (no marker) still early-return since installFish
cannot overwrite them.
@simonfaltum
simonfaltum marked this pull request as ready for review February 24, 2026 08:10
Comment threadlibs/completion/install.go Outdated
Comment threadlibs/completion/uninstall.go Outdated
Comment threadcmd/completion/status.go Outdated

@andrewnesterandrewnester left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please add an entry to NEXT_CHANGELOG.md before merging the PR?

@simonfaltum
simonfaltum added this pull request to the merge queueFeb 24, 2026
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to a conflict with the base branch Feb 24, 2026
@simonfaltum
simonfaltum merged commit a42aff3 into mainFeb 24, 2026
6 checks passed
@simonfaltum
simonfaltum deleted the simonfaltum/completion-install-uninstall branch February 24, 2026 14:57
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Commit: a42aff3

Run: 22356373159

Env❌​FAIL🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
❌​aws linux371749071959:28
🟨​aws windows721746072854:50
🟨​aws-ucws linux101131757569120:40
🟨​aws-ucws windows10141720580110:02
❌​azure linux3121949171779:07
💚​azure windows2946572645:37
🔄​azure-ucws linux348733574101:31
🔄​azure-ucws windows458694585107:30
❌​gcp linux311947372659:22
💚​gcp windows2944573551:01
38 interesting tests: 16 KNOWN, 11 flaky, 7 RECOVERED, 3 FAIL, 1 SKIP
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K🟨​K🟨​K🟨​K🟨​K💚​R🔄​f💚​R🟨​K💚​R
❌​TestAccept/bundle/config-remote-sync/multiple_resources❌​F🙈​s✅​p🙈​s❌​F🙈​s✅​p🙈​s❌​F🙈​s
❌​TestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct❌​F✅​p❌​F✅​p❌​F
❌​TestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=terraform❌​F✅​p❌​F✅​p❌​F
🔄​TestAccept/bundle/integration_whl/interactive_cluster✅​p🔄​f✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/integration_whl/interactive_cluster/DATABRICKS_BUNDLE_ENGINE=terraform✅​p🔄​f✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/integration_whl/interactive_cluster_dynamic_version✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p
🔄​TestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=SINGLE_USER✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p
🔄​TestAccept/bundle/resources/clusters/run/spark_python_task✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/resources/clusters/run/spark_python_task/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/resources/dashboards/dataset-catalog-schema✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/resources/dashboards/dataset-catalog-schema/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p
🙈​TestAccept/bundle/resources/permissions🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🔄​TestAccept/bundle/resources/permissions/factcheck✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f🙈​s🙈​s
🔄​TestAccept/bundle/resources/permissions/factcheck/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/postgres_branches/basic🙈​S🙈​S🟨​K🟨​K🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/postgres_branches/basic/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K
🟨​TestAccept/bundle/resources/postgres_branches/basic/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K
🟨​TestAccept/bundle/resources/postgres_branches/recreate🙈​S🙈​S🟨​K🟨​K🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/postgres_branches/recreate/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K
🟨​TestAccept/bundle/resources/postgres_branches/recreate/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K
🟨​TestAccept/bundle/resources/postgres_branches/update_protected🙈​S🙈​S🟨​K🟨​K🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/postgres_branches/update_protected/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K
🟨​TestAccept/bundle/resources/postgres_branches/update_protected/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K
💚​TestAccept/bundle/resources/postgres_branches/without_branch_id🙈​S🙈​S💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
💚​TestAccept/bundle/resources/postgres_branches/without_branch_id/DATABRICKS_BUNDLE_ENGINE=direct💚​R💚​R
💚​TestAccept/bundle/resources/postgres_branches/without_branch_id/DATABRICKS_BUNDLE_ENGINE=terraform💚​R💚​R
💚​TestAccept/bundle/resources/postgres_endpoints/recreate🙈​S🙈​S💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
💚​TestAccept/bundle/resources/synced_database_tables/basic🙈​S🙈​S💚​R💚​R🙈​S🙈​S💚​R💚​R🙈​S🙈​S
💚​TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct💚​R💚​R💚​R💚​R
💚​TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform💚​R💚​R💚​R💚​R
🔄​TestAccept/ssh/connection💚​R💚​R🔄​f💚​R💚​R💚​R💚​R💚​R💚​R💚​R
Top 50 slowest tests (at least 2 minutes):
durationenvtestname
17:54azure-ucws linuxTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
17:44aws-ucws linuxTestAccept/bundle/resources/model_serving_endpoints/running-endpoint/DATABRICKS_BUNDLE_ENGINE=direct
16:19aws-ucws windowsTestAccept/bundle/resources/model_serving_endpoints/running-endpoint/DATABRICKS_BUNDLE_ENGINE=terraform
15:40aws-ucws windowsTestAccept/bundle/resources/model_serving_endpoints/running-endpoint/DATABRICKS_BUNDLE_ENGINE=direct
14:30azure-ucws windowsTestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
13:27gcp linuxTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
11:42azure-ucws windowsTestAccept/bundle/resources/permissions/factcheck/DATABRICKS_BUNDLE_ENGINE=terraform
11:11gcp windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=SINGLE_USER
10:58aws linuxTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=SINGLE_USER
10:51gcp linuxTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=SINGLE_USER
10:49azure linuxTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=direct
10:25gcp windowsTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
10:20gcp windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=SINGLE_USER
9:27aws-ucws windowsTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
9:12azure-ucws windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=direct
9:03aws-ucws windowsTestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_15.4_LTS
9:01azure windowsTestAccept/bundle/integration_whl/interactive_cluster/DATABRICKS_BUNDLE_ENGINE=terraform
9:01aws-ucws linuxTestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_15.4_LTS
8:53azure-ucws linuxTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
8:48gcp linuxTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=USER_ISOLATION
8:42aws-ucws windowsTestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_13.3_LTS
8:34azure-ucws windowsTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
8:31gcp windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
8:28aws-ucws windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
8:26azure-ucws windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
8:20azure-ucws linuxTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
8:17azure-ucws linuxTestAccept/bundle/integration_whl/interactive_cluster/DATABRICKS_BUNDLE_ENGINE=direct
8:16azure-ucws windowsTestAccept/bundle/resources/database_instances/single-instance/DATABRICKS_BUNDLE_ENGINE=terraform
8:14aws-ucws windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=direct
8:11gcp windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=USER_ISOLATION
8:08azure-ucws linuxTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=SINGLE_USER
8:05azure-ucws windowsTestAccept/bundle/resources/database_catalogs/basic/DATABRICKS_BUNDLE_ENGINE=terraform
8:05aws-ucws windowsTestAccept/bundle/resources/database_instances/single-instance/DATABRICKS_BUNDLE_ENGINE=direct
8:04gcp linuxTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=SINGLE_USER
8:00aws windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=SINGLE_USER
7:56aws-ucws linuxTestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_14.3_LTS
7:55azure-ucws windowsTestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
7:55azure linuxTestAccept/bundle/integration_whl/interactive_cluster/DATABRICKS_BUNDLE_ENGINE=terraform
7:54aws-ucws windowsTestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
7:52azure-ucws linuxTestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
7:52gcp linuxTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=USER_ISOLATION
7:46aws-ucws windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=USER_ISOLATION
7:43azure-ucws windowsTestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:40gcp linuxTestAccept/bundle/integration_whl/interactive_cluster/DATABRICKS_BUNDLE_ENGINE=terraform
7:37aws windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=USER_ISOLATION
7:34gcp windowsTestAccept/bundle/run/app-with-job/DATABRICKS_BUNDLE_ENGINE=terraform
7:32aws-ucws windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=SINGLE_USER
7:31gcp windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=USER_ISOLATION
7:29aws-ucws linuxTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:28azure-ucws linuxTestAccept/bundle/integration_whl/wrapper_custom_params/DATABRICKS_BUNDLE_ENGINE=terraform

deco-sdk-taggingBot added a commit that referenced this pull request Feb 26, 2026
## Release v0.290.0
### CLI
* Add `completion install`, `uninstall`, and `status` subcommands ([#4581](#4581))
* Wire profile name through CLI ToOAuthArgument for profile-based cache keys ([#4562](#4562))
* Add host disambiguation and positional profile support to auth token ([#4574](#4574))
* Update error messages to suggest 'databricks auth login' ([#4587](#4587))
* Resolve --host to matching profile for token cache lookup ([#4591](#4591))
* Improve auth token UX: profile selection and better empty-state handling ([#4584(#4584)
### Bundles
* Added support for git_source and git_repository for Apps ([#4538](#4538))
### Dependency updates
* Upgrade TF provider to 1.109.0 ([#4561](#4561))
* Upgrade Go SDK to v0.110.0 ([#4552](#4552))
### API Changes
* Bump databricks-sdk-go from v0.111.0 to v0.112.0.
denik pushed a commit that referenced this pull request May 20, 2026
## Why
Users currently have to manually configure shell tab completion by
piping `databricks completion <shell>` output into the right RC file.
This is error-prone and shell-specific. Adding
`install`/`uninstall`/`status` subcommands automates the setup.
## Changes
Adds three new subcommands to the existing `completion` command:
```
databricks completion
databricks completion bash # Generate bash completion script
databricks completion zsh # Generate zsh completion script
databricks completion fish # Generate fish completion script
databricks completion powershell # Generate powershell completion script
databricks completion install # NEW: Install completions into shell RC file
databricks completion uninstall # NEW: Remove completions from shell RC file
databricks completion status # NEW: Show current completion status
```
**`completion install [--shell <shell>] [--auto-approve]`** —
Auto-detects shell from `$SHELL`, appends an eval shim wrapped in
`BEGIN`/`END` markers to the appropriate RC file. Fish uses a file drop
to `~/.config/fish/completions/` instead. Shows the detected shell and
target file and asks for confirmation before writing; `--auto-approve`
skips the prompt (for scripts/agents). If completions are already
present (our marker, Homebrew, or an external fish file), reports that
and exits without prompting.
**`completion uninstall [--shell <shell>] [--auto-approve]`** — Removes
the marker block from the RC file (or deletes the fish completions file
if it contains our marker). Strict parsing: returns an error if markers
are corrupted rather than risking RC file damage. External completions
(Homebrew, package manager fish files) are detected and reported but not
removed.
**`completion status [--shell <shell>]`** — Reports whether completions
are installed, detecting our marker block, Homebrew-based zsh installs,
and fish file-based installs. Also serves as a dry-run to preview the
detected shell and target file before running install.
**Shell support**: bash, zsh, fish, powershell (pwsh 7+), powershell5
(Windows PowerShell 5.1). Shell detection checks `$SHELL` first (catches
Git Bash/MSYS on Windows), falls back to PATH lookup on Windows. If
`$SHELL` contains an unrecognized value on Windows (e.g.
`powershell.exe`), detection falls through to PATH-based lookup.
**Architecture**: Core logic lives in `libs/completion/` with no cobra
dependency, so it can be called from other commands (e.g. a guided setup
flow). `cmd/completion/` contains thin cobra wrappers. The existing
shell generation subcommands (bash/zsh/fish/powershell) are
reimplemented with runtime writer resolution to avoid a Cobra
`OutOrStdout()` capture timing issue with the test harness.
## Tests
- Unit tests in `libs/completion/` covering shell detection,
install/uninstall/status logic, idempotency, marker corruption
detection, edge cases (empty files, missing dirs, permission
preservation, Windows permission semantics, fish foreign-file ownership,
`$SHELL=powershell.exe` fallback)
- Acceptance test in `acceptance/cmd/completion/` covering the full
install → status → idempotent reinstall → uninstall → status round-trip,
plus smoke tests for all four shell script generators and
`--no-descriptions`
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.290.0
### CLI
* Add `completion install`, `uninstall`, and `status` subcommands ([#4581](#4581))
* Wire profile name through CLI ToOAuthArgument for profile-based cache keys ([#4562](#4562))
* Add host disambiguation and positional profile support to auth token ([#4574](#4574))
* Update error messages to suggest 'databricks auth login' ([#4587](#4587))
* Resolve --host to matching profile for token cache lookup ([#4591](#4591))
* Improve auth token UX: profile selection and better empty-state handling ([#4584(#4584)
### Bundles
* Added support for git_source and git_repository for Apps ([#4538](#4538))
### Dependency updates
* Upgrade TF provider to 1.109.0 ([#4561](#4561))
* Upgrade Go SDK to v0.110.0 ([#4552](#4552))
### API Changes
* Bump databricks-sdk-go from v0.111.0 to v0.112.0.
Sign up for freeto 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

@simonfaltum@eng-dev-ecosystem-bot@andrewnester