GITHUB-COPILOT practice question 4 of 15
How do you generate code suggestions with GitHub Copilot in the CLI?
Full set: 65 questionsGitHub Copilot in the CLI is an extension for the official GitHub CLI (gh). To generate a command suggestion, the user invokes gh copilot suggest followed by a natural language prompt describing the desired task. Copilot then analyzes the prompt and provides a list of potential commands. The user can then review these suggestions and select the most appropriate one to copy, explain, or execute. This workflow is distinct from the in-editor experience.
A. This describes the workflow for using GitHub Copilot within an IDE (like VS Code), not the command-line interface (CLI) tool.
C. The copilot refine command is not a valid command within the GitHub Copilot in the CLI feature set.
D. The copilot generate command does not exist; the correct command to generate suggestions from a prompt is gh copilot suggest.
1. GitHub Docs. (n.d.). Using GitHub Copilot in the CLI. GitHub. Retrieved from https://docs.github.com/en/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli.
Reference Point: In the "Asking GitHub Copilot in the CLI for a suggestion" section, the documentation explicitly states: "You can ask GitHub Copilot in the CLI to suggest a command for your use case using gh copilot suggest." It then provides the exact workflow: gh copilot suggest "PROMPT". This directly supports option B.
Keep practicing
Take the free GITHUB-COPILOT practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GITHUB-COPILOT practice questions
- Question 1What is the best way to share feedback about GitHub Copilot Chat when using it on GitHub …
- Question 2What types of prompts or code snippets might be flagged by the GitHub Copilot toxicity fi…
- Question 3What is the correct way to exclude specific files from being used by GitHub Copilot Busin…
- Question 5Which principle emphasizes that AI systems should be understandable and provide clear inf…
- Question 6What should developers consider when relying on GitHub Copilot for generating code that i…
- Question 7What is the process behind identifying public code matches when using a public code filte…
