{"meta":{"title":"Getting started with prompts for GitHub Copilot Chat in your IDE","intro":"Get an overview of ways to use Copilot Chat in your IDE.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos","title":"How-tos"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/chat-with-copilot","title":"Chat with Copilot"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/chat-with-copilot/get-started-with-chat-in-your-ide","title":"Get started with Chat in your IDE"}],"documentType":"article"},"body":"# Getting started with prompts for GitHub Copilot Chat in your IDE\n\nGet an overview of ways to use Copilot Chat in your IDE.\n\nYou can ask Copilot Chat specific questions about your project or general software questions. You can also ask Copilot Chat to write code, fix errors, write tests, and document code.\n\nUse the tabs above to select the environment where you are using Copilot Chat.\n\n<div class=\"ghd-tool vscode\">\n\n<a href=\"vscode://GitHub.Copilot-Chat?ref_product=copilot&ref_type=engagement&ref_style=button\" target=\"_blank\" class=\"btn btn-primary mt-3 mr-3 mb-3 no-underline\">\n    <span>Open Copilot Chat in Visual Studio Code</span> <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-link-external\" aria-label=\"link external icon\" role=\"img\"><path d=\"M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z\"></path></svg>\n</a>\n\nSome of the following example prompts use chat participants (preceded by `@`), slash commands (preceded by `/`), or chat variables (preceded by `#`). For more information on keywords in prompts, see [Asking GitHub Copilot questions in your IDE](/en/enterprise-cloud@latest/copilot/how-tos/chat-with-copilot/chat-in-ide#using-keywords-in-your-prompt).\n\n## Ask general software questions\n\nYou can ask Copilot Chat general software questions. For example:\n\n* `tell me about nodejs web server frameworks`\n* `how can I create an Express app`\n* `@terminal how to update an npm package`\n\n## Ask questions about your project\n\nYou can ask Copilot Chat questions about your project.\n\n* `what sorting algorithm does this function use`\n* `@workspace how are notifications scheduled`\n* `#file:gameReducer.js #file:gameInit.js how are these files related`\n\nTo give Copilot the correct context, try some of these strategies:\n\n* Highlight relevant lines of code.\n* Use chat variables like `#selection`, `#file`, `#editor`, `#codebase`, or `#git`.\n* Use the `@workspace` chat participant.\n\n## Write code\n\nYou can ask Copilot to write code for you. For example:\n\n* `write a function to sum all numbers in a list`\n* `add error handling to this function`\n* `@workspace add form validation, similar to the newsletter page`\n\nWhen Copilot returns a code block, the response includes options to copy the code, or to insert the code at your cursor, into a new file, or into the terminal.\n\n## Ask questions about alerts from GitHub Advanced Security features\n\nYou can ask Copilot about security alerts in repositories in your organization from GitHub Advanced Security features (code scanning, secret scanning, and Dependabot alerts). For example:\n\n* `How would I fix this alert?`\n* `How many alerts do I have on this pull request?`\n* `Which line of code is this code scanning alert referencing?`\n* `What library is affected by this Dependabot alert?`\n\n## Set up a new project\n\nUse the `/new` slash command to set up a new project. For example:\n\n* `/new react app with typescript`\n* `/new python django web application`\n* `/new node.js express server`\n\nCopilot will suggest a directory structure and provide a button to create the suggested files and contents. To preview a suggested file, select the file name in the suggested directory structure.\n\nUse the `/newNotebook` slash command to set up a new Jupyter notebook. For example:\n\n* `/newNotebook retrieve the titanic dataset and use Seaborn to plot the data`\n\n## Fix, improve, and refactor code\n\nIf your active file contains an error, use the `/fix` slash command to ask Copilot to fix the error.\n\nYou can also make general requests to improve or refactor your code.\n\n* `how would you improve this code?`\n* `translate this code to C#`\n* `add error handling to this function`\n\n## Write tests\n\nUse the `/tests` slash command to ask Copilot to write tests for the active file or selected code. For example:\n\n* `/tests`\n* `/tests using the Jest framework`\n* `/tests ensure the function rejects an empty list`\n\nThe `/tests` slash command writes tests for existing code. If you prefer to write tests before writing code (test driven development), omit the `/tests` command. For example:\n\n* `Add tests for a JavaScript function that should sum a list of integers`\n\n## Ask questions about Visual Studio Code\n\nUse the `@vscode` chat participant to ask specific questions about Visual Studio Code. For example:\n\n* `@vscode tell me how to debug a node.js app`\n* `@vscode how do I change my Visual Studio Code colors`\n* `@vscode how can I change key bindings`\n\n## Ask questions about the command line\n\nUse the `@terminal` chat participant to ask specific questions about the command line. For example:\n\n* `@terminal find the largest file in the src directory`\n* `@terminal #terminalLastCommand` to explain the last command and any errors\n\n</div>\n\n<div class=\"ghd-tool visualstudio\">\n\n## Ask general software questions\n\nYou can ask Copilot Chat general software questions. For example:\n\n* `tell me about nodejs web server frameworks`\n* `how can I create an Express app`\n* `what's the process for updating an npm package`\n\n## Ask questions about your project\n\nYou can ask Copilot Chat questions about your project. To give Copilot the correct context, try some of these strategies:\n\n* Highlight relevant lines of code.\n* Open the relevant file.\n* Use `#file` to tell Copilot to reference specific files.\n* Use `#solution` to tell Copilot to reference the active file.\n\nFor example:\n\n* `what sorting algorithm does this function use`\n* `#file:gameReducer.js what happens when a new game is requested`\n\n## Write code\n\nYou can ask Copilot to write code for you. For example:\n\n* `write a function to sum all numbers in a list`\n* `add error handling to this function`\n\nWhen Copilot returns a code block, the response includes options to copy the code, insert the code into a new file, or preview the code output.\n\n## Ask questions about alerts from GitHub Advanced Security features\n\nYou can ask Copilot about security alerts in repositories in your organization from GitHub Advanced Security features (code scanning, secret scanning, and Dependabot alerts). For example:\n\n* `How would I fix this alert?`\n* `How many alerts do I have on this pull request?`\n* `Which line of code is this code scanning alert referencing?`\n* `What library is affected by this Dependabot alert?`\n\n## Fix, improve, and refactor code\n\nIf your active file contains an error, use the `/fix` slash command to ask Copilot to fix the error.\n\nYou can also make general requests to improve or refactor your code.\n\n* `how would you improve this code?`\n* `translate this code to C#`\n* `add error handling to this function`\n\n## Write tests\n\nUse the `/tests` slash command to ask Copilot to write tests for the active file or selected code. For example:\n\n* `/tests`\n* `/tests using the Jest framework`\n* `/tests ensure the function rejects an empty list`\n\nThe `/tests` slash command writes tests for existing code. If you prefer to write tests before writing code (test driven development), omit the `/tests` command. For example:\n\n* `Add tests for a JavaScript function that should sum a list of integers`\n\n</div>\n\n<div class=\"ghd-tool jetbrains\">\n\n## Ask general software questions\n\nYou can ask Copilot Chat general software questions. For example:\n\n* `tell me about nodejs web server frameworks`\n* `how can I create an Express app`\n* `what's the process for updating an npm package`\n\n## Ask questions about your project\n\nYou can ask Copilot Chat questions about your project. To give Copilot the correct context, try some of these strategies:\n\n* Highlight relevant lines of code.\n* Open the relevant file.\n* Add the file as a reference. For information about how to use file references, see [Asking GitHub Copilot questions in your IDE](/en/enterprise-cloud@latest/copilot/how-tos/chat-with-copilot/chat-in-ide?tool=jetbrains#file-references).\n* Use the `@project` chat participant.\n\nFor example:\n\n* `what sorting algorithm does this function use`\n* `how are these files related` (with references to the files in question)\n* `@project how are notifications scheduled`\n\n## Write code\n\nYou can ask Copilot to write code for you. For example:\n\n* `write a function to sum all numbers in a list`\n* `add error handling to this function`\n\nWhen Copilot returns a code block, the response includes options to copy the code or to insert the code at your cursor.\n\n## Fix, improve, and refactor code\n\nIf your active file contains an error, use the `/fix` slash command to ask Copilot to fix the error.\n\nYou can also make general requests to improve or refactor your code.\n\n* `how would you improve this code?`\n* `translate this code to C#`\n* `add error handling to this function`\n\n## Write tests\n\nUse the `/tests` slash command to ask Copilot to write tests for the active file or selected code. For example:\n\n* `/tests`\n* `/tests using the Jest framework`\n* `/tests ensure the function rejects an empty list`\n\nThe `/tests` slash command writes tests for existing code. If you prefer to write tests before writing code (test driven development), omit the `/tests` command. For example:\n\n* `Add tests for a JavaScript function that should sum a list of integers`\n\n</div>\n\n<div class=\"ghd-tool eclipse\">\n\n## Ask general software questions\n\nYou can ask Copilot Chat general software questions. For example:\n\n* `tell me about nodejs web server frameworks`\n* `how can I create an Express app`\n* `what's the process for updating an npm package`\n\n## Ask questions about files your project\n\nYou can ask Copilot Chat questions about the file that's currently displayed in the editor, or about files you have attached to your conversation in the Copilot Chat panel. To give Copilot the correct context:\n\n* Open the relevant file in the editor.\n* Click the paperclip icon in the Copilot Chat panel, then search for and select files you want to attach to the conversation.\n\nFor example:\n\n* `how can I make this file run faster`\n* `how are these files related` (with two or more attached files)\n* `explain the getSearchReplaceRules function`\n\n## Write code\n\nYou can ask Copilot to write code for you. For example:\n\n* `write a TypeScript function to sum all numbers in a list`\n* `using the comments in this file, create appropriate Node JavaScript`\n\nWhen Copilot returns a code block, the response includes options to copy the code.\n\n## Fix, improve, and refactor code\n\nIf your active file contains an error, use the `/fix` slash command to ask Copilot to fix the error.\n\nYou can also make general requests to improve or refactor your code.\n\n* `how would you improve the code in this file`\n* `translate this code to C#`\n* `add error handling to the main function`\n\n## Write tests\n\nUse the `/tests` slash command to ask Copilot to write tests for the active file or selected code. For example:\n\n* `/tests`\n* `/tests using the Jest framework`\n* `/tests ensure the function rejects an empty list`\n\nThe `/tests` slash command writes tests for existing code. If you prefer to write tests before writing code (test driven development), omit the `/tests` command. For example:\n\n* `Add tests for a JavaScript function that should sum a list of integers`\n\n</div>"}