Databricks CLI tutorial
Note
This information applies to Databricks CLI versions 0.205 and above, which are in Public Preview. To find your version of the Databricks CLI, run databricks -v
.
The Databricks command-line interface (also known as the Databricks CLI) utility provides an easy-to-use interface to automate the Azure Databricks platform from your terminal, command prompt, or automation scripts.
This article demonstrates how to use your local development machine to get started quickly with the Databricks CLI. See What is the Databricks CLI?.
The following hands-on tutorial assumes:
For Linux or macOS, you have Homebrew installed.
Note
If you cannot use Homebrew, for other ways to install the CLI, see Install or update the Databricks CLI.
For Windows, you have winget, Chocolatey, or Windows Subsystem for Linux (WSL) installed. For installation instructions, see your operating system's documentation.
Note
Installing the Databricks CLI with Chocolatey is Experimental.
If you cannot use
winget
, Chocolatey, or WSL, for other ways to install the CLI, see Install or update the Databricks CLI.
Complete the following steps:
If it is not already installed, install the Databricks CLI as follows:
Linux, macOS
Use Homebrew to install the Databricks CLI by running the following two commands:
brew tap databricks/tap brew install databricks
Windows
You can use winget, Chocolatey or Windows Subsystem for Linux (WSL) to install the Databricks CLI. If you cannot use
winget
, Chocolatey, or WSL, you should skip this procedure and use the Command Prompt or PowerShell to install the Databricks CLI from source instead.Note
Installing the Databricks CLI with Chocolatey is Experimental.
To use
winget
to install the Databricks CLI, run the following two commands, and then restart your Command Prompt:winget search databricks winget install Databricks.DatabricksCLI
To use Chocolatey to install the Databricks CLI, run the following command:
choco install databricks-cli
To use WSL to install the Databricks CLI:
Install
curl
andzip
through WSL. For more information, see your operating system's documentation.Use WSL to install the Databricks CLI by running the following command:
curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh
Confirm that the Databricks CLI is installed by running the following command, which displays the current version of the installed Databricks CLI. This version should be 0.205.0 or above:
databricks -v
Note
If you run
databricks
but get an error such ascommand not found: databricks
, or if you rundatabricks -v
and a version number of 0.18 or below is listed, this means that your machine cannot find the correct version of the Databricks CLI executable. To fix this, see Verify your CLI installation.
After you install the Databricks CLI, To configure the CLI to use other Databricks authentication types, see Authentication for the Databricks CLI.
Next steps
After you set up the Databricks CLI:
- To learn how to use the CLI, see Basic usage for the Databricks CLI.
- For an overview of available CLI commands, see Databricks CLI commands.
- If the CLI does not run or produces unexpected results, see Verify your CLI installation.