Skip to content

Commit d8bda62

Browse files
Promote aitools skills-management commands to top-level (#4917)
## Summary Promotes the **aitools skills-management surface** out of `experimental/` so the stable half lives at `databricks aitools …` and slots in next to the other top-level command groups. The matching **interface changes** (`--scope` enum, `--project`/`--global` deprecation, `--agents` auto-detect doc) live in a stacked follow-up: **#5234**. This is mostly a move, but it is not move-only — see [Non-move changes](#non-move-changes) below. - Source files for `install`, `update`, `uninstall`, `list`, `version` (and the agents/installer libs they depend on) physically move from `experimental/aitools/` to `cmd/aitools/` + `libs/aitools/`, matching the existing `cmd/apps/` + `libs/apps/` layout. OWNERS, Taskfile, and the pr-checklist skill are updated to match. - The top-level command is registered at `databricks aitools …`. - **Keeps the `tools` subtree under `experimental/aitools/`** — `query`, `discover-schema`, `get-default-warehouse`, `statement …` — because `tools.go` still says "There are no stability guarantees for these tools". - The old paths under `databricks experimental aitools install/update/uninstall/list/version` and `databricks experimental aitools skills install/list` keep working as **deprecated backward-compat aliases** that print a notice pointing at the new path (via cobra's `Deprecated` field). The aitools skills-management surface is feature-complete after the 5-PR series (#4810#4814) that added state tracking, lifecycle commands, and project scope support. The `tools` subtree is functionally useful but its shape is still in flux, so promoting only the stable half. ## Non-move changes In addition to the file moves, this PR: - Removes the redundant `aitools/README.md` (apps/pipelines don't carry one); the same info lives in the command's Long description. - Rewrites the Long description on the new top-level `databricks aitools` command. - Adds a deprecation notice to every legacy alias under `databricks experimental aitools` (Lennart's review ask — they used to forward silently). - Refactors how the legacy `experimental aitools skills install [name]` wrapper is wired: the wrapper now lives in `cmd/aitools/legacy_skills.go` alongside the install code it wraps, and the previously-exported test-injection vars (`InstallSkillsForAgentsFn`, `ListSkillsFn`, `PromptAgentSelection`) are back to unexported. The two now-empty experimental files (`experimental/aitools/cmd/skills.go` and `skills_test.go`) are deleted. ## What's not in this PR These are deliberately separated and reviewed independently: - **#5234** — `--scope=project|global|both` flag, deprecation of `--project`/`--global` via `cobra.Deprecated`, `--agents` auto-detect help text. - **#5233** (draft) — `--output json` on `databricks aitools list`. ## Command shape after this PR ``` # Stable, top-level databricks aitools install # use --skills <name>[,<name>...] for specific skills databricks aitools update databricks aitools uninstall databricks aitools list databricks aitools version # Backward-compat aliases (print deprecation notice; point at the new paths) databricks experimental aitools install/update/uninstall/list/version databricks experimental aitools skills {list,install} # Experimental, unchanged path databricks experimental aitools tools query databricks experimental aitools tools discover-schema databricks experimental aitools tools get-default-warehouse databricks experimental aitools tools statement {submit,get,status,cancel} ``` ## Test plan - [x] `databricks aitools --help` shows install/update/uninstall/list/version (no `tools`) - [x] `databricks --help` lists `aitools` in the output - [x] `databricks experimental aitools install` prints a deprecation notice and still forwards - [x] `databricks experimental aitools tools query …` runs as before - [x] `databricks experimental aitools tools --help` lists query/discover-schema/get-default-warehouse/statement - [x] Existing aitools tests pass; the legacy-wrapper tests moved with the wrapper to `cmd/aitools/legacy_skills_test.go` This pull request was AI-assisted by Isaac. --------- Co-authored-by: simon <simon.faltum@databricks.com> Co-authored-by: simon <4305831+simonfaltum@users.noreply.github.com>
1 parent d6ef4d2 commit d8bda62

39 files changed

Lines changed: 373 additions & 296 deletions

.agent/skills/pr-checklist/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Before submitting a PR, run these commands to match what CI checks. CI uses the
2222
# 5. If you changed files in python/:
2323
./task pydabs-codegen pydabs-test pydabs-lint pydabs-docs
2424

25-
# 6. If you changed experimental/aitools or experimental/ssh:
26-
./task test-exp-aitools # only if aitools code changed
25+
# 6. If you changed cmd/aitools/, libs/aitools/, experimental/aitools/, or experimental/ssh/:
26+
./task test-exp-aitools # only if aitools code changed (top-level or experimental)
2727
./task test-exp-ssh # only if ssh code changed
2828
```
2929

.github/OWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
# Internal
6060
/internal/ team:platform
6161

62+
# AI tools
63+
/cmd/aitools/ team:eng-apps-devex team:platform @lennartkats-db
64+
/libs/aitools/ team:eng-apps-devex team:platform @lennartkats-db
65+
6266
# CLI compatibility manifest
6367
/internal/build/cli-compat.json team:eng-apps-devex team:platform
6468
/libs/clicompat/ team:eng-apps-devex team:platform

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
### CLI
88

9+
* Added `databricks aitools` command group for installing Databricks skills into your coding agents (Claude Code, Cursor, Codex CLI, OpenCode, GitHub Copilot, Antigravity). Skills are fetched from [github.com/databricks/databricks-agent-skills](https://github.com/databricks/databricks-agent-skills) and either symlinked into each agent's skills directory or copied into the current project. Use `databricks aitools install` to set up, `update` to pull newer versions, `list` to see what's available, and `uninstall` to remove them.
10+
911
### Bundles
1012
* Make sure warnings asking for approval are understood by agents ([#5239](https://github.com/databricks/cli/pull/5239))
1113

Taskfile.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,10 @@ tasks:
609609
# generic `test` target (the catch-all) instead.
610610

611611
test-exp-aitools:
612-
desc: Run experimental aitools unit and acceptance tests
612+
desc: Run aitools (top-level + experimental) unit and acceptance tests
613613
sources:
614+
- cmd/aitools/**
615+
- libs/aitools/**
614616
- experimental/aitools/**
615617
- acceptance/apps/**
616618
- "{{.EMBED_SOURCES}}"
@@ -619,7 +621,7 @@ tasks:
619621
{{.GO_TOOL}} gotestsum \
620622
--format ${GOTESTSUM_FORMAT:-pkgname-and-test-fails} \
621623
--no-summary=skipped \
622-
--packages ./experimental/aitools/... \
624+
--packages "./cmd/aitools/... ./libs/aitools/... ./experimental/aitools/..." \
623625
-- -timeout=${LOCAL_TIMEOUT:-30m}
624626
- |
625627
{{.GO_TOOL}} gotestsum \

acceptance/help/output.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ Developer Tools
168168

169169
Additional Commands:
170170
account Databricks Account Commands
171+
aitools Databricks AI Tools for coding agents
171172
api Perform Databricks API call
172173
auth Authentication related commands
173174
cache Local cache related commands

cmd/aitools/aitools.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package aitools
2+
3+
import (
4+
"github.com/spf13/cobra"
5+
)
6+
7+
func NewAitoolsCmd() *cobra.Command {
8+
cmd := &cobra.Command{
9+
Use: "aitools",
10+
Short: "Databricks AI Tools for coding agents",
11+
Long: `Install Databricks skills into your coding agent so it can work
12+
effectively with Databricks resources (bundles, jobs, SQL, and more).
13+
14+
Supported agents: Claude Code, Cursor, Codex CLI, OpenCode, GitHub
15+
Copilot, Antigravity.`,
16+
}
17+
18+
cmd.AddCommand(NewInstallCmd())
19+
cmd.AddCommand(NewUpdateCmd())
20+
cmd.AddCommand(NewUninstallCmd())
21+
cmd.AddCommand(NewListCmd())
22+
cmd.AddCommand(NewVersionCmd())
23+
24+
return cmd
25+
}
Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,51 @@ import (
66
"fmt"
77
"strings"
88

9-
"github.com/databricks/cli/experimental/aitools/lib/agents"
10-
"github.com/databricks/cli/experimental/aitools/lib/installer"
9+
"github.com/charmbracelet/huh"
10+
"github.com/databricks/cli/libs/aitools/agents"
11+
"github.com/databricks/cli/libs/aitools/installer"
1112
"github.com/databricks/cli/libs/cmdio"
1213
"github.com/spf13/cobra"
1314
)
1415

15-
func newInstallCmd() *cobra.Command {
16+
// Package-level for testability. Tests in this package override them via
17+
// helpers in install_test.go.
18+
var (
19+
promptAgentSelection = defaultPromptAgentSelection
20+
installSkillsForAgentsFn = installer.InstallSkillsForAgents
21+
)
22+
23+
func defaultPromptAgentSelection(ctx context.Context, detected []*agents.Agent) ([]*agents.Agent, error) {
24+
options := make([]huh.Option[string], 0, len(detected))
25+
agentsByName := make(map[string]*agents.Agent, len(detected))
26+
for _, a := range detected {
27+
options = append(options, huh.NewOption(a.DisplayName, a.Name).Selected(true))
28+
agentsByName[a.Name] = a
29+
}
30+
31+
var selected []string
32+
err := huh.NewMultiSelect[string]().
33+
Title("Select coding agents to install skills for").
34+
Description("space to toggle, enter to confirm").
35+
Options(options...).
36+
Value(&selected).
37+
Run()
38+
if err != nil {
39+
return nil, err
40+
}
41+
42+
if len(selected) == 0 {
43+
return nil, errors.New("at least one agent must be selected")
44+
}
45+
46+
result := make([]*agents.Agent, 0, len(selected))
47+
for _, name := range selected {
48+
result = append(result, agentsByName[name])
49+
}
50+
return result, nil
51+
}
52+
53+
func NewInstallCmd() *cobra.Command {
1654
var skillsFlag, agentsFlag string
1755
var includeExperimental bool
1856
var projectFlag, globalFlag bool
@@ -27,6 +65,8 @@ Use --project to install to the current project directory instead.
2765
When multiple agents are detected, skills are stored in a canonical location
2866
and symlinked to each agent to avoid duplication.
2967
68+
Use --skills name1,name2 to install specific skills.
69+
3070
Supported agents: Claude Code, Cursor, Codex CLI, OpenCode, GitHub Copilot, Antigravity`,
3171
Args: cobra.NoArgs,
3272
RunE: func(cmd *cobra.Command, args []string) error {

0 commit comments

Comments
 (0)