Skip to content

Make aitools feature-complete: state, update, uninstall, version, list, command restructuring#4808

Closed
simonfaltum wants to merge 12 commits intomainfrom
simonfaltum/aitools-feature-complete
Closed

Make aitools feature-complete: state, update, uninstall, version, list, command restructuring#4808
simonfaltum wants to merge 12 commits intomainfrom
simonfaltum/aitools-feature-complete

Conversation

@simonfaltum
Copy link
Member

@simonfaltum simonfaltum commented Mar 22, 2026

Why

The aitools skills installer has no state tracking, update mechanism, or uninstall capability. Users cannot check what version they have, see what is available, or manage their installation lifecycle. The command structure is nested under skills which burns namespace for future component types.

Changes

Before: Skills install to ~/.databricks/agent-skills/ with no state tracking. Only skills install and skills list exist. No update, uninstall, or version commands. No filtering by experimental status or CLI version compatibility.

Now:

  • State tracking: .state.json records installed skills, versions, release ref, and timestamps. Atomic writes via temp+rename.
  • ManifestSource interface: Abstracts manifest and release fetching. GitHubManifestSource implementation with fallback to pinned ref on network failure.
  • Directory rename: Canonical location moves from .databricks/agent-skills/ to .databricks/aitools/skills/ (backward-compat check for old path).
  • Install improvements: Idempotent (safe to rerun), experimental filtering, min_cli_version enforcement, interactive agent selection via huh multi-select, concise output.
  • update command: --check (dry run), --force, --no-new flags. Authoritative release detection with offline fallback.
  • uninstall command: Removes skills, symlinks from all agent directories (full registry scan), orphaned symlink cleanup, state deletion. Selective uninstall via --skills.
  • version command: Shows installed version, skill count, staleness, last updated date. Graceful offline degradation.
  • list command: Table output with skill names, versions, installed status, experimental tags. Sorted alphabetically.
  • Command restructuring: Flat aitools install/update/uninstall/list/version with --skills, --agents, --include-experimental flags. Hidden skills install/list aliases for backward compat.
  • InstallAllSkills signature preserved: cmd/apps/init.go integration works without changes.

Test plan

  • 50+ new tests across installer, update, uninstall, and cmd packages
  • State persistence roundtrip, corrupt JSON handling, directory creation
  • Experimental filtering (skip by default, include with flag)
  • min_cli_version enforcement (warning for all, hard error for single)
  • Idempotent install (skip same version, update changed)
  • Legacy install detection with helpful message
  • Interactive agent prompt (multi-select for 2+, skip for 1)
  • Non-interactive fallback (all detected, no prompt)
  • Update: already up-to-date, version diff, force, no-new, check dry run
  • Uninstall: full and selective, orphaned symlinks, state deletion
  • Version: installed/up-to-date, update available, not installed, offline
  • List: table output with installed status
  • Backward compat: skills install and skills list aliases work
  • cmd/apps/init.go signature check
  • All lint checks pass (golangci-lint, make checks)

…tory

Add state types (InstallState) with atomic load/save persistence, path
resolution (GlobalSkillsDir, ProjectSkillsDir stub), ManifestSource
interface with GitHub implementation, latest release discovery
(FetchLatestRelease), and Clock abstraction. Extend SkillMeta with v2
fields (Experimental, Description, MinCLIVer). Refactor FetchManifest
to delegate to GitHubManifestSource. Rename canonical skills directory
from .databricks/agent-skills to .databricks/aitools/skills with
backward-compat check for the old path.

Co-authored-by: Isaac
- Rename SkillsRef->Release, LastChecked->LastUpdated (time.Time), simplify
  Skills to map[string]string, add IncludeExperimental and Scope fields.
- Remove unused Clock/RealClock from source.go.
- Add trailing newline to SaveState JSON output.
- Improve FetchLatestRelease doc comment on error/fallback contract.
- Document intentional DATABRICKS_SKILLS_REF duplication.

Co-authored-by: Isaac
…nstall

Introduces the core InstallSkillsForAgents function that handles:
- Fetching manifest via ManifestSource interface
- Filtering experimental skills and enforcing min_cli_version
- Idempotent install (skips already-installed skills at same version)
- Legacy install detection (skills on disk without state file)
- State persistence after successful install
- Concise output (two lines: installing header + summary)

Adds interactive agent selection in cmd/skills.go using huh multi-select
when multiple agents are detected in an interactive terminal.

Preserves InstallAllSkills signature (func(context.Context) error) for
the cmd/apps/init.go callback.

Co-authored-by: Isaac
… assertion

- Fix --experimental -> --include-experimental in error message
- Merge new skills into existing state instead of overwriting
- Move FetchManifest log from Info to Debug for concise output
- Handle singular/plural in Installed N skill(s) message
- Assert min_cli_version skip warning appears in test output

Co-authored-by: Isaac
Adds three new commands to the aitools skill management:
- `update`: Updates installed skills to latest release with --check (dry run),
  --force, and --no-new flags. Auto-adds new manifest skills by default.
- `uninstall`: Removes all installed skills, symlinks from all registry agents,
  cleans orphaned symlinks, and deletes state file.
- `version`: Shows installed version, skill count, staleness check against
  latest release.

Co-authored-by: Isaac
…fety, output format

- FetchLatestRelease returns (string, bool, error) so callers can distinguish
  real API responses from fallback defaults. Update and version commands use
  the authoritative flag to gate staleness checks.
- Update now filters experimental and min_cli_version skills using the same
  logic as install. Warns when a skill is removed from the manifest.
- Uninstall only removes symlinks pointing into the canonical skills dir,
  preserving user-managed directories and external symlinks.
- FormatUpdateResult accepts a check flag to use "Would update" wording.
- Version output matches the spec format (Databricks AI Tools header, skill
  count, staleness status on the same line).
- Consistent "no install" messaging across update, uninstall, and version.
- Added tests for removed-skill warning, experimental/min_cli_version
  filtering in update, check-mode output, and symlink-only uninstall.

Co-authored-by: Isaac
Add --skills, --agents, and --include-experimental flags to install command.
Add --skills flag to update, uninstall, and version commands. Create new
list command with detailed table output showing available/installed skills.
Make skills subcommand hidden for backward compat while promoting flat
command structure. Add selective uninstall support via UninstallOptions.

Co-authored-by: Isaac
…ning

- Always call SetArgs in skills install backward-compat alias (fixes
  Execute path inheriting parent args)
- Add cobra.MaximumNArgs(1) to reject extra positional args
- Remove dead installer.ListSkills function (replaced by list command)
- Restore yellow color for "No agents detected" warning in install.go
- Add Execute-path tests for skills install alias

Co-authored-by: Isaac
@simonfaltum simonfaltum changed the title Add install state, manifest source interface, and rename skills directory Make aitools feature-complete: state, update, uninstall, version, list, command restructuring Mar 22, 2026
@simonfaltum
Copy link
Member Author

Splitting into stacked PRs for easier review. See the PR stack linked from the individual PRs.

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