aitools list: emit JSON via --output json#5233
Conversation
b3b6d1a to
9df5e93
Compare
Teaches list to render as a structured {release, skills[...], summary{}}
document when --output json is passed. Text rendering is unchanged.
Stacked on jb/aitools-interface (#5234). Original branch was rebased
onto current main + that PR's tip; layout drift from #4917's pre-merge
shape was reconciled (cmd/aitools/* paths, unexported listSkillsFn,
3-value installer.GetSkillsRef signature).
Co-authored-by: Isaac
c02b45c to
c4ef02c
Compare
|
👋 @simonfaltum — Claude here on James's behalf. Rebased onto the new tip of #5234 (which itself was rebased onto current Drift fixes applied during the rebase:
Stacking note: PR base is set to Ready for review whenever you've got time. (comment posted by Claude) |
Approval status: pending
|
Summary
databricks aitools listlearns--output json, emitting a structured document so coding agents and CI can consume the skill/version/installation matrix without scraping the tabwriter text output. Text rendering is unchanged.Stacked on #4917 (uses
--scopeand the moved-to-top-levelaitools/package). Base will rebase tomainonce #4917 merges.JSON shape
{ "release": "0.1.0", "skills": [ { "name": "databricks-jobs", "latest_version": "1.0.0", "experimental": false, "installed": { "global": "1.0.0", "project": "0.9.0" } } ], "summary": { "global": { "installed": 5, "total": 10 }, "project": { "installed": 3, "total": 10 } } }installedis keyed by scope; absent key = not installed in that scope; empty map = not installed anywhere.summaryonly includes scopes that were queried, so--scope=globalnarrows it to one key.releaseis the version string without thevprefix.This is the documented public contract — field names and types should not change without a major version bump.
Why
aitools listis one of the surfaces an agent reaches for first ("what's installed, what's available, what's stale"). Scraping tabwriter columns from stderr is fragile; a stable JSON contract makes the command declarative for non-human callers. Matches the convention used by other CLI commands that already honor--output json(bundle validate,pipelines run, etc.).Test plan
databricks aitools list --output jsonagainst a workspace with a mix of installed/uninstalled skills, both scopes — JSON validates against the shape above.databricks aitools list --output json --scope=global—summaryonly containsglobal.databricks aitools list(no--output) — output is byte-for-byte unchanged from main.TestRenderListJSON,TestRenderListJSONScopeFiltersSummary,TestInstalledStatusFromEntrycover the rendering paths.This pull request was AI-assisted by Isaac.