This article shows you how to list Databricks CLI command groups and commands, display Databricks CLI help, and work with Databricks CLI output. See What is the Databricks CLI?.
This article assumes that you have already installed the Databricks CLI and set up the CLI for authentication. See Install or update the Databricks CLI and Authentication for the Databricks CLI.
List CLI command groupsâYou list the command groups by using the --help
or -h
option. For example:
You list the commands for any command group by using the --help
or -h
option. For example, to list the clusters
commands:
You display the help for a command by using the --help
or -h
option. For example, to display the help for the clusters list
command:
Bash
databricks clusters list -h
Run a commandâ
Complete usage information and syntax for individual commands can be found in the command-line help, but Databricks CLI commands generally conform to the following syntax:
databricks <command-group> <command-name> <subcommand-name> [command-argument-value1] [--<flag1-name> <flag1-value>]
Not every command has additional subcommands. Global flags are available, and some commands have additional flags. For example, the following command outputs available clusters, using a command-specific flag:
Bash
databricks clusters list --can-use-client JOBS
tip
You can run Databricks CLI commands from within a Databricks workspace using the web terminal. Web terminal can be used by many users on one compute and does not require setting up keys. See Run shell commands in Databricks web terminal.
Usejq
to filter JSON outputâ
Some Databricks CLI commands output JSON, which means you can use jq to filter the output. For example, to list just the display name of a Databricks cluster with the specified cluster ID:
Bash
databricks clusters get 1234-567890-abcde123 | jq -r .cluster_name
You can install jq
on macOS using Homebrew with brew install jq
or on Windows using Chocolatey with choco install jq
. For more information on jq
, see the jq Manual.
The format of string parameters is handled differently in JSON depending on your operating system:
You must enclose JSON string parameters in double quotes, and you must enclose the entire JSON payload in single quotes. Some examples:
'{"cluster_id": "1234-567890-abcde123"}'
'["20230323", "Amsterdam"]'
You must enclose JSON string parameters and the entire JSON payload in double quotes, and the double-quote characters inside the JSON payload must be preceded by \
. Some examples:
"{\"cluster_id\": \"1234-567890-abcde123\"}"
"[\"20230323\", \"Amsterdam\"]"
Proxy server configurationâ
To route Databricks CLI requests and responses through a proxy server, set the HTTPS_PROXY
environment variable on the machine where the Databricks CLI is installed to the proxy server's URL.
To set environment variables, see your operating system's documentation.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4