# novadem/vcpkg architecture

> Architecture diagram of the GitHub repository novadem/vcpkg, 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/novadem/vcpkg
- Repository: https://github.com/novadem/vcpkg

## Overview

Vcpkg is a cross-platform C/C++ package manager. Its main user workflow is to request packages through the CLI; the manager resolves package requirements, reads port control metadata, builds and installs packages, and makes them available to projects through integration and a CMake toolchain. The repository also includes commands for exporting, updating, searching, and managing packages. The excerpts substantiate paragraph parsing and metadata conversion; README statements support the user-facing capabilities, but most command and install internals were not sampled, so those links are marked unverified.

Main entry points: [`toolsrc/src/vcpkg/statusparagraphs.cpp`](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/statusparagraphs.cpp) (Installed state), [`toolsrc/src/vcpkg/install.cpp`](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/install.cpp) (Install command), [`toolsrc/src/vcpkg/paragraphs.cpp`](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/paragraphs.cpp) (Control reader), [`toolsrc/src/vcpkg/commands.cpp`](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/commands.cpp) (Command dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and commands"]
  node_cli["Vcpkg CLI<br/>[vcpkg.cpp]"]
  node_dispatch["Command dispatch<br/>[commands.cpp]"]
  node_installcmd["Install command<br/>[install.cpp]"]
  node_othercmds["Other commands"]
end

subgraph group_packages["Package metadata"]
  node_portrecipes["Port recipes"]
  node_controlreader["Control reader<br/>[paragraphs.cpp]"]
  node_paragraphparser["Paragraph parser<br/>[paragraphs.cpp]"]
  node_sourcefields["Source metadata"]
  node_binaryfields["Binary metadata"]
  node_parseerrors["Parse results"]
end

subgraph group_lifecycle["Package lifecycle"]
  node_dependencyplan["Dependency planning<br/>[dependencies.cpp]"]
  node_build["Package build<br/>[build.cpp]"]
  node_installedstate[("Installed state")]
  node_remove["Remove packages<br/>[remove.cpp]"]
  node_export["Package export<br/>[export.cpp]"]
end

subgraph group_project["Project integration"]
  node_integration["User integration"]
  node_toolchain["CMake toolchain<br/>[vcpkg.cmake]"]
  node_consumer(("CMake project"))
end

node_user(("Package user"))

node_user -->|"runs commands"| node_cli
node_cli -.->|"dispatches"| node_dispatch
node_dispatch -.->|"routes install"| node_installcmd
node_dispatch -.->|"routes commands"| node_othercmds
node_installcmd -.->|"reads metadata"| node_controlreader
node_controlreader -->|"parses paragraphs"| node_paragraphparser
node_controlreader -->|"parses control file"| node_sourcefields
node_controlreader -->|"loads cached metadata"| node_binaryfields
node_paragraphparser -->|"reports parse errors"| node_parseerrors
node_sourcefields -.->|"returns parse errors"| node_parseerrors
node_installcmd -.->|"resolves requirements"| node_dependencyplan
node_dependencyplan -.->|"plans builds"| node_build
node_build -.->|"records installation"| node_installedstate
node_installcmd -.->|"installs packages"| node_installedstate
node_remove -.->|"updates state"| node_installedstate
node_export -.->|"exports packages"| node_installedstate
node_user -->|"requests integration"| node_integration
node_consumer -->|"configures project"| node_toolchain
node_toolchain -.->|"uses installed libraries"| node_installedstate

click node_cli "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg.cpp"
click node_dispatch "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/commands.cpp"
click node_installcmd "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/install.cpp"
click node_othercmds "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/commands.search.cpp"
click node_portrecipes "https://github.com/novadem/vcpkg/tree/master/ports"
click node_controlreader "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/paragraphs.cpp"
click node_paragraphparser "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/paragraphs.cpp"
click node_sourcefields "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/sourceparagraph.cpp"
click node_binaryfields "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/binaryparagraph.cpp"
click node_parseerrors "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/paragraphparseresult.cpp"
click node_dependencyplan "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/dependencies.cpp"
click node_build "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/build.cpp"
click node_installedstate "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/statusparagraphs.cpp"
click node_remove "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/remove.cpp"
click node_export "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/export.cpp"
click node_integration "https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/commands.integrate.cpp"
click node_toolchain "https://github.com/novadem/vcpkg/blob/master/scripts/buildsystems/vcpkg.cmake"

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_dispatch,node_installcmd,node_othercmds,node_user toneBlue
class node_portrecipes,node_controlreader,node_paragraphparser,node_sourcefields,node_binaryfields,node_parseerrors toneAmber
class node_dependencyplan,node_build,node_installedstate,node_remove,node_export toneMint
class node_integration,node_toolchain,node_consumer toneRose
```

## Components

### CLI and commands

- [Vcpkg CLI](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg.cpp): `toolsrc/src/vcpkg.cpp`
- [Command dispatch](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/commands.cpp): `toolsrc/src/vcpkg/commands.cpp`
- [Install command](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/install.cpp): `toolsrc/src/vcpkg/install.cpp`
- [Other commands](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/commands.search.cpp): `toolsrc/src/vcpkg/commands.search.cpp`

### Package metadata

- [Port recipes](https://github.com/novadem/vcpkg/tree/master/ports): `ports`
- [Control reader](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/paragraphs.cpp): `toolsrc/src/vcpkg/paragraphs.cpp`
- [Paragraph parser](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/paragraphs.cpp): `toolsrc/src/vcpkg/paragraphs.cpp`
- [Source metadata](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/sourceparagraph.cpp): `toolsrc/src/vcpkg/sourceparagraph.cpp`
- [Binary metadata](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/binaryparagraph.cpp): `toolsrc/src/vcpkg/binaryparagraph.cpp`
- [Parse results](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/paragraphparseresult.cpp): `toolsrc/src/vcpkg/paragraphparseresult.cpp`

### Package lifecycle

- [Dependency planning](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/dependencies.cpp): `toolsrc/src/vcpkg/dependencies.cpp`
- [Package build](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/build.cpp): `toolsrc/src/vcpkg/build.cpp`
- [Installed state](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/statusparagraphs.cpp): `toolsrc/src/vcpkg/statusparagraphs.cpp`
- [Remove packages](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/remove.cpp): `toolsrc/src/vcpkg/remove.cpp`
- [Package export](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/export.cpp): `toolsrc/src/vcpkg/export.cpp`

### Project integration

- [User integration](https://github.com/novadem/vcpkg/blob/master/toolsrc/src/vcpkg/commands.integrate.cpp): `toolsrc/src/vcpkg/commands.integrate.cpp`
- [CMake toolchain](https://github.com/novadem/vcpkg/blob/master/scripts/buildsystems/vcpkg.cmake): `scripts/buildsystems/vcpkg.cmake`
- **CMake project**

### Other components

- **Package user**

## Connections

- Package user → Vcpkg CLI: runs commands (evidence: `README.md`)
- Vcpkg CLI → Command dispatch: dispatches
- Command dispatch → Install command: routes install
- Command dispatch → Other commands: routes commands
- Install command → Control reader: reads metadata
- Control reader → Paragraph parser: parses paragraphs (evidence: `toolsrc/src/vcpkg/paragraphs.cpp`)
- Control reader → Source metadata: parses control file (evidence: `toolsrc/src/vcpkg/paragraphs.cpp`)
- Control reader → Binary metadata: loads cached metadata (evidence: `toolsrc/src/vcpkg/paragraphs.cpp`)
- Paragraph parser → Parse results: reports parse errors (evidence: `toolsrc/src/vcpkg/paragraphs.cpp`)
- Source metadata → Parse results: returns parse errors
- Install command → Dependency planning: resolves requirements
- Dependency planning → Package build: plans builds
- Package build → Installed state: records installation
- Install command → Installed state: installs packages
- Remove packages → Installed state: updates state
- Package export → Installed state: exports packages
- Package user → User integration: requests integration (evidence: `README.md`)
- CMake project → CMake toolchain: configures project (evidence: `README.md`)
- CMake toolchain → Installed state: uses installed libraries
