Databricks cli

From aehrc/pathling · View interactive version

Databricks cli is an AI agent skill from the GitHub repository aehrc/pathling. 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, deploy

How to use this skill

Skill file

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

  1. Bundle settings files (if running from bundle directory)
  2. Environment variables (DATABRICKS_HOST, DATABRICKS_TOKEN, etc.)
  3. .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

Jobs and pipelines

Workspace and files

Unity Catalog

SQL and analytics

ML and serving

Identity and access

Bundles (infrastructure as code)

Account administration

Utilities

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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.