Registry / devops / databricks-cli

databricks-cli

JSON →
library0.18.0pypypi✓ verified 29d ago

The `databricks-cli` Python package provided a command-line interface for Databricks. As of version 0.18.0, this package is deprecated. Users are advised to migrate to the new Databricks CLI (an independent executable) for command-line operations and to the `databricks-sdk-py` Python SDK for programmatic interactions. Databricks plans no further support or new feature work for this legacy package.

pip install databricks-cli
INSTALL
IMPORT
SIG · DATABRICKS-CLI
D
databricks-cli
devopspythonv0.18.0
Install
3.7s avg
Import
—
Disk
24MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.18.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 25.7MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 3.7s · import 0.000s · 26MB
24MB installed
● package 24MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

initialize_cli_for_databricks_notebooks
✓ from databricks_cli import initialize_cli_for_databricks_notebooks
✗ from databricks.sdk import WorkspaceClient

This quickstart first demonstrates how to use the recommended `databricks-sdk` for Python to programmatically list Databricks clusters, assuming authentication via environment variables (`DATABRICKS_HOST`, `DATABRICKS_TOKEN`). It also highlights typical command-line usage for both the legacy `databricks-cli` and the recommended new `databricks` CLI executable. Users should migrate programmatic logic to `databricks-sdk` and command-line scripts to the new `databricks` CLI.

# Authenticate via environment variables (recommended for quickstart) # export DATABRICKS_HOST="https://<your-workspace-url>" # export DATABRICKS_TOKEN="dapiXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # --- Old databricks-cli usage (deprecated) --- # The primary use was via the command line, e.g.: # databricks clusters list # --- New Databricks SDK for Python (recommended for programmatic access) --- import os from databricks.sdk import WorkspaceClient # The SDK automatically uses DATABRICKS_HOST and DATABRICKS_TOKEN environment variables w = WorkspaceClient( host=os.environ.get('DATABRICKS_HOST', ''), token=os.environ.get('DATABRICKS_TOKEN', '') ) # Example: List clusters using the new SDK print("Listing Databricks clusters (using new SDK):") for c in w.clusters.list(): print(f" - {c.cluster_name} ({c.cluster_id})") # --- New Databricks CLI executable (recommended for command-line access) --- # After installing the new CLI executable (not this Python package): # databricks auth login --host https://<your-workspace-url> # databricks clusters list
databricks --version
Debug
Known issues
breakingThis `databricks-cli` Python package is deprecated. It receives no new features or support. For programmatic use, migrate to `databricks-sdk-py`. For command-line use, migrate to the new standalone `databricks/cli` executable. Failure to migrate will result in outdated functionality and potential compatibility issues.
fix
For Python SDK usage: `pip install databricks-sdk` and update imports/code to use `databricks.sdk.WorkspaceClient` or `databricks.sdk.AccountClient`. For CLI usage: Install the new Databricks CLI executable via `curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh` and adapt scripts to use the new `databricks` commands.
affects: 0.18.0 and below
deprecatedPersonal Access Token (PAT) authentication for Databricks is deprecated, and basic authentication (username/password) reached End-of-Life on July 10, 2024. New projects should use OAuth machine-to-machine (M2M) or user-to-machine (U2M) authentication.
fix
Transition authentication methods to Databricks unified authentication, prioritizing OAuth M2M/U2M. Update `DATABRICKS_TOKEN` usage to alternative methods where possible. Refer to Databricks authentication documentation for the latest best practices.
affects: All versions
gotchaVersion 0.18.0 of `databricks-cli` removed the explicit pin on `urllib3 < 2`. While this unblocks newer `urllib3` versions, older environments might encounter compatibility issues if they upgrade `databricks-cli` but retain an old `urllib3` that has breaking changes with other dependencies.
fix
Ensure `urllib3` is updated to a compatible version alongside `databricks-cli` (or its recommended replacements, the `databricks-sdk` or new CLI) to avoid unexpected errors. If encountering issues, check the `urllib3` version in your environment and upgrade it or pin a known working version.
affects: 0.18.0
Upgrade
Version history
0.18.0latest on PyPI · released Oct 5, 2023
Audit
Dependencies
pythonrequiredRequired for running the Python package.
Agent activity
39 hits · last 30 days
node
32
OpenAI (training)
1
Resources
databricks-cli — pip install databricks-cli · libregistry