C++ Dependencies Without the Headache: Vcpkg and Copilot CLI GitHub Copilot CLI, Microsoft's command-line AI agent, can automate C++ dependency management and project setup, as demonstrated in a Pure Virtual C++ 2026 session where it built a CMake-based CLI app using vcpkg and MSVC Build Tools. The workflow lets developers install tools, identify libraries, and integrate dependencies entirely from the terminal, reducing manual wiring and context-switching. C++ dependency setup and maintenance still slows down many teams. In my Pure Virtual C++ 2026 session, I show a terminal-first workflow that ends with a working CLI app that formats and prints programming quotes, built with CMake and Microsoft C++ MSVC Build Tools. All of this is powered by GitHub Copilot CLI, which does the work of generating the code and project files, identifying appropriate open-source library dependencies, installing the vcpkg package manager, and integrating the libraries into the project. What is GitHub Copilot CLI? GitHub Copilot CLI https://github.com/features/copilot/cli/ is the command-line implementation for GitHub Copilot, allowing you to run agents in a terminal window. You can use it as an AI chat interface, give it work to do semi- or fully autonomously, optionally across multiple parallel subagents. For C++ developers, Copilot CLI is a valuable tool for work you would be comfortable doing in the command line yourself, from generating code to compiling projects and debugging issues. You can persist and manage Copilot sessions, customize your environment with plugins, custom agents, MCP servers, skills, hooks, and models, and seamlessly switch from working in the command line to using Copilot in another environment like Visual Studio Code VS Code . Once you get into the groove, using it feels as natural as a web browser or an IDE. Check out the Pure Virtual C++ video What this demo covers This walkthrough will show you the following: - You can use Copilot to help you install the tools you need, including the vcpkg package manager. Copilot can also help you identify appropriate library dependencies, describe what each one does, and integrate them into your project. - vcpkg removes manual dependency wiring. You declare dependencies once in vcpkg.json , and restore is part of your normal configure/build flow. - Copilot helps you complete multi-step setup work without context-switching between docs and terminal commands. - You can work with Copilot on additional instructions, like setting an appropriate builtin-baseline to pin dependencies for reproducible builds while retaining the flexibility to upgrade later without introducing ABI-breaking changes in your dependency graph. This walkthrough starts from the first prompt and ends with a successful build: start in an empty folder, stay in the terminal, and avoid hand-managed include and link paths. Read-along Walkthrough This section is written so you can follow along with the video demo. Step 0: Configure Copilot CLI environment Before you get started, make sure your environment is set up and ready to go: Install GitHub Copilot CLI https://github.com/features/copilot/cli/ with your preferred package manager or a script.- Make sure you have CMake and a compiler installed on your system. In this video I used CMake with MSVC Build Tools on Windows. - Choose your preferred terminal application. On Windows, I recommend Windows Terminal, which supports multiple color-coded, custom-named tabs as I show in the video. - Create and navigate to a directory to work in e.g. mkdir quotecli . Add a subfolder called data with a quotes.json file that looks something like this: "quotes": { "text": "Any sufficiently advanced technology is indistinguishable from magic.", "author": "Arthur C. Clarke" }, { "text": "Simplicity is prerequisite for reliability.", "author": "Edsger W. Dijkstra" }, { "text": "Controlling complexity is the essence of computer programming.", "author": "Brian Kernighan" }, { "text": "That brain of mine is something more than merely mortal, as time will show.", "author": "Ada Lovelace" }, { "text": "First, solve the problem. Then, write the code.", "author": "John Johnson" }, { "text": "The most important property of a program is whether it accomplishes the intention of its user.", "author": "C.A.R. Hoare" }, { "text": "Programs must be written for people to read, and only incidentally for machines to execute.", "author": "Harold Abelson" }, { "text": "Premature optimization is the root of all evil.", "author": "Donald Knuth" } } - Run Copilot in your terminal from your working directory root by typing copilot . - Install the C++ language server protocol plugin, described in Streamline C++ code intelligence setup in Copilot CLI https://devblogs.microsoft.com/cppblog/streamline-c-code-intelligence-setup-in-copilot-cli/ . This is recommended for any C++ work with Copilot CLI, as it enables the semantic intelligence you’re used to in Visual Studio and VS Code in the CLI environment. In Copilot CLI, run /plugin install cpp-language-server@copilot-plugins . - Select your preferred model by running /model . I recommend starting with “Auto”, which lets Copilot select an appropriate model per task optimizing between token cost and correctness . You can also manually select a specific model. - Optional: Install a vcpkg custom skill https://github.com/github/awesome-copilot/tree/main/skills/vcpkg I wrote that gives Copilot additional guidance when working with vcpkg. Copilot does a pretty good job on its own, but this lets you handle more advanced scenarios in a more prescriptive way. Plus you can always edit the skill later to further control Copilot’s behavior. To install, download it https://github.com/AugP/awesome-copilot/tree/vcpkg-skill/skills/vcpkg to your machine, and run /skill add local-path-to-skill . Note: This skill isn’t officially maintained by Microsoft; it’s there to get you started with a customizable workflow, should you want it. Step 1: Set the context and ask Copilot CLI to build a plan Begin by typing Shift+Tab until you transition Copilot into Plan Mode . This mode causes Copilot to discuss an implementation plan with you before it begins working, and is useful if you want to use Copilot on something complex, such as a multi-step workflow. This allows you to check what Copilot wants to do before doing it, so you can intervene and correct it if necessary. Next, type a prompt similar to the following: I want to write a C++ console application that prints a random software development quote with pretty formatting from a list specified in data/quotes.json. I want to build with CMake and MSVC with some open-source libraries from vcpkg. I already have both CMake and MSVC installed, but don't have vcpkg. Install vcpkg and include it in this directory for use. I don't know what C++ libraries to use, help me work that out too. Expected result: Copilot produces a plan describing what it wants to build, how the project will be structured, the expected behavior of the app, and docs README file . Step 2: Accept plan and build Once Copilot has prepared the plan, if you are satisfied with it, you can select Accept plan and build on default permissions . This allows Copilot to begin working, while continuing to ask your permission to run commands and modify files. You could instead choose Accept plan and build on autopilot if you want Copilot to work autonomously and notify you when it finishes. You can also suggest changes if you’re not happy with the plan, and iterate until you’re ready to proceed. Expected result: Copilot CLI proposes library choices, sets up a CMake project, installs and initializes vcpkg in the repo, creates a vcpkg.json manifest, and builds the project to test that there are no errors. It may iterate on its work several times as it identifies new issues that need to be addressed e.g. selecting the appropriate CMake generator for what you have installed on your system . Step 3: Ask clarifying questions You can ask Copilot to explain its decisions or to give you a better understanding of the resulting project. Here are some example prompts: Explain each library you chose, what problem it solves in this app, and where we use it. Can you give me some boilerplate code for using