diff --git a/.nextchanges/air/air-run-help-skill.md b/.nextchanges/air/air-run-help-skill.md new file mode 100644 index 00000000000..3607a932c90 --- /dev/null +++ b/.nextchanges/air/air-run-help-skill.md @@ -0,0 +1 @@ +* `databricks air run --help` now shows how to install the databricks-ai-runtime coding agent skill. ([#7628](https://github.com/databricks/cli/pull/7628)) diff --git a/acceptance/air/config-help/output.txt b/acceptance/air/config-help/output.txt index 1fae9e919f3..624f0c4cd24 100644 --- a/acceptance/air/config-help/output.txt +++ b/acceptance/air/config-help/output.txt @@ -11,6 +11,11 @@ field, pass its path to -h as a separate argument: databricks air run -h config.compute one section databricks air run -h config.compute.accelerator_type one field +To have a coding agent write the YAML and follow the run, install the +databricks-ai-runtime skill: + + databricks aitools install --skills-only --skills databricks-ai-runtime + Usage: databricks air run [flags] diff --git a/cmd/air/air_test.go b/cmd/air/air_test.go index 11e4546d21d..baf36932e20 100644 --- a/cmd/air/air_test.go +++ b/cmd/air/air_test.go @@ -117,3 +117,12 @@ func TestRunErrorOmitsDebugTipWhenDebugEnabled(t *testing.T) { assert.Same(t, originalErr, err) assert.NotContains(t, err.Error(), "use the --debug flag") } + +func TestRunHelpPointsToAgentSkill(t *testing.T) { + run := findSubcommand(t, New(), "run") + var out bytes.Buffer + run.SetOut(&out) + run.HelpFunc()(run, nil) + assert.Contains(t, out.String(), "databricks-ai-runtime skill") + assert.Contains(t, out.String(), " "+skillInstallCommand+"\n") +} diff --git a/cmd/air/run.go b/cmd/air/run.go index 20a7683461f..98eb8d4e022 100644 --- a/cmd/air/run.go +++ b/cmd/air/run.go @@ -97,7 +97,12 @@ field, pass its path to -h as a separate argument: databricks air run -h config all fields databricks air run -h config.compute one section - databricks air run -h config.compute.accelerator_type one field`, + databricks air run -h config.compute.accelerator_type one field + +To have a coding agent write the YAML and follow the run, install the +databricks-ai-runtime skill: + + ` + skillInstallCommand, Example: ` # Submit and stream logs until the run finishes databricks air run -f workload.yaml --watch diff --git a/cmd/air/runconfig.go b/cmd/air/runconfig.go index 78554b02183..cdb60d486e8 100644 --- a/cmd/air/runconfig.go +++ b/cmd/air/runconfig.go @@ -922,11 +922,15 @@ func renderConfigField(w io.Writer, f configField, computeOptions []computeOptio } } +// skillInstallCommand installs the databricks-ai-runtime agent skill. Help +// pages that point coding agents at the skill share it. +const skillInstallCommand = "databricks aitools install --skills-only --skills databricks-ai-runtime" + // agentSkillHelp closes `-h config`: users look up the schema while writing // YAML, which is when an agent skill that writes it for them is most useful. const agentSkillHelp = ` Let a coding agent write this YAML for you with the databricks-ai-runtime skill: - databricks aitools install --skills-only --skills databricks-ai-runtime + ` + skillInstallCommand + ` (add --scope project to install into the current project) https://github.com/databricks/databricks-agent-skills/tree/main/skills/databricks-ai-runtime `