A developer runs a failing shell command in their terminal and receives a cryptic error message. They want to use GitHub Copilot CLI to get a natural-language explanation of what went wrong. Which command should they run?
- A. gh copilot suggest "explain last error"
- B. gh copilot explain "$(cat ~/.bash_history | tail -1)"
- C. gh copilot explain✓ Correct
- D. gh copilot suggest --shell
Explanation
gh copilot explain is the correct CLI subcommand for getting a plain-language explanation of a command or its output — the developer can pass the failing command as an argument or respond to the interactive prompt. gh copilot suggest is used to generate a new shell command from a natural-language description, not to explain existing output. The second option attempts to pass history manually but is not the standard interface and would not explain error output. gh copilot suggest --shell specifies the target shell type for command generation, not error explanation.