Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

databricks-clidatabricks CLI 搜索

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

291

周安装

12

GitHub Stars

2

下载量

95
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:databricks-cli(databricks CLI 搜索)
来源仓库:https://github.com/bmsuisse/skills
仓库路径:skills/databricks-cli
安装命令:
npx skills add https://github.com/bmsuisse/skills --skill databricks-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/bmsuisse/skills --skill databricks-cli

简介

作为 Databricks 核心 CLI 操作和数据探索的基础技能。

  • 支持认证管理、工作区切换及专用产品技能调用(如 jobs、pipelines)。
  • 必须安装 v0.292.0+ 版本的 databricks CLI 方可正常使用。
  • 推荐优先使用 MCP 工具而非直接编辑 ~/.databrickscfg 文件。
  • databricks-cli 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Databricks

Core skill for Databricks CLI, authentication, and data exploration.

Product Skills

For specific products, use dedicated skills:

  • databricks-jobs - Lakeflow Jobs development and deployment
  • databricks-pipelines - Lakeflow Spark Declarative Pipelines (batch and streaming data pipelines)
  • databricks-apps - Full-stack TypeScript app development and deployment
  • databricks-lakebase - Lakebase Postgres Autoscaling project management

Prerequisites

  1. CLI installed: Run databricks --version to check.

- If the CLI is missing or outdated (< v0.292.0): STOP. Do not proceed or work around a missing CLI. - Read the CLI Installation reference file and follow the instructions to guide the user through installation. - Note: In sandboxed environments (Cursor IDE, containers), install commands write outside the workspace and may be blocked. Present the install command to the user and ask them to run it in their own terminal.

  1. Authenticated: databricks auth profiles

- If not: see CLI Authentication

Profile Selection - CRITICAL

NEVER auto-select a profile.

  1. List profiles: databricks auth profiles
  2. Present ALL profiles to user with workspace URLs
  3. Let user choose (even if only one exists)
  4. Offer to create new profile if needed

Claude Code - IMPORTANT

Each Bash command runs in a separate shell session.

# WORKS: --profile flag
databricks apps list --profile my-workspace

# WORKS: chained with &&
export DATABRICKS_CONFIG_PROFILE=my-workspace && databricks apps list

# DOES NOT WORK: separate commands
export DATABRICKS_CONFIG_PROFILE=my-workspace
databricks apps list  # profile not set!

Data Exploration — Use AI Tools

Use these instead of manually navigating catalogs/schemas/tables:

# discover table structure (columns, types, sample data, stats)
databricks experimental aitools tools discover-schema catalog.schema.table --profile <PROFILE>

# run ad-hoc SQL queries
databricks experimental aitools tools query "SELECT * FROM table LIMIT 10" --profile <PROFILE>

# find the default warehouse
databricks experimental aitools tools get-default-warehouse --profile <PROFILE>

See Data Exploration for details.

Quick Reference

⚠️ CRITICAL: Some commands use positional arguments, not flags

# current user
databricks current-user me --profile <PROFILE>

# list resources
databricks apps list --profile <PROFILE>
databricks jobs list --profile <PROFILE>
databricks clusters list --profile <PROFILE>
databricks warehouses list --profile <PROFILE>
databricks pipelines list --profile <PROFILE>
databricks serving-endpoints list --profile <PROFILE>

# ⚠️ Unity Catalog — POSITIONAL arguments (NOT flags!)
databricks catalogs list --profile <PROFILE>

# ✅ CORRECT: positional args
databricks schemas list <CATALOG> --profile <PROFILE>
databricks tables list <CATALOG> <SCHEMA> --profile <PROFILE>
databricks tables get <CATALOG>.<SCHEMA>.<TABLE> --profile <PROFILE>

# ❌ WRONG: these flags/commands DON'T EXIST
# databricks schemas list --catalog-name <CATALOG>    ← WILL FAIL
# databricks tables list --catalog <CATALOG>           ← WILL FAIL
# databricks sql-warehouses list                       ← doesn't exist, use `warehouses list`
# databricks execute-statement                         ← doesn't exist, use `experimental aitools tools query`
# databricks sql execute                               ← doesn't exist, use `experimental aitools tools query`

# When in doubt, check help:
# databricks schemas list --help

# get details
databricks apps get <NAME> --profile <PROFILE>
databricks jobs get --job-id <ID> --profile <PROFILE>
databricks clusters get --cluster-id <ID> --profile <PROFILE>

# bundles
databricks bundle init --profile <PROFILE>
databricks bundle validate --profile <PROFILE>
databricks bundle deploy -t <TARGET> --profile <PROFILE>
databricks bundle run <RESOURCE> -t <TARGET> --profile <PROFILE>

Clusters

Default: general-purpose

Use for all standard workloads (data exploration, SQL, non-GPU notebooks).

ItemValue
Cluster ID*(look up via databricks clusters list --profile <PROFILE>)*
Runtime17.3 LTS (Spark 4.0.0, Scala 2.13)
Worker typeStandard_D8ads_v5 (32 GB, 8 cores)
Autoscaling1–12 workers
Idle termination60 min
Access modeStandard
Unity Catalog

GPU/ML: machine-learning (gpu)

Use for GPU-accelerated training, inference, and embedding workloads.

ItemValue
Cluster ID0303-075313-aono4t6a
Runtime17.3 LTS (Spark 4.0.0, Scala 2.13)
Node typeStandard_NV36ads_A10_v5 (440 GB, 1× A10 GPU, 36 cores)
ModeSingle node
Idle termination60 min
Access modeDedicated — bms_dev
Unity Catalog

Running Notebooks on the Cluster

Upload a local .py notebook to the Databricks workspace and execute it on the cluster via the generic runner job, with automatic error fixing and retry.

Default cluster: general-purpose — use machine-learning (gpu) only when GPU acceleration is needed.

Config

ItemValue
Profilepremium
Runner job ID194658749253431
Workspace base/Users/dominik.peter@bmsuisse.ch/AIActionPlan/notebooks/
Cluster ID (default)*(general-purpose — see Clusters section above)*
Cluster ID (GPU)0303-075313-aono4t6a
Max retries3

Steps

1. Derive workspace path — strip .py, keep filename:

local:     notebooks/3.1-sales-visit-scoring.py
workspace: /Users/dominik.peter@bmsuisse.ch/AIActionPlan/notebooks/3.1-sales-visit-scoring

2. Upload:

databricks workspace import "<WORKSPACE_PATH>" \
  --file "<LOCAL_PATH>" --format SOURCE --language PYTHON \
  --overwrite --profile premium

3. Trigger:

databricks jobs run-now --profile premium --json '{
  "job_id": 194658749253431,
  "notebook_params": {"notebook_path": "<WORKSPACE_PATH>"}
}'

Capture both the top-level run_id and tasks[0].run_id (task run ID) from the response.

4. Check result — look at state.result_state: SUCCESS → done, FAILED → fix and retry.

5. Fetch error using the task run_id:

databricks api get "/api/2.1/jobs/runs/get-output" \
  --profile premium --json '{"run_id": <TASK_RUN_ID>}'

Read error (short) and error_trace (full traceback).

6. Fix and retry — read the local notebook, fix the root cause, re-upload, rerun. After 3 failed attempts stop and explain what was tried.

Common error fixes

ErrorFix
ModuleNotFoundErrorAdd %pip install <pkg> at top of notebook
Table not foundVerify with SQL query below
KeyError / ColumnNotFoundInspect schema with SQL
FileNotFoundError (DBFS)Verify path on DBFS
Syntax errorFix the offending line

Ad-hoc Job Submit

Run a notebook (or Python script already uploaded to the workspace) directly as a one-time job — no runner job wrapper needed.

⚠️ The CLI uses a tasks array, not top-level existing_cluster_id / notebook_task.

databricks jobs submit --profile premium --json '{
  "run_name": "my_ad_hoc_run",
  "tasks": [{
    "task_key": "main",
    "existing_cluster_id": "<CLUSTER_ID>",
    "notebook_task": {
      "notebook_path": "<WORKSPACE_PATH>",
      "base_parameters": {"sample": "500", "epochs": "1"}
    }
  }]
}'

Capture the run_id from the response, then poll and fetch output the same way as the runner job (steps 4–6 above).

For Python scripts (not notebooks), use spark_python_task instead:

databricks jobs submit --profile premium --json '{
  "run_name": "my_script_run",
  "tasks": [{
    "task_key": "main",
    "existing_cluster_id": "<CLUSTER_ID>",
    "spark_python_task": {
      "python_file": "<WORKSPACE_PATH>.py",
      "parameters": ["--sample", "500"]
    }
  }]
}'

Scripts

All scripts are accessed through the single entrypoint scripts/cli.py. run.py and metadata.py are libraries — do not invoke them directly.

uv run scripts/cli.py <subcommand> [flags]

run — Execute code on a cluster

Opens an execution context, runs Python or SQL, polls for the result, prints output, and cleans up.

# Python — inline
uv run scripts/cli.py run \
  --profile premium \
  --cluster-id <CLUSTER_ID> \
  --lang python \
  --code "print(spark.version)"

# Python — from a local file (language inferred from .py extension)
uv run scripts/cli.py run \
  --profile premium \
  --cluster-id <CLUSTER_ID> \
  --file path/to/script.py

# SQL
uv run scripts/cli.py run \
  --profile premium \
  --cluster-id <CLUSTER_ID> \
  --lang sql \
  --code "SELECT * FROM catalog.schema.table LIMIT 10"

# Pass arguments to a Python script (injected as ARGS dict)
uv run scripts/cli.py run \
  --profile premium \
  --cluster-id <CLUSTER_ID> \
  --file migrate.py \
  --args '{"catalog": "prod", "dry_run": true}'

Inside the script, read from ARGS instead of sys.argv:

catalog = ARGS["catalog"]
dry_run = ARGS.get("dry_run", False)

Flags

FlagDefaultDescription
--profile*(required)*Databricks CLI profile
--cluster-id*(required)*Cluster to run on
--langinferred from file extpython \sql \r \scala
--codeInline code string (mutually exclusive with --file)
--fileLocal script file
--argsJSON dict injected as ARGS variable (Python only)
--formattexttext \markdown (renders SQL results as a table)
--poll-interval2.0Seconds between status polls
--no-destroyoffKeep context open after run

Stdout goes to stdout; errors and tracebacks go to stderr with a non-zero exit code.

tables — List tables in a schema

uv run scripts/cli.py tables \
  --profile premium \
  --catalog <CATALOG> \
  --schema <SCHEMA>

Outputs a markdown table with fully qualified name, table type, and description. No cluster needed.

describe — Full metadata for a table

uv run scripts/cli.py describe \
  --profile premium \
  <CATALOG.SCHEMA.TABLE>

Outputs table type, owner, comment, and a column-level table with types, nullability, and per-column descriptions. No cluster needed.

search — Find tables by keyword

# Search across all catalogs
uv run scripts/cli.py search --profile premium <KEYWORD>

# Restrict to a specific catalog
uv run scripts/cli.py search --profile premium <KEYWORD> --catalog <CATALOG>

Queries system.information_schema.tables via experimental aitools tools query. No cluster needed.

Running SQL on the Cluster

Use the execution context API to run SQL directly on the cluster — full Spark + Unity Catalog access, no separate warehouse needed. Prefer this over the SQL warehouse when debugging notebook errors (same Spark session, sees temp views and uncommitted Delta writes).

Use general-purpose for standard SQL; use machine-learning (gpu) (0303-075313-aono4t6a) for GPU workloads.

# 1. Create context (use general-purpose cluster ID; swap for GPU cluster if needed)
databricks api post /api/1.2/contexts/create --profile premium \
  --json '{"clusterId": "<CLUSTER_ID>", "language": "python"}'

# 2. Execute (use spark.sql() for SQL, or any Python)
databricks api post /api/1.2/commands/execute --profile premium --json '{
  "clusterId": "<CLUSTER_ID>",
  "contextId": "<CONTEXT_ID>",
  "language": "python",
  "command": "spark.sql(\"SELECT * FROM transf.sales LIMIT 5\").show(truncate=False)"
}'

# 3. Poll until status = Finished
databricks api get /api/1.2/commands/status --profile premium --json '{
  "clusterId": "0303-075313-aono4t6a",
  "contextId": "<CONTEXT_ID>",
  "commandId": "<COMMAND_ID>"
}'

Useful diagnostic queries:

spark.sql("DESCRIBE EXTENDED <catalog>.<schema>.<table>").show(truncate=False)
spark.sql("SELECT * FROM <table> LIMIT 10").show(truncate=False)
spark.sql("SHOW TABLES IN <schema>").show()

Troubleshooting

ErrorSolution
cannot configure default credentialsUse --profile flag or authenticate first
PERMISSION_DENIEDCheck workspace/UC permissions
RESOURCE_DOES_NOT_EXISTVerify resource name/id and profile

Required Reading by Task

TaskREAD BEFORE proceeding
First time setupCLI Installation
Auth issues / new workspaceCLI Authentication
Exploring tables/schemasData Exploration
Deploying jobs/pipelinesAsset Bundles

Reference Guides

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.16%
按下载量换算33

Claude

29.31%
按下载量换算28

Cursor

19.32%
按下载量换算18

Gemini CLI

10.62%
按下载量换算10

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/bmsuisse/skills --skill databricks-cli 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills