GH-300 · Question #49
How do you generate code suggestions with GitHub Copilot in the CLI?
The correct answer is A. Write code comments -> Press the suggestion shortcut -> Select the best suggestion from the list. The standard GitHub Copilot suggestion workflow is: write a comment or partial code line describing intent → Copilot automatically surfaces an inline suggestion → use keyboard shortcuts (Tab to accept, Alt+] to cycle) to select the best option. This applies to the…
Question
How do you generate code suggestions with GitHub Copilot in the CLI?
Options
- AWrite code comments -> Press the suggestion shortcut -> Select the best suggestion from the list.
- BUse copilot suggest -> Write the command you want -> Select the best suggestion from the list.
- CType out the code snippet -> Use the copilot refine command to enhance it -> Review the
- DDescribe the project's architecture -> Use the copilot generate command -> Accept the generated
How the community answered
(51 responses)- A92% (47)
- B2% (1)
- C4% (2)
- D2% (1)
Explanation
The standard GitHub Copilot suggestion workflow is: write a comment or partial code line describing intent → Copilot automatically surfaces an inline suggestion → use keyboard shortcuts (Tab to accept, Alt+] to cycle) to select the best option. This applies to the editor-integrated experience. (B) describes the GitHub Copilot CLI tool workflow (gh copilot suggest), which is a separate product for shell command assistance, not the primary code-generation flow. (C) and (D) describe commands (copilot refine, copilot generate) that do not exist in the standard Copilot toolset.
Topics
Community Discussion
No community discussion yet for this question.