GH-300 - Use GitHub Copilot features - Section 2.3

Install and use the GitHub Copilot CLI to generate commands, scripts, and manage files.

Install the GitHub Copilot CLI, explain how it helps developers in the terminal, and use it interactively and in sessions to suggest shell commands, explain commands, generate scripts, and manage files. Distinguish CLI use from IDE inline suggestions and chat.

GitHub Copilot CLIShell command generationCLI sessionsCommand explanation

Practice question for this objective

Free sampleUse GitHub Copilot featuresmedium

A developer in the terminal needs two things in quick succession: a one-off shell command to count lines across the repository, and then a prose walk-through of how an existing build script's logic works. Which use of the GitHub Copilot CLI matches both needs within the same tool?

  • ARequest the count command from the CLI, then use editor inline completions for the script walk-through, because the CLI cannot describe an existing script's behaviour.
  • BOpen Copilot code review for the count command and Copilot Spaces for the script explanation, because neither task is something the terminal CLI is built to do.
  • CUse the CLI to suggest the count command, then ask the CLI to explain the build script, since the CLI handles both command generation and command explanation. Correct
  • DAsk the CLI for the count command, but switch to editor Agent Mode for the script explanation, as the CLI only generates commands and never explains them.
The GitHub Copilot CLI both generates shell commands and explains existing commands or scripts within the terminal. Command generation and command explanation are two capabilities of the same GitHub Copilot CLI, so a developer can ask it to suggest a command and then ask it to describe how an existing script works without leaving the terminal or switching to inline completions, code review, Spaces, or Agent Mode.

Why A is wrong: This wrongly limits the CLI; it can both suggest a command and explain an existing command or script, so no handoff to inline completions is needed.

Why B is wrong: This misroutes both tasks; code review acts on pull request diffs and Spaces curates context, while the CLI is the surface built for terminal command work.

Why C is correct: The GitHub Copilot CLI supports both generating a command from a description and explaining an existing command or script, covering both needs in one tool.

Why D is wrong: This is tempting but inaccurate; the CLI does explain commands and scripts in plain English, so switching to Agent Mode for the walk-through is unnecessary.

See more GH-300 practice questions, answers explained.

More in this domain

Back to all Use GitHub Copilot features objectives, or the GH-300 cert hub.

Examworthy is not affiliated with or endorsed by GitHub. Original, blueprint-aligned practice material only.