Skip to content

aitools list: emit JSON via --output json#5233

Open
jamesbroadhead wants to merge 1 commit into
jb/aitools-interfacefrom
jb/aitools-list-json
Open

aitools list: emit JSON via --output json#5233
jamesbroadhead wants to merge 1 commit into
jb/aitools-interfacefrom
jb/aitools-list-json

Conversation

@jamesbroadhead
Copy link
Copy Markdown
Contributor

Summary

databricks aitools list learns --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 --scope and the moved-to-top-level aitools/ package). Base will rebase to main once #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 }
  }
}
  • installed is keyed by scope; absent key = not installed in that scope; empty map = not installed anywhere.
  • summary only includes scopes that were queried, so --scope=global narrows it to one key.
  • release is the version string without the v prefix.

This is the documented public contract — field names and types should not change without a major version bump.

Why

aitools list is 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 json against a workspace with a mix of installed/uninstalled skills, both scopes — JSON validates against the shape above.
  • databricks aitools list --output json --scope=globalsummary only contains global.
  • databricks aitools list (no --output) — output is byte-for-byte unchanged from main.
  • Unit: TestRenderListJSON, TestRenderListJSONScopeFiltersSummary, TestInstalledStatusFromEntry cover the rendering paths.

This pull request was AI-assisted by Isaac.

@jamesbroadhead jamesbroadhead force-pushed the jbroadhead/aitools-public branch from b3b6d1a to 9df5e93 Compare May 11, 2026 14:52
Base automatically changed from jbroadhead/aitools-public to main May 18, 2026 19:26
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
@jamesbroadhead jamesbroadhead force-pushed the jb/aitools-list-json branch from c02b45c to c4ef02c Compare May 18, 2026 21:57
@jamesbroadhead jamesbroadhead changed the base branch from main to jb/aitools-interface May 18, 2026 21:57
@jamesbroadhead jamesbroadhead marked this pull request as ready for review May 18, 2026 22:00
@jamesbroadhead
Copy link
Copy Markdown
Contributor Author

👋 @simonfaltum — Claude here on James's behalf.

Rebased onto the new tip of #5234 (which itself was rebased onto current main after #4917 landed) and flipped this out of draft. The diff is now small (3 files, +283/-71) showing only the actual --output json work.

Drift fixes applied during the rebase:

Stacking note: PR base is set to jb/aitools-interface (#5234), not main. Once #5234 merges, GitHub will auto-retarget the base.

Ready for review whenever you've got time.

(comment posted by Claude)

@github-actions
Copy link
Copy Markdown
Contributor

Approval status: pending

/cmd/aitools/ - needs approval

Files: cmd/aitools/list.go, cmd/aitools/list_test.go
Suggested: @simonfaltum
Also eligible: @lennartkats-db, @fjakobs, @Shridhad, @atilafassina, @keugenek, @arsenyinfo, @igrekun, @pkosiec, @MarioCadenas, @pffigueiredo, @ditadi, @calvarjorge, @renaudhartert-db, @hectorcast-db, @parthban-db, @tanmay-db, @Divyansh-db, @tejaskochar-db, @mihaimitrea-db, @chrisst, @rauchy

General files (require maintainer)

Files: NEXT_CHANGELOG.md
Based on git history:

  • @simonfaltum -- recent work in ./

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant