Copilot CLI in VS Code

Alex from the Azure tools for VS Code team demonstrates new features that improve the integration between GitHub Copilot CLI and Visual Studio Code, including seamless connection, the /IDE command, a diff review feature, session management, and enhanced context sharing between the editor and CLI. These updates streamline the workflow for developers by making it easier to review code changes, manage sessions, and guide Copilot’s suggestions directly within VS Code.

Alex, a member of the Azure tools for VS Code team, introduces several new features that enhance the integration between GitHub Copilot CLI and Visual Studio Code. He explains that these updates are designed to make it easier for developers to use Copilot CLI alongside VS Code, whether they prefer using an external terminal or the integrated terminal within VS Code. The features highlighted include the new /IDE command, a diff feature for reviewing code changes, displaying CLI sessions in the VS Code sessions view, and sharing the active editor context from VS Code to the CLI.

He begins by demonstrating how to set up a new project folder and open it in VS Code. When starting the Copilot CLI, Alex points out that the CLI automatically connects to the VS Code window if the same folder is open, and it skips the usual trust prompt because the workspace trust information is shared between VS Code and the CLI. This seamless connection ensures that developers can move smoothly between the CLI and the editor without redundant prompts or manual configuration.

Alex then showcases the /IDE command, which allows users to manage the connection between the Copilot CLI and VS Code. This command provides a summary of the features enabled by the integration and allows users to switch or disconnect VS Code windows as needed. He proceeds to use Copilot CLI to generate a simple tic-tac-toe app, specifying that the HTML, CSS, and JavaScript files should be kept separate. When Copilot proposes file changes, Alex demonstrates the new diff feature, which lets users review and accept or reject code changes directly within VS Code’s diff view, streamlining the code review process.

After creating the project, Alex switches to the integrated terminal in VS Code and highlights the sessions view, where previous CLI sessions are listed. This feature allows users to resume CLI sessions directly within VS Code, maintaining continuity between external and integrated terminals. He also demonstrates how to open project files in split view and points out a new indicator in the bottom right corner of VS Code, which shows the active file and context being shared with Copilot CLI. This ensures that the CLI is aware of which files and selections the user is working on, improving the relevance of Copilot’s suggestions.

Finally, Alex introduces the ability to mention files in the CLI prompt, which helps scope Copilot’s actions to specific files. He highlights a new shortcut, “Add file to Copilot CLI,” which quickly adds the current file (and any highlighted text) as a reference in the prompt. This makes it easier to guide Copilot’s suggestions and edits. Alex concludes by summarizing these productivity enhancements and hands the presentation back to his colleagues.