Skip to main content

GitHub Copilot Chat cheat sheet

Use this cheat sheet to quickly reference the most common commands and options for using Чат GitHub Copilot.

This version of this article is for Copilot on the GitHub website. For other versions of this article, click the tabs above.

О усовершенствованиях GitHub Copilot

Вы можете улучшить интерфейс Копилот Чат с различными командами и параметрами. Поиск правильной команды или параметра для задачи, над которой вы работаете, может помочь вам добиться целей более эффективно. Этот памятка содержит краткую ссылку на наиболее распространенные команды и варианты использования Копилот Чат.

For information about how to get started with Копилот Чат in the GitHub website, see Запрос вопросов GitHub Copilot в GitHub.

Mentions

Use @ mentions in to attach relevant context directly to your conversations. Type @ in the chat prompt box to display a list of items you can attach, such as:

  • Discussions
  • Extensions
  • Files
  • Issues
  • Pull requests
  • Repositories

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by the command name.

Available slash commands may vary, depending on your environment and the context of your chat. To view a list of currently available slash commands, type / in the chat prompt box of your current environment. Below is a list of some of the most common slash commands for using Копилот Чат.

CommandDescription
/clearClear conversation.
/deleteDelete a conversation.
/newStart a new conversation
/renameRename a conversation.

MCP skills

Below is a list of the MCP skills that are currently available in Copilot Chat в GitHub, and example prompts you can use to invoke them. You do not need to use the MCP skill name in your prompt; you can simply ask Копилот Чат to perform the task.

SkillExample prompt
create_branchCreate a new branch called [BRANCH-NAME] in the repository [USERNAME/REPO-NAME].
create_or_update_fileAdd a new file named hello-world.md to my [BRANCH-NAME] of [USERNAME/REPO-NAME] with the content: "Hello, world! This file was created from Copilot Chat в GitHub!"
push_filesPush the files test.md with the content "This is a test file" and test-again.md with the content "This is another test file" to the [BRANCH-NAME] in [USERNAME/REPO-NAME]
update_pull_request_branchUpdate the branch for pull request [PR-number] in [USERNAME/REPO-NAME] with the latest changes from the base branch.
merge_pull_requestMerge pull request [PR-Number] in [USERNAME/REPO-NAME]
get_meTell me about myself.
search_usersSearch for users with the name "Mona Octocat"

For more information about using MCP skills in Копилот Чат, see Использование сервера GitHub MCP.

This version of this article is for Copilot in Visual Studio Code. For other versions of this article, click the tabs above.

О усовершенствованиях GitHub Copilot

Вы можете улучшить интерфейс Копилот Чат с различными командами и параметрами. Поиск правильной команды или параметра для задачи, над которой вы работаете, может помочь вам добиться целей более эффективно. Этот памятка содержит краткую ссылку на наиболее распространенные команды и варианты использования Копилот Чат.

For information about how to get started with Копилот Чат in Visual Studio Code, see Запрос вопросов GitHub Copilot в интегрированной среде разработки.

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by the command name.

Available slash commands may vary, depending on your environment and the context of your chat. To view a list of currently available slash commands, type / in the chat prompt box of your current environment. Below is a list of some of the most common slash commands for using Копилот Чат.

CommandDescription
/clearStart a new chat session.
/explainExplain how the code in your active editor works.
/fixPropose a fix for problems in the selected code.
/fixTestFailureFind and fix a failing test.
/helpQuick reference and basics of using GitHub Copilot.
/newCreate a new project.
/testsGenerate unit tests for the selected code.

Chat variables

Use chat variables to include specific context in your prompt. To use a chat variable, type # in the chat prompt box, followed by a chat variable.

VariableDescription
#blockIncludes the current block of code in the prompt.
#classIncludes the current class in the prompt.
#commentIncludes the current comment in the prompt.
#fileIncludes the current file's content in the prompt.
#functionIncludes the current function or method in the prompt.
#lineIncludes the current line of code in the prompt.
#pathIncludes the file path in the prompt.
#projectIncludes the project context in the prompt.
#selectionIncludes the currently selected text in the prompt.
#symIncludes the current symbol in the prompt.

Chat participants

Chat participants are like domain experts who have a specialty that they can help you with. You can specify a chat participant by typing @ in the chat prompt box, followed by a chat participant name. To see all available chat participants, type @ in the chat prompt box.

Below is a list of some of the most common chat participants for using Копилот Чат.

VariableDescription
@azureHas context about Azure services and how to use, deploy and manage them. Use @azure when you want help with Azure. The @azure chat participant is currently in public preview and is subject to change.
@githubAllows you to use GitHub-specific Copilot skills. See Запрос вопросов GitHub Copilot в интегрированной среде разработки.
@terminalHas context about the Visual Studio Code terminal shell and its contents. Use @terminal when you want help creating or debugging terminal commands.
@vscodeHas context about Visual Studio Code commands and features. Use @vscode when you want help with Visual Studio Code.
@workspaceHas context about the code in your workspace. Use @workspace when you want Copilot to consider the structure of your project, how different parts of your code interact, or design patterns in your project.

This version of this article is for Copilot in Visual Studio. For other versions of this article, click the tabs above.

О усовершенствованиях GitHub Copilot

Вы можете улучшить интерфейс Копилот Чат с различными командами и параметрами. Поиск правильной команды или параметра для задачи, над которой вы работаете, может помочь вам добиться целей более эффективно. Этот памятка содержит краткую ссылку на наиболее распространенные команды и варианты использования Копилот Чат.

For information about how to get started with Копилот Чат in Visual Studio, see Запрос вопросов GitHub Copilot в интегрированной среде разработки.

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by the command name.

Available slash commands may vary, depending on your environment and the context of your chat. To view a list of currently available slash commands, type / in the chat prompt box of your current environment. Below is a list of some of the most common slash commands for using Копилот Чат.

CommandDescription
/docAdd documentation comment for this symbol.
/explainExplain how the code in your active editor works.
/fixPropose a fix for problems in the selected code.
/helpQuick reference and basics of using GitHub Copilot.
/optimizeAnalyze and improve running time of the selected code.
/testsGenerate unit tests for the selected code.

References

By default, Копилот Чат will reference the file that you have open or the code that you have selected. You can also use # followed by a file name, file name and line numbers, or solution to reference a specific file, lines, or solution.

ExampleDescription
Where are the tests in #MyFile.cs?References a specific file
How are these files related #MyFile.cs #MyFile2.csReferences multiple files
Explain this function #MyFile.cs: 66-72?References specific lines in a file
Is there a delete method in this #solution?References the current file

This version of this article is for Copilot in JetBrains. For other versions of this article, click the tabs above.

О усовершенствованиях GitHub Copilot

Вы можете улучшить интерфейс Копилот Чат с различными командами и параметрами. Поиск правильной команды или параметра для задачи, над которой вы работаете, может помочь вам добиться целей более эффективно. Этот памятка содержит краткую ссылку на наиболее распространенные команды и варианты использования Копилот Чат.

For information about how to get started with Копилот Чат in JetBrains, see Запрос вопросов GitHub Copilot в интегрированной среде разработки.

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by the command name.

Available slash commands may vary, depending on your environment and the context of your chat. To view a list of currently available slash commands, type / in the chat prompt box of your current environment. Below is a list of some of the most common slash commands for using Копилот Чат.

CommandDescription
/explainExplain how the code in your active editor works.
/fixPropose a fix for problems in the selected code.
/helpQuick reference and basics of using GitHub Copilot.
/testsGenerate unit tests for the selected code.

This version of this article is for Copilot in Xcode. For other versions of this article, click the tabs above.

О усовершенствованиях GitHub Copilot

Вы можете улучшить интерфейс Копилот Чат с различными командами и параметрами. Поиск правильной команды или параметра для задачи, над которой вы работаете, может помочь вам добиться целей более эффективно. Этот памятка содержит краткую ссылку на наиболее распространенные команды и варианты использования Копилот Чат.

For information about how to get started with Копилот Чат in Xcode, see Запрос вопросов GitHub Copilot в интегрированной среде разработки.

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by the command name.

Available slash commands may vary, depending on your environment and the context of your chat. To view a list of currently available slash commands, type / in the chat prompt box of your current environment. Below is a list of the slash commands for using Копилот Чат.

CommandDescription
/docGenerate documentation for this symbol.
/explainProvide an explanation for the selected code.
/fixSuggest fixes for code errors and typos.
/simplifySimplify the current code selection.
/testsCreate a unit test for the current code selection.