Skip to content

Github Copilot

What is Github Copilot?

Github Copilot is an AI that helps you write code. It's a VSCode extension that uses OpenAI's Codex AI to generate code based on the context of your code. It's not a code generator, it's a code assistant. It's not going to write your code for you, but it will help you write your code faster.

How do I use Github Copilot?

Slash Commands

Github Copilot has a few slash commands that you can use to interact with it. You can see the commands by typing / in the editor. The commands are:

  • /doc - Adds a documentation comment
  • /explain - Explain the code
  • /fix - Propose a fix for the problems in the selected code
  • /generate - Generate code to answer your question
  • /help - Get help on Copliot Chat
  • /optimize - Analyze and improve running time of the selected code
  • /tests - Create unit tests for the selected code

Reference: Slash Commands and Context Variables