重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
databricks-apps by databricks/databricks-agent-skills
npx skills add https://github.com/databricks/databricks-agent-skills --skill databricks-apps首要步骤:使用父级 databricks 技能处理 CLI 基础、身份验证和配置文件选择。
构建可部署到 Databricks 应用平台的应用。
| 阶段 | 在继续之前请阅读 |
|---|---|
| 脚手架搭建 | 父级 databricks 技能(身份验证、仓库发现);运行 databricks apps manifest 并使用其插件/资源,结合 --features 和 --set 来构建 databricks apps init(参见下文 AppKit 部分) |
| 编写 SQL 查询 | SQL 查询指南 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 编写 UI 组件 | 前端指南 |
使用 useAnalyticsQuery | AppKit SDK |
| 添加 API 端点 | tRPC 指南 |
| 使用 Lakebase(OLTP 数据库) | Lakebase 指南 |
| 平台规则(权限、部署、限制) | 平台指南 — 所有应用(包括 AppKit)都必须阅读 |
| 非 AppKit 应用(Streamlit、FastAPI、Flask、Gradio、Next.js 等) | 其他框架 |
databricks apps validate --profile <PROFILE>。tests/smoke.spec.ts 中的选择器。默认模板会检查 "Minimal Databricks App" 标题和 "hello world" 文本——这些在你的自定义应用中会失败。请参阅测试指南。databricks 技能涵盖。databricks apps init --features analytics 后)client/src/App.tsx — 主要的 React 组件(从此处开始)config/queries/*.sql — SQL 查询文件(queryKey = 不带 .sql 扩展名的文件名)server/server.ts — 后端入口(tRPC 路由器)tests/smoke.spec.ts — 冒烟测试(⚠️ 必须为你的应用更新选择器)client/src/appKitTypes.d.ts — 自动生成的类型(运行 npm run typegen)databricks apps init --features lakebase 后)server/server.ts — 包含 Lakebase 连接池和 tRPC 路由的后端client/src/App.tsx — React 前端app.yaml — 包含 database 资源声明的清单package.json — 包含 @databricks/lakebase 依赖项config/queries/ 目录 — Lakebase 应用在 tRPC 中使用 pool.query(),而非 SQL 文件在编写任何 SQL 之前,使用父级 databricks 技能进行数据探索——通过关键词搜索 information_schema,然后对你需要的表批量执行 discover-schema。切勿跳过此步骤。
分析应用(--features analytics):
config/queries/ 中创建 SQL 文件npm run typegen — 验证所有查询是否显示 ✓client/src/appKitTypes.d.ts 以查看生成的类型App.tsxtests/smoke.spec.ts 中的选择器databricks apps validate --profile <PROFILE>切勿在运行 typegen 之前编写 UI 代码——类型将不存在,你会浪费时间处理编译错误。
Lakebase 应用(--features lakebase):没有 SQL 文件或 typegen。请参阅 Lakebase 指南了解 tRPC 模式:在启动时初始化模式,在 server/server.ts 中编写过程,然后构建 React 前端。
queryKey 属性的可视化组件useAnalyticsQuery 钩子useAnalyticsQuery,在客户端进行转换config/queries/ 中的 SQL 文件useAnalyticsQuery 处理 Lakebase 数据 — 它仅查询 SQL 仓库具有类型安全 SQL 查询和内置组件的 TypeScript/React 框架。
官方文档 — 所有 API 细节的权威来源:
npx @databricks/appkit docs # ← 始终从这里开始,查看可用页面
npx @databricks/appkit docs <query> # 按名称或文档路径查看某个部分
npx @databricks/appkit docs --full # 包含所有 API 条目的完整索引
npx @databricks/appkit docs "appkit-ui API reference" # 示例:按名称查看部分
npx @databricks/appkit docs ./docs/plugins/analytics.md # 示例:特定文档文件
切勿猜测文档路径。 先不带参数运行,从索引中选择。<query> 参数既接受部分名称(来自索引),也接受文件路径。文档是关于组件属性、钩子签名和服务器 API 的权威来源——技能文件仅涵盖反模式和注意事项。
应用清单和脚手架搭建
代理搭建脚手架的工作流:首先获取清单,然后构建 init 命令。
获取清单(描述插件及其资源的 JSON 模式):
databricks apps manifest --profile <PROFILE>
# 查看特定 AppKit 版本中可用的插件:
databricks apps manifest --version <VERSION> --profile <PROFILE>
# 自定义模板:
databricks apps manifest --template <GIT_URL> --profile <PROFILE>
输出定义了:
* **插件**:每个插件都有一个键(用于 `--features` 的插件 ID),以及 `requiredByTemplate` 和 `resources`。
* **requiredByTemplate**:如果为 **true**,则该插件对此模板是**强制性的** — **不要**将其添加到 `--features` 中(它会自动包含);你仍然必须通过 `--set` 提供其所有必需资源。如果为 **false** 或不存在,则该插件是**可选的** — 仅当用户的提示表明他们需要该功能(例如分析/SQL)时,才将其添加到 `--features` 中,然后通过 `--set` 提供其必需资源。
* **资源**:每个插件都有 `resources.required` 和 `resources.optional`(数组)。每个项目都有 `resourceKey` 和 `fields`(对象:字段名 → 描述/env)。对于你包含的每个插件的每个必需资源字段,使用 `--set <plugin>.<resourceKey>.<field>=<value>`。
2. 搭建脚手架(不要使用 npx;仅使用 CLI):
databricks apps init --name <NAME> --features <plugin1>,<plugin2> \
--set <plugin1>.<resourceKey>.<field>=<value> \
--set <plugin2>.<resourceKey>.<field>=<value> \
--description "<DESC>" --run none --profile <PROFILE>
# --run none: 脚手架搭建后跳过自动运行(先审查代码)
# 使用自定义模板:
databricks apps init --template <GIT_URL> --name <NAME> --features ... --set ... --profile <PROFILE>
可选地使用 --version <VERSION> 来定位特定的 AppKit 版本。
* **必需项**:`--name`、`--profile`。名称:≤26 个字符,仅限小写字母/数字/连字符。仅当用户需要**可选**插件(`requiredByTemplate: false` 或不存在的插件)时,才使用 `--features`;强制性插件**不得**列在 `--features` 中。
* **资源**:对于以下情况的所有必需资源(`resources.required` 中的每个字段),传递 `--set`:(1) 所有 `requiredByTemplate: true` 的插件,以及 (2) 你添加到 `--features` 中的任何可选插件。仅当用户请求时,才为 `resources.optional` 添加 `--set`。
* **发现**:使用父级 `databricks` 技能来解析 ID(例如仓库:`databricks warehouses list --profile <PROFILE>` 或 `databricks experimental aitools tools get-default-warehouse --profile <PROFILE>`)。
切勿猜测插件名称、资源键或属性名称——始终从 databricks apps manifest 的输出中推导。例如:如果清单显示插件 analytics 有一个必需资源 resourceKey: "sql-warehouse" 和 fields: { "id": ... },则包含 --set analytics.sql-warehouse.id=<ID>。
阅读 AppKit 概述 以了解项目结构、工作流和实施前检查清单。
# ❌ 错误:name 不是位置参数
databricks apps init --features analytics my-app-name
# → "unknown command" 错误
# ✅ 正确:使用 --name 标志
databricks apps init --name my-app-name --features analytics --set "..." --profile <PROFILE>
databricks apps init 会创建与应用名称匹配的 kebab-case 目录。应用名称必须为小写,仅包含连字符(≤26 个字符)。
Databricks 应用支持任何作为 HTTP 服务器运行的框架。LLM 已经了解这些框架——挑战在于 Databricks 平台集成。
在构建任何非 AppKit 应用之前,请阅读其他框架指南。 它涵盖了端口/主机配置、app.yaml 和 databricks.yml 设置、依赖管理、网络以及特定框架的注意事项。
每周安装次数
64
仓库
GitHub 星标
48
首次出现
2026年2月14日
安全审计
安装于
cursor55
opencode46
github-copilot46
gemini-cli45
amp45
codex45
FIRST : Use the parent databricks skill for CLI basics, authentication, and profile selection.
Build apps that deploy to Databricks Apps platform.
| Phase | READ BEFORE proceeding |
|---|---|
| Scaffolding | Parent databricks skill (auth, warehouse discovery); run databricks apps manifest and use its plugins/resources to build databricks apps init with --features and --set (see AppKit section below) |
| Writing SQL queries | SQL Queries Guide |
| Writing UI components | Frontend Guide |
Using useAnalyticsQuery | AppKit SDK |
| Adding API endpoints | tRPC Guide |
| Using Lakebase (OLTP database) | Lakebase Guide |
| Platform rules (permissions, deployment, limits) | Platform Guide — READ for ALL apps including AppKit |
| Non-AppKit app (Streamlit, FastAPI, Flask, Gradio, Next.js, etc.) | Other Frameworks |
databricks apps validate --profile <PROFILE> before deploying.tests/smoke.spec.ts selectors BEFORE running validation. Default template checks for "Minimal Databricks App" heading and "hello world" text — these WILL fail in your custom app. See testing guide.databricks skill.databricks apps init --features analytics)client/src/App.tsx — main React component (start here)config/queries/*.sql — SQL query files (queryKey = filename without .sql)server/server.ts — backend entry (tRPC routers)tests/smoke.spec.ts — smoke test (⚠️ MUST UPDATE selectors for your app)client/src/appKitTypes.d.ts — auto-generated types (npm run typegen)databricks apps init --features lakebase)server/server.ts — backend with Lakebase pool + tRPC routesclient/src/App.tsx — React frontendapp.yaml — manifest with database resource declarationpackage.json — includes @databricks/lakebase dependencyconfig/queries/ — Lakebase apps use pool.query() in tRPC, not SQL filesBefore writing any SQL, use the parent databricks skill for data exploration — search information_schema by keyword, then batch discover-schema for the tables you need. Do NOT skip this step.
Analytics apps (--features analytics):
config/queries/npm run typegen — verify all queries show ✓client/src/appKitTypes.d.ts to see generated typesApp.tsx using the generated typestests/smoke.spec.ts selectorsdatabricks apps validate --profile <PROFILE>DO NOT write UI code before running typegen — types won't exist and you'll waste time on compilation errors.
Lakebase apps (--features lakebase): No SQL files or typegen. See Lakebase Guide for the tRPC pattern: initialize schema at startup, write procedures in server/server.ts, then build the React frontend.
queryKey propuseAnalyticsQuery hookuseAnalyticsQuery, transform client-sideconfig/queries/useAnalyticsQuery for Lakebase data — it queries the SQL warehouse onlyTypeScript/React framework with type-safe SQL queries and built-in components.
Official Documentation — the source of truth for all API details:
npx @databricks/appkit docs # ← ALWAYS start here to see available pages
npx @databricks/appkit docs <query> # view a section by name or doc path
npx @databricks/appkit docs --full # full index with all API entries
npx @databricks/appkit docs "appkit-ui API reference" # example: section by name
npx @databricks/appkit docs ./docs/plugins/analytics.md # example: specific doc file
DO NOT guess doc paths. Run without args first, pick from the index. The <query> argument accepts both section names (from the index) and file paths. Docs are the authority on component props, hook signatures, and server APIs — skill files only cover anti-patterns and gotchas.
App Manifest and Scaffolding
Agent workflow for scaffolding: get the manifest first, then build the init command.
Get the manifest (JSON schema describing plugins and their resources):
databricks apps manifest --profile <PROFILE>
# See plugins available in a specific AppKit version:
databricks apps manifest --version <VERSION> --profile <PROFILE>
# Custom template:
databricks apps manifest --template <GIT_URL> --profile <PROFILE>
The output defines:
* **Plugins** : each has a key (plugin ID for `--features`), plus `requiredByTemplate`, and `resources`.
* **requiredByTemplate** : If **true** , that plugin is **mandatory** for this template — do **not** add it to `--features` (it is included automatically); you must still supply all of its required resources via `--set`. If **false** or absent, the plugin is **optional** — add it to `--features` only when the user's prompt indicates they want that capability (e.g. analytics/SQL), and then supply its required resources via `--set`.
* **Resources** : Each plugin has `resources.required` and `resources.optional` (arrays). Each item has `resourceKey` and `fields` (object: field name → description/env). Use `--set <plugin>.<resourceKey>.<field>=<value>` for each required resource field of every plugin you include.
2. Scaffold (DO NOT use npx; use the CLI only):
databricks apps init --name <NAME> --features <plugin1>,<plugin2> \
--set <plugin1>.<resourceKey>.<field>=<value> \
--set <plugin2>.<resourceKey>.<field>=<value> \
--description "<DESC>" --run none --profile <PROFILE>
# --run none: skip auto-run after scaffolding (review code first)
# With custom template:
databricks apps init --template <GIT_URL> --name <NAME> --features ... --set ... --profile <PROFILE>
Optionally use --version <VERSION> to target a specific AppKit version.
* **Required** : `--name`, `--profile`. Name: ≤26 chars, lowercase letters/numbers/hyphens only. Use `--features` only for **optional** plugins the user wants (plugins with `requiredByTemplate: false` or absent); mandatory plugins must not be listed in `--features`.
* **Resources** : Pass `--set` for every required resource (each field in `resources.required`) for (1) all plugins with `requiredByTemplate: true`, and (2) any optional plugins you added to `--features`. Add `--set` for `resources.optional` only when the user requests them.
* **Discovery** : Use the parent `databricks` skill to resolve IDs (e.g. warehouse: `databricks warehouses list --profile <PROFILE>` or `databricks experimental aitools tools get-default-warehouse --profile <PROFILE>`).
DO NOT guess plugin names, resource keys, or property names — always derive them from databricks apps manifest output. Example: if the manifest shows plugin analytics with a required resource resourceKey: "sql-warehouse" and fields: { "id": ... }, include --set analytics.sql-warehouse.id=<ID>.
READAppKit Overview for project structure, workflow, and pre-implementation checklist.
# ❌ WRONG: name is NOT a positional argument
databricks apps init --features analytics my-app-name
# → "unknown command" error
# ✅ CORRECT: use --name flag
databricks apps init --name my-app-name --features analytics --set "..." --profile <PROFILE>
databricks apps init creates directories in kebab-case matching the app name. App names must be lowercase with hyphens only (≤26 chars).
Databricks Apps supports any framework that runs as an HTTP server. LLMs already know these frameworks — the challenge is Databricks platform integration.
READOther Frameworks Guide BEFORE building any non-AppKit app. It covers port/host configuration, app.yaml and databricks.yml setup, dependency management, networking, and framework-specific gotchas.
Weekly Installs
64
Repository
GitHub Stars
48
First Seen
Feb 14, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
cursor55
opencode46
github-copilot46
gemini-cli45
amp45
codex45
Azure RBAC 权限管理工具:查找最小角色、创建自定义角色与自动化分配
154,300 周安装