GH-300 - Use GitHub Copilot features (28% of the exam) - 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.

Exam traps in Use GitHub Copilot features

Answers that look right on this material and are not. Each one is a distractor from a different question in the GH-300 bank for this domain.

  • Its shell command generation capability, which takes a described goal and produces a brand-new command, replacing the colleague's line with its own version.

    Why it is wrong: Generation produces a new command from a described goal, but the engineer already has a command and wants it explained, not regenerated into a different one.

  • Use inline ghost-text completions in the editor, which suggest the next lines of code as the developer types inside an open source file in the IDE.

    Why it is wrong: Inline completions assist typing inside editor files and are not a terminal surface, so they cannot turn a plain-English task into a reviewable shell command at the command line.

  • The GitHub Copilot CLI proxy guarantees the command is safe by post-processing every suggestion, so the developer can run the returned command unchecked.

    Why it is wrong: The proxy filters and post-processes suggestions but does not guarantee a command is safe for the developer's system, so unchecked execution shifts away accountability that stays with the developer.

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