Skip to content

feat: add azd tool command group for unified Azure tooling management#7450

Draft
wbreza wants to merge 5 commits intoAzure:mainfrom
wbreza:feature/azd-tool
Draft

feat: add azd tool command group for unified Azure tooling management#7450
wbreza wants to merge 5 commits intoAzure:mainfrom
wbreza:feature/azd-tool

Conversation

@wbreza
Copy link
Copy Markdown
Contributor

@wbreza wbreza commented Apr 2, 2026

Summary

Adds the azd tool command group — a unified CLI for discovering, installing, upgrading, and checking status of Azure development tools. This is a POC implementation based on the azd tool PRD, with platform-specific install strategies referenced from azure-devkit.

Changes

Core Package (pkg/tool/)

  • manifest.go — Tool type system (ToolDefinition, InstallStrategy, etc.) and built-in registry of 7 tools (az-cli, github-copilot-cli, vscode-azure-tools, vscode-bicep, vscode-github-copilot, azure-mcp-server, azd-ai-extensions)
  • platform.go — OS detection and package manager availability (winget/brew/apt/snap/npm/code)
  • detector.go — Tool detection interface with CLI version parsing and VS Code extension listing
  • installer.go — Platform-aware install/upgrade orchestration with fallback URLs
  • manager.go — Top-level orchestrator wiring detector, installer, and update checker
  • update_checker.go — Periodic update checking with disk cache (~/.azd/tool-check-cache.json)

Commands (cmd/tool.go)

  • azd tool — Interactive flow: detect → display status → select uninstalled → install
  • azd tool list — Table/JSON output of all tools with status and version
  • azd tool install [tool-name...] — Install by name, --all flag, or interactive selection
  • azd tool upgrade [tool-name...] — Upgrade specific tools or all installed
  • azd tool check — Check for available updates (table/JSON)
  • azd tool show <tool-name> — Detailed info for a specific tool

Middleware

  • cmd/middleware/tool_first_run.go — Welcome experience on first azd use with tool detection and optional install
  • cmd/middleware/tool_update_check.go — Non-blocking background update checks with cached notifications

Integration

  • IoC registration in cmd/container.go
  • Command + middleware registration in cmd/root.go
  • Updated snapshot test files for new commands

Issue References

No related issue — this is a POC/spike for the azd tool feature.

Testing

  • 45 unit tests across 5 test files in pkg/tool/ with 83.9% statement coverage
  • Table-driven tests with mocked CommandRunner and Detector interfaces
  • go build ./... — passes
  • go vet ./... — passes
  • golangci-lint run ./... — passes
  • Snapshot tests updated (TestFigSpec, TestUsage)

Notes

  • Install strategies use azure-devkit as reference for per-platform commands
  • The update checker doesn't make remote API calls yet (POC) — it caches detected versions and carries forward cached latest versions
  • VS Code extensions are gracefully skipped if code is not in PATH

wbreza and others added 4 commits April 3, 2026 13:11
Implements the azd tool POC — a unified CLI for discovering, installing,
upgrading, and checking status of Azure development tools.

New command group:
- azd tool        — Interactive tool discovery and install flow
- azd tool list   — List all tools with status (table/JSON)
- azd tool install — Install tools by name or interactively
- azd tool upgrade — Upgrade installed tools
- azd tool check  — Check for available updates (table/JSON)
- azd tool show   — Show detailed info for a specific tool

Core package (pkg/tool/):
- manifest.go     — Tool definitions and built-in registry (7 tools)
- platform.go     — OS detection and package manager availability
- detector.go     — Tool detection (CLI version parsing, VS Code extensions)
- installer.go    — Platform-aware install/upgrade orchestration
- manager.go      — Top-level orchestrator
- update_checker.go — Periodic update checking with disk cache

Middleware:
- tool_first_run.go    — Welcome experience on first azd use
- tool_update_check.go — Background update notifications

Integration:
- IoC registration in container.go
- Command registration in root.go
- Snapshot test updates for new commands

Unit tests: 45 tests, 83.9% coverage on pkg/tool/

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use American English spellings (summarizes, serialized, amortized, unparsable)
- Add azureresourcegroups to cspell overrides (VS Code extension ID)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace legacy console.MultiSelect/Confirm/Spinner (survey.v2) with
the newer pkg/ux/ components that use canvas-based rendering. This
fixes escape code artifacts on arrow key presses in terminal.

Changes:
- cmd/tool.go: 2x console.MultiSelect -> uxlib.NewMultiSelect
- cmd/middleware/tool_first_run.go: console.Confirm -> uxlib.NewConfirm,
  console.MultiSelect -> uxlib.NewMultiSelect,
  console.ShowSpinner/StopSpinner -> uxlib.NewSpinner.Run

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wbreza wbreza force-pushed the feature/azd-tool branch from f1ceb33 to eba6ccf Compare April 3, 2026 20:25
- Add 30s timeout to background update check goroutine to prevent leaks
- Fix middleware predicate to properly exclude tool subcommands
- Defer GetUserConfigDir() call from IoC registration to first use
- Reorder middleware skip checks (cheap before expensive I/O)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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