# aspnet/librarymanager architecture

> Architecture diagram of the GitHub repository aspnet/librarymanager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aspnet/librarymanager
- Repository: https://github.com/aspnet/librarymanager

## Overview

LibMan installs selected client-side library files into project paths from online catalogs or local/network sources. The main workflow is to edit a libman.json manifest, resolve each requested library through a provider, compute and restore its file goal state, then write files and report results. Users enter through either the CLI or Visual Studio integration. The repository also includes manifest authoring assistance, caching, and provider-specific catalog/search implementations. Several provider and UI internals are not sampled, so their detailed call relationships are omitted or marked unverified.

Main entry points: [`src/LibraryManager/Manifest.cs`](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/Manifest.cs) (Manifest restore), [`src/LibraryManager.Contracts/IProvider.cs`](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Contracts/IProvider.cs) (Provider contract), [`src/LibraryManager.Vsix/Shared/LibraryCommandService.cs`](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Vsix/Shared/LibraryCommandService.cs) (Command service), [`src/LibraryManager.Vsix/LibraryManagerPackage.cs`](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Vsix/LibraryManagerPackage.cs) (VS package)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_cli["CLI app<br/>[Program.cs]"]
  node_cli_commands["CLI commands"]
end

subgraph group_engine["Install engine"]
  node_manifest["Manifest restore<br/>[Manifest.cs]"]
  node_installation_state["Install state"]
  node_validation["Library validation"]
  node_goal_state["File goal state"]
  node_host_io["Host file access"]
  node_cache[("Resource cache<br/>[CacheService.cs]")]
  node_web_request["Web requests"]
end

subgraph group_sources["Library sources"]
  node_provider_contract["Provider contract<br/>[IProvider.cs]"]
  node_cdnjs["cdnjs provider"]
  node_jsdelivr["jsDelivr provider"]
  node_unpkg["unpkg provider"]
  node_filesystem["File system provider"]
end

subgraph group_vs["Visual Studio"]
  node_vs_package["VS package"]
  node_vs_commands["VS commands<br/>[Commands]"]
  node_command_service["Command service"]
  node_completion["JSON completion"]
  node_search["Library search<br/>[Search]"]
  node_suggested_actions["Light bulb actions<br/>[SuggestedActions]"]
  node_error_list["Error reporting<br/>[ErrorList]"]
end

node_developer(("Developer"))
node_external_catalogs(("Online catalogs"))
node_local_sources(("Local or remote files"))

node_developer -->|"runs commands"| node_cli
node_developer -->|"uses IDE"| node_vs_package
node_cli -->|"starts app"| node_cli_commands
node_cli_commands -->|"installs libraries"| node_manifest
node_vs_package -->|"registers commands"| node_vs_commands
node_vs_package -->|"imports service"| node_command_service
node_command_service -->|"loads and restores"| node_manifest
node_manifest -.->|"tracks desired state"| node_installation_state
node_manifest -->|"resolves provider"| node_provider_contract
node_manifest -->|"validates libraries"| node_validation
node_manifest -->|"computes file goal"| node_goal_state
node_goal_state -.->|"describes file writes"| node_host_io
node_cache -->|"downloads streams"| node_web_request
node_cache -.->|"caches resources"| node_external_catalogs
node_provider_contract -.->|"implemented by"| node_cdnjs
node_provider_contract -.->|"implemented by"| node_jsdelivr
node_provider_contract -.->|"implemented by"| node_unpkg
node_provider_contract -.->|"implemented by"| node_filesystem
node_cdnjs -->|"reads libraries"| node_external_catalogs
node_jsdelivr -->|"reads libraries"| node_external_catalogs
node_unpkg -->|"reads libraries"| node_external_catalogs
node_filesystem -->|"reads files"| node_local_sources
node_completion -.->|"requests suggestions"| node_search
node_suggested_actions -.->|"offers commands"| node_command_service
node_command_service -->|"propagates errors"| node_error_list

click node_cli "https://github.com/aspnet/librarymanager/blob/main/src/libman/Program.cs"
click node_cli_commands "https://github.com/aspnet/librarymanager/tree/main/src/libman/Commands"
click node_vs_package "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Vsix/LibraryManagerPackage.cs"
click node_vs_commands "https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager.Vsix/Commands"
click node_command_service "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Vsix/Shared/LibraryCommandService.cs"
click node_manifest "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/Manifest.cs"
click node_installation_state "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/LibraryInstallationState.cs"
click node_validation "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/LibrariesValidator.cs"
click node_goal_state "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Contracts/LibraryInstallationGoalState.cs"
click node_host_io "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Contracts/IHostInteraction.cs"
click node_cache "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/Cache/CacheService.cs"
click node_web_request "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/Cache/WebRequestHandler.cs"
click node_provider_contract "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Contracts/IProvider.cs"
click node_cdnjs "https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager/Providers/Cdnjs"
click node_jsdelivr "https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager/Providers/jsDelivr"
click node_unpkg "https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager/Providers/Unpkg"
click node_filesystem "https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager/Providers/FileSystem"
click node_completion "https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Vsix/Json/Completion/CompletionController.cs"
click node_search "https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager.Vsix/Search"
click node_suggested_actions "https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager.Vsix/Json/SuggestedActions"
click node_error_list "https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager.Vsix/ErrorList"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_cli_commands toneBlue
class node_manifest,node_installation_state,node_validation,node_goal_state,node_host_io,node_cache,node_web_request toneAmber
class node_provider_contract,node_cdnjs,node_jsdelivr,node_unpkg,node_filesystem toneMint
class node_vs_package,node_vs_commands,node_command_service,node_completion,node_search,node_suggested_actions,node_error_list toneRose
class node_developer,node_external_catalogs,node_local_sources toneIndigo
```

## Components

### User entry points

- [CLI app](https://github.com/aspnet/librarymanager/blob/main/src/libman/Program.cs): `src/libman/Program.cs`
- [CLI commands](https://github.com/aspnet/librarymanager/tree/main/src/libman/Commands): `src/libman/Commands`

### Install engine

- [Manifest restore](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/Manifest.cs): `src/LibraryManager/Manifest.cs`
- [Install state](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/LibraryInstallationState.cs): `src/LibraryManager/LibraryInstallationState.cs`
- [Library validation](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/LibrariesValidator.cs): `src/LibraryManager/LibrariesValidator.cs`
- [File goal state](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Contracts/LibraryInstallationGoalState.cs): `src/LibraryManager.Contracts/LibraryInstallationGoalState.cs`
- [Host file access](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Contracts/IHostInteraction.cs): `src/LibraryManager.Contracts/IHostInteraction.cs`
- [Resource cache](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/Cache/CacheService.cs): `src/LibraryManager/Cache/CacheService.cs`
- [Web requests](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager/Cache/WebRequestHandler.cs): `src/LibraryManager/Cache/WebRequestHandler.cs`

### Library sources

- [Provider contract](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Contracts/IProvider.cs): `src/LibraryManager.Contracts/IProvider.cs`
- [cdnjs provider](https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager/Providers/Cdnjs): `src/LibraryManager/Providers/Cdnjs`
- [jsDelivr provider](https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager/Providers/jsDelivr): `src/LibraryManager/Providers/jsDelivr`
- [unpkg provider](https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager/Providers/Unpkg): `src/LibraryManager/Providers/Unpkg`
- [File system provider](https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager/Providers/FileSystem): `src/LibraryManager/Providers/FileSystem`

### Visual Studio

- [VS package](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Vsix/LibraryManagerPackage.cs): `src/LibraryManager.Vsix/LibraryManagerPackage.cs`
- [VS commands](https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager.Vsix/Commands): `src/LibraryManager.Vsix/Commands`
- [Command service](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Vsix/Shared/LibraryCommandService.cs): `src/LibraryManager.Vsix/Shared/LibraryCommandService.cs`
- [JSON completion](https://github.com/aspnet/librarymanager/blob/main/src/LibraryManager.Vsix/Json/Completion/CompletionController.cs): `src/LibraryManager.Vsix/Json/Completion/CompletionController.cs`
- [Library search](https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager.Vsix/Search): `src/LibraryManager.Vsix/Search`
- [Light bulb actions](https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager.Vsix/Json/SuggestedActions): `src/LibraryManager.Vsix/Json/SuggestedActions`
- [Error reporting](https://github.com/aspnet/librarymanager/tree/main/src/LibraryManager.Vsix/ErrorList): `src/LibraryManager.Vsix/ErrorList`

### Other components

- **Developer**
- **Online catalogs**
- **Local or remote files**

## Connections

- Developer → CLI app: runs commands (evidence: `README.md`)
- Developer → VS package: uses IDE (evidence: `README.md`)
- CLI app → CLI commands: starts app (evidence: `src/libman/Program.cs`)
- CLI commands → Manifest restore: installs libraries (evidence: `src/libman/Commands/InstallCommand.cs`)
- VS package → VS commands: registers commands (evidence: `src/LibraryManager.Vsix/LibraryManagerPackage.cs`)
- VS package → Command service: imports service (evidence: `src/LibraryManager.Vsix/LibraryManagerPackage.cs`)
- Command service → Manifest restore: loads and restores (evidence: `src/LibraryManager.Vsix/Shared/LibraryCommandService.cs`)
- Manifest restore → Install state: tracks desired state
- Manifest restore → Provider contract: resolves provider (evidence: `src/LibraryManager/Manifest.cs`)
- Manifest restore → Library validation: validates libraries (evidence: `src/LibraryManager/Manifest.cs`)
- Manifest restore → File goal state: computes file goal (evidence: `src/LibraryManager/Manifest.cs`)
- File goal state → Host file access: describes file writes
- Resource cache → Web requests: downloads streams (evidence: `src/LibraryManager/Cache/CacheService.cs`)
- Resource cache → Online catalogs: caches resources
- Provider contract → cdnjs provider: implemented by
- Provider contract → jsDelivr provider: implemented by
- Provider contract → unpkg provider: implemented by
- Provider contract → File system provider: implemented by
- cdnjs provider → Online catalogs: reads libraries (evidence: `README.md`)
- jsDelivr provider → Online catalogs: reads libraries (evidence: `README.md`)
- unpkg provider → Online catalogs: reads libraries (evidence: `README.md`)
- File system provider → Local or remote files: reads files (evidence: `README.md`)
- JSON completion → Library search: requests suggestions
- Light bulb actions → Command service: offers commands
- Command service → Error reporting: propagates errors (evidence: `src/LibraryManager.Vsix/Shared/LibraryCommandService.cs`)
