Skip to content

Add Aspire Activity Bar panel with running apphosts and resources tree view#14848

Merged
adamint merged 8 commits intodotnet:release/13.2from
adamint:dev/adamint/aspire-panel
Mar 2, 2026
Merged

Add Aspire Activity Bar panel with running apphosts and resources tree view#14848
adamint merged 8 commits intodotnet:release/13.2from
adamint:dev/adamint/aspire-panel

Conversation

@adamint
Copy link
Member

@adamint adamint commented Mar 2, 2026

Description

Adds an Aspire Activity Bar panel to the VS Code extension that shows running AppHosts and their resources in a native TreeView. Also adds a --resources option to aspire ps (basically just the stuff from aspire describe) that the extension can consume.

The tree view refreshes every 5 seconds. If using an old CLI version, only the dashboard URL, apphost ID, and CLI ID are visible. If using a CLI version without aspire ps, an error message is shown in the panel. The resources entry is collapsed by default.

You can execute resource commands, open endpoints, and restart/stop/start resources via context menu.

image

Changes

VS Code Extension:

  • New Activity Bar container with Aspire icon and "Running Apphosts" tree view
  • AspireAppHostTreeProvider that polls aspire ps --format json --resources to display:
    • Running AppHosts (with PID, dashboard link, CLI PID)
    • Per-AppHost resources in a collapsible "Resources" group (with state icons, type, endpoints)
  • Visibility-based polling — only fetches when the panel is visible
  • Backward-compatible: falls back gracefully if CLI doesn't support --resources flag
  • Refresh command and Open Dashboard inline action
  • Welcome view when no AppHosts are running
  • Localized strings in package.nls.json and strings.ts

Aspire CLI (aspire ps):

  • New --resources flag that includes per-AppHost resource details in JSON output
  • Resources are fetched via backchannel GetResourceSnapshotsAsync and mapped through ResourceSnapshotMapper
  • --resources only takes effect with --format json (ignored for table output)
  • Resource data includes name, displayName, type, state, stateStyle, healthStatus, URLs, and more

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI review requested due to automatic review settings March 2, 2026 19:32
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14848

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14848"

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Aspire” Activity Bar panel in the VS Code extension to surface running AppHosts/resources via aspire ps, and extends the CLI ps command with a --resources JSON-only flag to provide per-AppHost resource details that the extension can render.

Changes:

  • VS Code extension: contribute an Activity Bar container + “Running Apphosts” TreeView that polls aspire ps --format json --resources with a fallback for older CLIs.
  • Aspire CLI: add ps --resources to include mapped ResourceSnapshot details in JSON output (ignored for table output).
  • Tests + localization: add CLI tests and new localized string resources for the new CLI option and extension UI.

Reviewed changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Aspire.Cli.Tests/Commands/PsCommandTests.cs Adds unit tests validating ps --resources JSON behavior and ensuring table output doesn’t fetch resources.
src/Aspire.Cli/Commands/PsCommand.cs Implements --resources option and conditionally fetches/maps resource snapshots into JSON output.
src/Aspire.Cli/Resources/PsCommandStrings.resx Adds ResourcesOptionDescription string for the new CLI option.
src/Aspire.Cli/Resources/PsCommandStrings.Designer.cs Updates generated resource accessor for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.cs.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.de.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.es.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.fr.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.it.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.ja.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.ko.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.pl.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.pt-BR.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.ru.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.tr.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.zh-Hans.xlf Adds new trans-unit for ResourcesOptionDescription.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.zh-Hant.xlf Adds new trans-unit for ResourcesOptionDescription.
extension/src/views/AspireAppHostTreeProvider.ts New TreeDataProvider to run aspire ps and render AppHosts/resources/endpoints in a tree with polling + fallback.
extension/src/loc/strings.ts Adds localized UI strings for the new panel/tree labels and messages.
extension/src/extension.ts Wires up the TreeView, polling based on visibility, refresh/open-dashboard commands, and welcome-context.
extension/resources/aspire-activity-bar.svg Adds Aspire Activity Bar icon.
extension/package.nls.json Adds localized contribution strings for the new view container/view/welcome and new commands.
extension/package.json Contributes the Activity Bar container, tree view, welcome view, and new commands/menus.
extension/loc/xlf/aspire-vscode.xlf Adds localization entries for the new view and command strings.
Files not reviewed (1)
  • src/Aspire.Cli/Resources/PsCommandStrings.Designer.cs: Language not supported

Copy link
Member

@maddymontaquila maddymontaquila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

god i love this

adamint added 7 commits March 2, 2026 16:35
- Add Aspire sidebar panel in VS Code with running AppHosts tree view
- Extend 'aspire ps --format json --resources' to include per-AppHost resource data
- Show resources (with state, type, endpoints) as collapsible tree items
- Backward-compatible: falls back gracefully if CLI doesn't support --resources
- Visibility-based polling (only fetches when panel is visible)
- Add SVG icon, localized strings, and unit tests
…g, and spawn error handling

- Show welcome view with upgrade prompt when CLI is missing or too old
- Add 'Update Aspire CLI' command (aspire update --self)
- Start polling immediately if tree view is already visible on creation
- Handle spawn errors (ENOENT) to prevent polling from getting stuck
- Change dashboard icon to link-external for clickable items
- Remove unused InfoMessageItem in favor of viewsWelcome-based error display
- Stop AppHost: right-click context menu runs 'aspire stop --project <path>'
- Stop Resource: right-click context menu runs 'aspire stop <name> --project <path>'
- View Logs: right-click context menu runs 'aspire logs <name> --project <path> --follow'
- All commands hidden from command palette (tree-only actions)
- Localized all new command titles
- Add Start, Restart, Stop resource and Stop apphost context menu actions
- Add View logs context menu for streaming resource logs
- Add Execute command... context menu with quick pick for resource commands
- Fix RPC race condition: register interaction service endpoints before
  connection.listen() to prevent unhandled 'displayEmptyLine' errors
- Fix RPC client factory to use lazy debugSessionId reference
- Use --apphost flag (primary) instead of --project (legacy alias)
- Normalize casing: 'apphost' (lowercase h) in user-facing strings
- Register custom 'aspire.brandPurple' color (#512BD4 light, #7455DD dark)
- Color apphost and resources group icons with Aspire purple
- Color resource state icons: green for success, yellow for warning,
  red for error, purple for other active states
…ands

- Merge duplicate detail item classes into single DetailItem
- Extract _runResourceCommand helper for stop/start/restart/logs
- Store appHostPid directly on ResourceItem instead of parsing ID string
- Remove no-op resourceEndpointLabel wrapper
- Fix resource state icons to use exact PascalCase state values from KnownResourceStates
- Respect stateStyle overrides for health check warnings/errors on Running resources
- Show Start/Stop/Restart context menus only when resource has those commands available
- Reduce polling interval from 5s to 3s
@adamint adamint force-pushed the dev/adamint/aspire-panel branch from dd2f08f to 8011960 Compare March 2, 2026 21:35
@adamint adamint enabled auto-merge (squash) March 2, 2026 22:22
@adamint adamint merged commit e807cd5 into dotnet:release/13.2 Mar 2, 2026
346 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Mar 2, 2026
mitchdenny pushed a commit that referenced this pull request Mar 5, 2026
…e view (#14848)

* Add Aspire Activity Bar panel with running apphosts tree view

- Add Aspire sidebar panel in VS Code with running AppHosts tree view
- Extend 'aspire ps --format json --resources' to include per-AppHost resource data
- Show resources (with state, type, endpoints) as collapsible tree items
- Backward-compatible: falls back gracefully if CLI doesn't support --resources
- Visibility-based polling (only fetches when panel is visible)
- Add SVG icon, localized strings, and unit tests

* Add error welcome view, updateSelf command, initial visibility polling, and spawn error handling

- Show welcome view with upgrade prompt when CLI is missing or too old
- Add 'Update Aspire CLI' command (aspire update --self)
- Start polling immediately if tree view is already visible on creation
- Handle spawn errors (ENOENT) to prevent polling from getting stuck
- Change dashboard icon to link-external for clickable items
- Remove unused InfoMessageItem in favor of viewsWelcome-based error display

* Add Stop and View Logs context menu actions for AppHosts and Resources

- Stop AppHost: right-click context menu runs 'aspire stop --project <path>'
- Stop Resource: right-click context menu runs 'aspire stop <name> --project <path>'
- View Logs: right-click context menu runs 'aspire logs <name> --project <path> --follow'
- All commands hidden from command palette (tree-only actions)
- Localized all new command titles

* Add resource management commands and fix RPC race condition

- Add Start, Restart, Stop resource and Stop apphost context menu actions
- Add View logs context menu for streaming resource logs
- Add Execute command... context menu with quick pick for resource commands
- Fix RPC race condition: register interaction service endpoints before
  connection.listen() to prevent unhandled 'displayEmptyLine' errors
- Fix RPC client factory to use lazy debugSessionId reference
- Use --apphost flag (primary) instead of --project (legacy alias)
- Normalize casing: 'apphost' (lowercase h) in user-facing strings

* Remove unused string constants from strings.ts

* Add Aspire brand purple and semantic colors to tree view icons

- Register custom 'aspire.brandPurple' color (#512BD4 light, #7455DD dark)
- Color apphost and resources group icons with Aspire purple
- Color resource state icons: green for success, yellow for warning,
  red for error, purple for other active states

* Simplify tree provider, fix resource state icons and conditional commands

- Merge duplicate detail item classes into single DetailItem
- Extract _runResourceCommand helper for stop/start/restart/logs
- Store appHostPid directly on ResourceItem instead of parsing ID string
- Remove no-op resourceEndpointLabel wrapper
- Fix resource state icons to use exact PascalCase state values from KnownResourceStates
- Respect stateStyle overrides for health check warnings/errors on Running resources
- Show Start/Stop/Restart context menus only when resource has those commands available
- Reduce polling interval from 5s to 3s
Copilot AI pushed a commit that referenced this pull request Mar 10, 2026
…e view (#14848)

* Add Aspire Activity Bar panel with running apphosts tree view

- Add Aspire sidebar panel in VS Code with running AppHosts tree view
- Extend 'aspire ps --format json --resources' to include per-AppHost resource data
- Show resources (with state, type, endpoints) as collapsible tree items
- Backward-compatible: falls back gracefully if CLI doesn't support --resources
- Visibility-based polling (only fetches when panel is visible)
- Add SVG icon, localized strings, and unit tests

* Add error welcome view, updateSelf command, initial visibility polling, and spawn error handling

- Show welcome view with upgrade prompt when CLI is missing or too old
- Add 'Update Aspire CLI' command (aspire update --self)
- Start polling immediately if tree view is already visible on creation
- Handle spawn errors (ENOENT) to prevent polling from getting stuck
- Change dashboard icon to link-external for clickable items
- Remove unused InfoMessageItem in favor of viewsWelcome-based error display

* Add Stop and View Logs context menu actions for AppHosts and Resources

- Stop AppHost: right-click context menu runs 'aspire stop --project <path>'
- Stop Resource: right-click context menu runs 'aspire stop <name> --project <path>'
- View Logs: right-click context menu runs 'aspire logs <name> --project <path> --follow'
- All commands hidden from command palette (tree-only actions)
- Localized all new command titles

* Add resource management commands and fix RPC race condition

- Add Start, Restart, Stop resource and Stop apphost context menu actions
- Add View logs context menu for streaming resource logs
- Add Execute command... context menu with quick pick for resource commands
- Fix RPC race condition: register interaction service endpoints before
  connection.listen() to prevent unhandled 'displayEmptyLine' errors
- Fix RPC client factory to use lazy debugSessionId reference
- Use --apphost flag (primary) instead of --project (legacy alias)
- Normalize casing: 'apphost' (lowercase h) in user-facing strings

* Remove unused string constants from strings.ts

* Add Aspire brand purple and semantic colors to tree view icons

- Register custom 'aspire.brandPurple' color (#512BD4 light, #7455DD dark)
- Color apphost and resources group icons with Aspire purple
- Color resource state icons: green for success, yellow for warning,
  red for error, purple for other active states

* Simplify tree provider, fix resource state icons and conditional commands

- Merge duplicate detail item classes into single DetailItem
- Extract _runResourceCommand helper for stop/start/restart/logs
- Store appHostPid directly on ResourceItem instead of parsing ID string
- Remove no-op resourceEndpointLabel wrapper
- Fix resource state icons to use exact PascalCase state values from KnownResourceStates
- Respect stateStyle overrides for health check warnings/errors on Running resources
- Show Start/Stop/Restart context menus only when resource has those commands available
- Reduce polling interval from 5s to 3s
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.

3 participants