Skip to content

Commit a71a37d

Browse files
committed
aitools list: preserve scoped text labels
1 parent e77282b commit a71a37d

3 files changed

Lines changed: 31 additions & 14 deletions

File tree

NEXT_CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
* Breaking change: OAuth tokens for interactive logins (`auth_type = databricks-cli`) are now stored in the OS-native secure store by default (Keychain on macOS, Credential Manager on Windows, Secret Service on Linux) instead of `~/.databricks/token-cache.json`. After upgrading, run `databricks auth login` once per profile to re-authenticate; cached tokens from older versions are not migrated. To keep the previous file-backed storage, set `DATABRICKS_AUTH_STORAGE=plaintext` or add `auth_storage = plaintext` under `[__settings__]` in `~/.databrickscfg` (the env var takes precedence over the config setting), then re-run `databricks auth login`. On systems where the OS keyring is not reachable (e.g. Linux containers without a D-Bus session bus), the CLI transparently falls back to the file cache when reading tokens so legacy `token-cache.json` entries remain accessible without manual configuration.
88

99
### CLI
10-
* 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+
* 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. Pick where they go with `--scope=project|global` (`--scope=both` is accepted on `update` and `list`).
1111
* `databricks aitools list` honors `--output json`, emitting a structured `{release, skills[...], summary{}}` document so coding agents and CI can consume the skill/version/installation matrix without scraping the tabular text output.
12+
* `[__settings__].default_profile` is now consulted as a fallback by `databricks api`, `databricks auth token`, and bundle commands when neither `--profile` nor `DATABRICKS_CONFIG_PROFILE` is set. `databricks auth token` continues to give precedence to `DATABRICKS_HOST` over `default_profile`. For bundle commands, `default_profile` only applies when the bundle does not pin its own `workspace.host`.
1213

1314
### Bundles
1415
* Make sure warnings asking for approval are understood by agents ([#5239](https://github.com/databricks/cli/pull/5239))

cmd/aitools/list.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ func renderListText(ctx context.Context, out listOutput, scope string) {
197197
cmdio.LogString(ctx, "Available skills (v"+out.Release+"):")
198198
cmdio.LogString(ctx, "")
199199

200-
bothScopes := scope == "" && len(out.Summary) == 2 &&
201-
out.Summary[installer.ScopeGlobal].Installed+out.Summary[installer.ScopeProject].Installed > 0 &&
202-
anyInstalled(out, installer.ScopeGlobal) && anyInstalled(out, installer.ScopeProject)
200+
bothScopes := scope == "" &&
201+
out.Summary[installer.ScopeGlobal].loaded &&
202+
out.Summary[installer.ScopeProject].loaded
203203

204204
var buf strings.Builder
205205
tw := tabwriter.NewWriter(&buf, 0, 4, 2, ' ', 0)
@@ -217,16 +217,6 @@ func renderListText(ctx context.Context, out listOutput, scope string) {
217217
cmdio.LogString(ctx, summaryLine(out, scope))
218218
}
219219

220-
// anyInstalled reports whether at least one skill is installed in the named scope.
221-
func anyInstalled(out listOutput, scope string) bool {
222-
for _, s := range out.Skills {
223-
if _, ok := s.Installed[scope]; ok {
224-
return true
225-
}
226-
}
227-
return false
228-
}
229-
230220
func installedStatusFromEntry(s skillEntry, bothScopes bool) string {
231221
globalVer := s.Installed[installer.ScopeGlobal]
232222
projectVer := s.Installed[installer.ScopeProject]

cmd/aitools/list_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,32 @@ func TestSummaryLinePreservesStatePresence(t *testing.T) {
224224
}
225225
}
226226

227+
func TestRenderListTextUsesLoadedStateForScopeLabels(t *testing.T) {
228+
ctx, stderr := cmdio.NewTestContextWithStderr(t.Context())
229+
out := listOutput{
230+
Release: "0.1.0",
231+
Skills: []skillEntry{
232+
{
233+
Name: "databricks-jobs",
234+
LatestVersion: "1.0.0",
235+
Installed: map[string]string{
236+
installer.ScopeGlobal: "1.0.0",
237+
},
238+
},
239+
},
240+
Summary: map[string]scopeSummary{
241+
installer.ScopeGlobal: {Installed: 1, Total: 1, loaded: true},
242+
installer.ScopeProject: {Installed: 0, Total: 1, loaded: true},
243+
},
244+
}
245+
246+
renderListText(ctx, out, "")
247+
248+
got := stderr.String()
249+
assert.Contains(t, got, "v1.0.0 (up to date) (global)")
250+
assert.Contains(t, got, "1/1 skills installed (global), 0/1 (project)")
251+
}
252+
227253
func TestListScopeFlag(t *testing.T) {
228254
tests := []struct {
229255
name string

0 commit comments

Comments
 (0)