GitHub Copilot Certification — Question 10
How do you generate code suggestions with GitHub Copilot in the CLI?
Answer options
- A. Write code comments –> Press the suggestion shortcut –> Select the best suggestion from the list.
- B. Use ‘gh copilot suggest’ –> Write the command you want –> Select the best suggestion from the list.
- C. Type out the code snippet –> Use the copilot refine command to enhance it –> Review the suggest command.
- D. Describe the project’s architecture –> Use the copilot generate command –> Accept the generated suggestion.
Correct answer: B
Explanation
The correct answer is B because it accurately describes the specific command ‘gh copilot suggest’ which initiates the suggestion process in the CLI. Option A incorrectly suggests using code comments to generate suggestions, which is not applicable in this context. Option C does not involve the correct command for suggestions, and option D describes a different process that does not lead to code suggestions.