Skip to content

Commit 197a3ae

Browse files
authored
UX: implement new design of azd tool (install/upgrade/list/check) (#9045)
* use agent instead of host, improve multi selector ux * add tip for grey and multi selector no filter for less than 6 options * add spinner * fix spinner bar and host detection * fix host bug * update ux message * azd tool upgrade * azd tool list, check, upgrade --all * update azd tool upgrade ux * add more test coverage * clean up UX for install * go fix * use display name * make availability check case-insensitive * default to --all if no prompt or no tty * only use version comparison for non-skill tools to prevent UX bug * add mutex * make sure command is not empty * make UpdateAvailable to be true for any agent skill updated * add version on upgrade to non skill tools * update comment * fix the wrapping on narrower terminal widths * fix ux bug * fix ux bug * update ux to include number of skills installed * address the feedback * remove all behavior for uninstall/upgrade/install if not specific in no tty * revert ux for number of skills, need more discussion with designer * fix bug * address feedback * use short name for agent * address feedback * add changelog * rename to agent * address feedback * address Kristen's feedback * use upgrade instead of update, address Hiyo feedback * update check for multi selector, have stout under spinner grey section * address all feedback * address another round of feedback * address feedback, update comment
1 parent 9efebd9 commit 197a3ae

25 files changed

Lines changed: 4325 additions & 1205 deletions

cli/azd/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Breaking Changes
1010

11+
- [[#9045]](https://github.com/Azure/azure-dev/pull/9045) The `--host` skill flag on `azd tool install`, `azd tool upgrade`, and `azd tool uninstall` has been renamed to `--agent`. Installed skills in `azd tool list --output json` and `azd tool check --output json` now expand into one row per agent and include the `agent` field. Update scripts and JSON consumers accordingly.
12+
1113
### Bugs Fixed
1214

1315
### Other Changes

cli/azd/cmd/extension.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ func (a *extensionListAction) Run(ctx context.Context) (*actions.ActionResult, e
507507
// Status indicator constants for extension list display.
508508
const (
509509
statusUpToDate = "Up to date"
510-
statusUpdate = "Update available"
510+
statusUpgrade = "Upgrade available"
511511
statusIncompat = "Incompatible"
512512
statusNotInstall = "Not installed"
513513
)
@@ -518,7 +518,7 @@ func extensionStatus(installed, updateAvailable, incompatible bool) string {
518518
case incompatible:
519519
return statusIncompat
520520
case updateAvailable:
521-
return statusUpdate
521+
return statusUpgrade
522522
case installed:
523523
return statusUpToDate
524524
default:
@@ -531,7 +531,7 @@ func extensionStatusColor(s string) string {
531531
switch s {
532532
case statusUpToDate:
533533
return output.WithSuccessFormat(s)
534-
case statusUpdate:
534+
case statusUpgrade:
535535
return output.WithWarningFormat(s)
536536
case statusIncompat:
537537
return output.WithErrorFormat(s)

cli/azd/cmd/extension_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ func TestExtensionStatus(t *testing.T) {
659659
}{
660660
{"not installed", false, false, false, statusNotInstall},
661661
{"up to date", true, false, false, statusUpToDate},
662-
{"update available", true, true, false, statusUpdate},
662+
{"update available", true, true, false, statusUpgrade},
663663
{"incompatible", true, false, true, statusIncompat},
664664
}
665665
for _, tt := range tests {
@@ -679,7 +679,7 @@ func TestExtensionStatusColor(t *testing.T) {
679679

680680
// Verify no panics and non-empty colored output for each status value.
681681
for _, s := range []string{
682-
statusUpToDate, statusUpdate, statusIncompat, statusNotInstall,
682+
statusUpToDate, statusUpgrade, statusIncompat, statusNotInstall,
683683
} {
684684
result := extensionStatusColor(s)
685685
assert.NotEmpty(t, result, "color function should return non-empty for %q", s)

cli/azd/cmd/testdata/TestFigSpec.ts

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6466,12 +6466,22 @@ const completionSpec: Fig.Spec = {
64666466
subcommands: [
64676467
{
64686468
name: ['check'],
6469-
description: 'Check for tool updates.',
6469+
description: 'Check for tool upgrades.',
64706470
},
64716471
{
64726472
name: ['install'],
64736473
description: 'Install specified tools.',
64746474
options: [
6475+
{
6476+
name: ['--agent'],
6477+
description: 'Install the skill for the specified agent(s): copilot, claude. Use --agent all for every detected agent (skill tools only)',
6478+
isRepeatable: true,
6479+
args: [
6480+
{
6481+
name: 'agent',
6482+
},
6483+
],
6484+
},
64756485
{
64766486
name: ['--all'],
64776487
description: 'Install all recommended tools',
@@ -6480,16 +6490,6 @@ const completionSpec: Fig.Spec = {
64806490
name: ['--dry-run'],
64816491
description: 'Preview what would be installed without making changes',
64826492
},
6483-
{
6484-
name: ['--host'],
6485-
description: 'Install the skill for the specified agent host(s): copilot, claude. Use --host all for every detected host (skill tools only)',
6486-
isRepeatable: true,
6487-
args: [
6488-
{
6489-
name: 'host',
6490-
},
6491-
],
6492-
},
64936493
],
64946494
args: {
64956495
name: 'tool-name...',
@@ -6511,6 +6511,16 @@ const completionSpec: Fig.Spec = {
65116511
name: ['uninstall'],
65126512
description: 'Uninstall installed tools.',
65136513
options: [
6514+
{
6515+
name: ['--agent'],
6516+
description: 'Uninstall the skill from the specified agent(s): copilot, claude. Use --agent all (or omit --agent) to remove the skill from every agent it is installed through (skill tools only)',
6517+
isRepeatable: true,
6518+
args: [
6519+
{
6520+
name: 'agent',
6521+
},
6522+
],
6523+
},
65146524
{
65156525
name: ['--all'],
65166526
description: 'Uninstall all installed tools',
@@ -6519,16 +6529,6 @@ const completionSpec: Fig.Spec = {
65196529
name: ['--dry-run'],
65206530
description: 'Preview what would be uninstalled without making changes',
65216531
},
6522-
{
6523-
name: ['--host'],
6524-
description: 'Uninstall the skill from the specified agent host(s): copilot, claude. Use --host all (or omit --host) to remove the skill from every host it is installed through (skill tools only)',
6525-
isRepeatable: true,
6526-
args: [
6527-
{
6528-
name: 'host',
6529-
},
6530-
],
6531-
},
65326532
],
65336533
args: {
65346534
name: 'tool-name...',
@@ -6540,19 +6540,23 @@ const completionSpec: Fig.Spec = {
65406540
description: 'Upgrade installed tools.',
65416541
options: [
65426542
{
6543-
name: ['--dry-run'],
6544-
description: 'Preview what would be upgraded without making changes',
6545-
},
6546-
{
6547-
name: ['--host'],
6548-
description: 'Upgrade the skill for the specified agent host(s): copilot, claude. Use --host all for every detected host (skill tools only)',
6543+
name: ['--agent'],
6544+
description: 'Upgrade the skill for the specified agent(s): copilot, claude. Use --agent all for every detected agent (skill tools only)',
65496545
isRepeatable: true,
65506546
args: [
65516547
{
6552-
name: 'host',
6548+
name: 'agent',
65536549
},
65546550
],
65556551
},
6552+
{
6553+
name: ['--all'],
6554+
description: 'Upgrade all installed tools',
6555+
},
6556+
{
6557+
name: ['--dry-run'],
6558+
description: 'Preview what would be upgraded without making changes',
6559+
},
65566560
],
65576561
args: {
65586562
name: 'tool-name...',

cli/azd/cmd/testdata/TestUsage-azd-tool-check.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Check for tool updates.
2+
Check for tool upgrades.
33

44
Usage
55
azd tool check [flags]

cli/azd/cmd/testdata/TestUsage-azd-tool-install.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Usage
55
azd tool install [tool-name...] [flags]
66

77
Flags
8-
--all : Install all recommended tools
9-
--dry-run : Preview what would be installed without making changes
10-
--host strings : Install the skill for the specified agent host(s): copilot, claude. Use --host all for every detected host (skill tools only)
8+
--agent strings : Install the skill for the specified agent(s): copilot, claude. Use --agent all for every detected agent (skill tools only)
9+
--all : Install all recommended tools
10+
--dry-run : Preview what would be installed without making changes
1111

1212
Global Flags
1313
-C, --cwd string : Sets the current working directory.

cli/azd/cmd/testdata/TestUsage-azd-tool-uninstall.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Usage
55
azd tool uninstall [tool-name...] [flags]
66

77
Flags
8-
--all : Uninstall all installed tools
9-
--dry-run : Preview what would be uninstalled without making changes
10-
--host strings : Uninstall the skill from the specified agent host(s): copilot, claude. Use --host all (or omit --host) to remove the skill from every host it is installed through (skill tools only)
8+
--agent strings : Uninstall the skill from the specified agent(s): copilot, claude. Use --agent all (or omit --agent) to remove the skill from every agent it is installed through (skill tools only)
9+
--all : Uninstall all installed tools
10+
--dry-run : Preview what would be uninstalled without making changes
1111

1212
Global Flags
1313
-C, --cwd string : Sets the current working directory.

cli/azd/cmd/testdata/TestUsage-azd-tool-upgrade.snap

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Usage
55
azd tool upgrade [tool-name...] [flags]
66

77
Flags
8-
--dry-run : Preview what would be upgraded without making changes
9-
--host strings : Upgrade the skill for the specified agent host(s): copilot, claude. Use --host all for every detected host (skill tools only)
8+
--agent strings : Upgrade the skill for the specified agent(s): copilot, claude. Use --agent all for every detected agent (skill tools only)
9+
--all : Upgrade all installed tools
10+
--dry-run : Preview what would be upgraded without making changes
1011

1112
Global Flags
1213
-C, --cwd string : Sets the current working directory.

cli/azd/cmd/testdata/TestUsage-azd-tool.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Usage
55
azd tool [command]
66

77
Available Commands
8-
check : Check for tool updates.
8+
check : Check for tool upgrades.
99
install : Install specified tools.
1010
list : List all tools with status.
1111
show : Show details for a specific tool.

0 commit comments

Comments
 (0)