Databricks CLI
Comprehensive reference for the Databricks CLI (v0.205+). Covers authentication, all command groups, flags, and common patterns.
Command syntax
databricks <command-group> [<command>] [<subcommand>] [args] [--flags]
Get help at any level with -h or --help.
Authentication
OAuth U2M (interactive, recommended)
# Workspace-level
databricks auth login --host https://<workspace>.cloud.databricks.com
# Account-level
databricks auth login --host https://accounts.cloud.databricks.com --account-id <id>
Saves credentials to ~/.databrickscfg as a named profile. Tokens auto-refresh and expire in under an hour.
OAuth M2M (service principals)
Add to ~/.databrickscfg:
[my-sp-profile]
host = https://<workspace>.cloud.databricks.com
client_id = <service-principal-client-id>
client_secret = <service-principal-oauth-secret>
Credential resolution order
- Bundle settings files (if running from bundle directory)
- Environment variables (
DATABRICKS_HOST, DATABRICKS_TOKEN, etc.)
.databrickscfg profiles
Profile management
databricks auth profiles # List all profiles
databricks auth env -p PROD # Show profile settings
databricks auth token -p PROD # Show current token
databricks auth describe # Current auth config details
Use -p <profile> or --profile <profile> on any command. Default profile is DEFAULT.
Global flags
| Flag |
Description |
--debug |
Enable debug logging |
-h, --help |
Display help |
-o, --output |
Output format: text or json |
-p, --profile |
Config profile from ~/.databrickscfg |
--log-file |
Log output file path |
--log-format |
text or json |
--log-level |
Logging verbosity |
--progress-format |
default, append, inplace, or json |
-t, --target |
Bundle target |
JSON input
Use --json with inline JSON or file reference:
# Inline (Linux/macOS)
databricks jobs create --json '{"name": "my-job", ...}'
# From file
databricks jobs create --json @job-config.json
Filter JSON output with jq:
databricks clusters get <id> | jq -r .cluster_name
Direct REST API access
databricks api get /api/2.0/clusters/list
databricks api post /api/2.0/clusters/create --json '{"cluster_name": "test", ...}'
databricks api post /api/2.0/clusters/edit --json @edit-cluster.json
Supports: get, post, put, patch, delete, head.
Command groups
For detailed subcommands, flags, and examples, see the reference files below.
Compute and runtime
- clusters - Cluster lifecycle (create, start, edit, resize, terminate, delete, pin). See references/compute.md.
- cluster-policies - Cluster configuration rules.
- libraries - Install/uninstall packages on clusters. See references/compute.md.
- instance-pools - Manage cloud instance pools.
- instance-profiles - IAM instance profile administration (AWS).
- policy-families - Available policy templates.
Jobs and pipelines
- jobs - Job lifecycle and run management (create, run-now, submit, cancel, repair, list-runs). See references/jobs-pipelines.md.
- pipelines - Lakeflow / DLT pipeline management and deployment. See references/jobs-pipelines.md.
Workspace and files
- fs - File operations on Unity Catalog volumes and DBFS (cat, cp, ls, mkdir, rm). See references/workspace.md.
- workspace - Notebooks and folders (import, export, list, delete, mkdirs). See references/workspace.md.
- repos - Git repository management. See references/workspace.md.
- secrets - Secret scopes, secrets, and ACLs. See references/workspace.md.
- git-credentials - Personal access token registration for Git.
Unity Catalog
- catalogs - Create, list, update, delete catalogs. See references/unity-catalog.md.
- schemas - Manage schemas within catalogs.
- tables - Table metadata (get, list, delete, exists).
- volumes - File storage with governance. See references/unity-catalog.md.
- grants - Data access authorisation. See references/unity-catalog.md.
- credentials, storage-credentials - Authentication for external storage.
- connections - External data source linkage.
- functions - User-defined function management.
- metastores - Top-level container management.
- registered-models, model-versions - MLflow registry in UC.
- online-tables - Low-latency data access.
- quality-monitors - Data quality metric tracking.
SQL and analytics
- warehouses - SQL warehouse lifecycle (create, start, stop, edit, permissions). See references/sql-analytics.md.
- queries - SQL query CRUD. See references/sql-analytics.md.
- alerts - SQL alert management.
- dashboards, lakeview - Dashboard operations.
- query-history - Query execution history.
- data-sources - Data source listing.
ML and serving
- serving-endpoints - Model endpoint deployment, querying, and AI Gateway. See references/ml-serving.md.
- experiments - MLflow experiment and run management.
- model-registry - Model version and transition management.
- feature-engineering - Databricks Feature Store operations.
- vector-search-endpoints, vector-search-indexes - Embedding search infrastructure.
Identity and access
- auth - Authentication management. See references/identity.md.
- current-user - Authenticated user info.
- users, groups, service-principals - Identity management.
- permissions - Access control for any resource type. See references/identity.md.
Bundles (infrastructure as code)
- bundle - Deploy, run, validate, and manage Databricks Asset Bundles. See references/bundles.md.
- sync - Local-to-workspace directory synchronisation.
Account administration
- account - Multi-workspace account-level management (identity, Unity Catalog, billing, networking, OAuth). See references/account.md.
Utilities
- completion - Shell autocompletion setup.
- labs - Community extension management.
- version - CLI version information.
- configure - Legacy configuration command.
Common patterns
Wait vs no-wait
Long-running operations (cluster start, job run) block by default. Use --no-wait to return immediately, --timeout to set a deadline:
databricks clusters start <id> --no-wait
databricks jobs run-now <job-id> --timeout 30m
Permission management
Most resource types support four permission commands:
databricks <resource> get-permission-levels <id>
databricks <resource> get-permissions <id>
databricks <resource> set-permissions <id> --json @perms.json
databricks <resource> update-permissions <id> --json @perms.json
Pagination
List commands with large result sets support pagination:
databricks jobs list --limit 10 --page-token <token>
Proxy support
Set HTTPS_PROXY environment variable to route requests through a proxy.
1---2name: databricks-cli3description: Expert guidance for using the Databricks CLI to manage Databricks workspaces, clusters, jobs, pipelines, Unity Catalog, SQL warehouses, serving endpoints, secrets, bundles, and all other Databricks resources. Use this skill when running databricks commands, managing Databricks infrastructure, deploying bundles, querying serving endpoints, managing Unity Catalog objects, or automating Databricks workflows. Trigger keywords include "databricks", "databricks cli", "dbfs", "unity catalog", "databricks bundle", "databricks jobs", "databricks clusters", "sql warehouse", "serving endpoint", "databricks secrets".4---5
6# Databricks CLI
7
8Comprehensive reference for the Databricks CLI (v0.205+). Covers authentication, all command groups, flags, and common patterns.
9
10## Command syntax
11
12```
13databricks <command-group> [<command>] [<subcommand>] [args] [--flags]
14```
15
16Get help at any level with `-h` or `--help`.
17
18## Authentication
19
20### OAuth U2M (interactive, recommended)
21
22```bash
23# Workspace-level
24databricks auth login --host https://<workspace>.cloud.databricks.com
25
26# Account-level
27databricks auth login --host https://accounts.cloud.databricks.com --account-id <id>
28```
29
30Saves credentials to `~/.databrickscfg` as a named profile. Tokens auto-refresh and expire in under an hour.
31
32### OAuth M2M (service principals)
33
34Add to `~/.databrickscfg`:
35
36```ini
37[my-sp-profile]
38host = https://<workspace>.cloud.databricks.com
39client_id = <service-principal-client-id>
40client_secret = <service-principal-oauth-secret>
41```
42
43### Credential resolution order
44
451. Bundle settings files (if running from bundle directory)
462. Environment variables (`DATABRICKS_HOST`, `DATABRICKS_TOKEN`, etc.)
473. `.databrickscfg` profiles
48
49### Profile management
50
51```bash
52databricks auth profiles # List all profiles
53databricks auth env -p PROD # Show profile settings
54databricks auth token -p PROD # Show current token
55databricks auth describe # Current auth config details
56```
57
58Use `-p <profile>` or `--profile <profile>` on any command. Default profile is `DEFAULT`.
59
60## Global flags
61
62| Flag | Description |
63| ------------------- | ----------------------------------------- |
64| `--debug` | Enable debug logging |
65| `-h, --help` | Display help |
66| `-o, --output` | Output format: `text` or `json` |
67| `-p, --profile` | Config profile from `~/.databrickscfg` |
68| `--log-file` | Log output file path |
69| `--log-format` | `text` or `json` |
70| `--log-level` | Logging verbosity |
71| `--progress-format` | `default`, `append`, `inplace`, or `json` |
72| `-t, --target` | Bundle target |
73
74## JSON input
75
76Use `--json` with inline JSON or file reference:
77
78```bash
79# Inline (Linux/macOS)
80databricks jobs create --json '{"name": "my-job", ...}'
81
82# From file
83databricks jobs create --json @job-config.json
84```
85
86Filter JSON output with `jq`:
87
88```bash
89databricks clusters get <id> | jq -r .cluster_name
90```
91
92## Direct REST API access
93
94```bash
95databricks api get /api/2.0/clusters/list
96databricks api post /api/2.0/clusters/create --json '{"cluster_name": "test", ...}'
97databricks api post /api/2.0/clusters/edit --json @edit-cluster.json
98```
99
100Supports: `get`, `post`, `put`, `patch`, `delete`, `head`.
101
102## Command groups
103
104For detailed subcommands, flags, and examples, see the reference files below.
105
106### Compute and runtime
107
108- **clusters** - Cluster lifecycle (create, start, edit, resize, terminate, delete, pin). See [references/compute.md](references/compute.md).
109- **cluster-policies** - Cluster configuration rules.
110- **libraries** - Install/uninstall packages on clusters. See [references/compute.md](references/compute.md).
111- **instance-pools** - Manage cloud instance pools.
112- **instance-profiles** - IAM instance profile administration (AWS).
113- **policy-families** - Available policy templates.
114
115### Jobs and pipelines
116
117- **jobs** - Job lifecycle and run management (create, run-now, submit, cancel, repair, list-runs). See [references/jobs-pipelines.md](references/jobs-pipelines.md).
118- **pipelines** - Lakeflow / DLT pipeline management and deployment. See [references/jobs-pipelines.md](references/jobs-pipelines.md).
119
120### Workspace and files
121
122- **fs** - File operations on Unity Catalog volumes and DBFS (cat, cp, ls, mkdir, rm). See [references/workspace.md](references/workspace.md).
123- **workspace** - Notebooks and folders (import, export, list, delete, mkdirs). See [references/workspace.md](references/workspace.md).
124- **repos** - Git repository management. See [references/workspace.md](references/workspace.md).
125- **secrets** - Secret scopes, secrets, and ACLs. See [references/workspace.md](references/workspace.md).
126- **git-credentials** - Personal access token registration for Git.
127
128### Unity Catalog
129
130- **catalogs** - Create, list, update, delete catalogs. See [references/unity-catalog.md](references/unity-catalog.md).
131- **schemas** - Manage schemas within catalogs.
132- **tables** - Table metadata (get, list, delete, exists).
133- **volumes** - File storage with governance. See [references/unity-catalog.md](references/unity-catalog.md).
134- **grants** - Data access authorisation. See [references/unity-catalog.md](references/unity-catalog.md).
135- **credentials**, **storage-credentials** - Authentication for external storage.
136- **connections** - External data source linkage.
137- **functions** - User-defined function management.
138- **metastores** - Top-level container management.
139- **registered-models**, **model-versions** - MLflow registry in UC.
140- **online-tables** - Low-latency data access.
141- **quality-monitors** - Data quality metric tracking.
142
143### SQL and analytics
144
145- **warehouses** - SQL warehouse lifecycle (create, start, stop, edit, permissions). See [references/sql-analytics.md](references/sql-analytics.md).
146- **queries** - SQL query CRUD. See [references/sql-analytics.md](references/sql-analytics.md).
147- **alerts** - SQL alert management.
148- **dashboards**, **lakeview** - Dashboard operations.
149- **query-history** - Query execution history.
150- **data-sources** - Data source listing.
151
152### ML and serving
153
154- **serving-endpoints** - Model endpoint deployment, querying, and AI Gateway. See [references/ml-serving.md](references/ml-serving.md).
155- **experiments** - MLflow experiment and run management.
156- **model-registry** - Model version and transition management.
157- **feature-engineering** - Databricks Feature Store operations.
158- **vector-search-endpoints**, **vector-search-indexes** - Embedding search infrastructure.
159
160### Identity and access
161
162- **auth** - Authentication management. See [references/identity.md](references/identity.md).
163- **current-user** - Authenticated user info.
164- **users**, **groups**, **service-principals** - Identity management.
165- **permissions** - Access control for any resource type. See [references/identity.md](references/identity.md).
166
167### Bundles (infrastructure as code)
168
169- **bundle** - Deploy, run, validate, and manage Databricks Asset Bundles. See [references/bundles.md](references/bundles.md).
170- **sync** - Local-to-workspace directory synchronisation.
171
172### Account administration
173
174- **account** - Multi-workspace account-level management (identity, Unity Catalog, billing, networking, OAuth). See [references/account.md](references/account.md).
175
176### Utilities
177
178- **completion** - Shell autocompletion setup.
179- **labs** - Community extension management.
180- **version** - CLI version information.
181- **configure** - Legacy configuration command.
182
183## Common patterns
184
185### Wait vs no-wait
186
187Long-running operations (cluster start, job run) block by default. Use `--no-wait` to return immediately, `--timeout` to set a deadline:
188
189```bash
190databricks clusters start <id> --no-wait
191databricks jobs run-now <job-id> --timeout 30m
192```
193
194### Permission management
195
196Most resource types support four permission commands:
197
198```bash
199databricks <resource> get-permission-levels <id>
200databricks <resource> get-permissions <id>
201databricks <resource> set-permissions <id> --json @perms.json
202databricks <resource> update-permissions <id> --json @perms.json
203```
204
205### Pagination
206
207List commands with large result sets support pagination:
208
209```bash
210databricks jobs list --limit 10 --page-token <token>
211```
212
213### Proxy support
214
215Set `HTTPS_PROXY` environment variable to route requests through a proxy.