If you use a licensed edition of Visual Studio (for example, Professional or Enterprise), Copilot access may be included with your Visual Studio subscription. Signing in with a paid GitHub Copilot account inside Visual Studio applies your Copilot subscription limits and features to the IDE. Check your Visual Studio account settings for entitlement details.
Core slash commands (quick reference)
These core slash commands are the most frequently used for day-to-day development tasks such as generating documentation, explaining code, proposing fixes, and starting fresh conversations.
Other useful slash commands
These additional commands extend Copilot’s capabilities for tests, optimization, scaffolding, and assistance. Use them to speed up repetitive or broader tasks.
Example quick reference (copy/paste into chat if helpful):
How to invoke a slash command
You can open and trigger slash commands in several convenient ways:- Type a forward slash
/directly in the GitHub Copilot Chat message box. - Click the Slash button in the Copilot Chat UI.
- Use inline chat tied to your editor (for example, press
Alt + /in many editor setups, or right‑click and select “Ask Copilot” from the context menu).

Why slash commands are convenient
- Dedicated Chat Window: Use the fuller chat UI to keep history, thread related prompts, and manage long conversations.
- Inline Chat Dialog: Keep context near the code with inline prompts—ideal for quick, localized edits or explanations.
- Continuous Workflow: Request documentation, fixes, tests, optimizations, or even scaffold projects without leaving your editor.

Demo walkthrough (sign-in and examples)
After signing in to Visual Studio with a qualifying account, Copilot surfaces sample actions such as “Summarize my code”, “Write unit tests”, “Fix my code”, and “Explain programming concepts.” These UI shortcuts insert the corresponding slash commands on your behalf and speed up common workflows.
Examples
Below are practical examples showing where to use slash commands for documentation, components, explanations, and tests. Program documentation example- Open a code file (for example,
Program.cs) and type/doc. Copilot inserts language-appropriate documentation comments for symbols near the cursor or for selected code.
- Select the component code and run
/docor/explainto generate component-level comments and method summaries.
- Highlight code and run
/explainto produce readable explanations or XML summary comments. For example, selecting middleware calls might yield:
- Use
/testson a method or class to have Copilot scaffold a test file with multiple cases and edge scenarios. If a CI run surfaces failing tests,/fix-test-failureinspects failures and suggests code-level fixes.
Closing notes and best practices
- Slash commands are available in both Visual Studio and Visual Studio Code. They accelerate documentation, fixes, optimizations, test generation, and project scaffolding seamlessly within your editor.
- Familiarize yourself with the most common commands — they reduce context switching and speed daily development tasks.
- Use inline chat for quick, context-sensitive requests and the main chat window for longer or multi-step conversations.
Tip: Use the inline chat for quick context-sensitive requests and the main chat window when you need a longer conversation or to manage multiple related prompts.
Links and references
- GitHub Copilot Chat docs: https://docs.github.com/en/copilot/copilot-chat
- Visual Studio: https://visualstudio.microsoft.com/
- Visual Studio Code: https://code.visualstudio.com/
- Flask: https://flask.palletsprojects.com/
- React: https://reactjs.org/
- Vue: https://vuejs.org/
- Blazor: https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor