Send prompt text over stdin.
Section: Interactive and one-shot prompts
Pipe a prompt to Copilot
bash
bash
echo "Explain this file: ./complex.ts" | copilotExplanation
Useful in scripts or shell pipelines. If you also pass `-p`, the piped input is ignored.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Interactive and one-shot prompts
Summarize a file from the command line
Run Copilot non-interactively with a prompt.
Explain a source file
Ask Copilot to explain a code file directly from the terminal.
Ask a CLI how-to question
Get a concise terminal answer about a shell task.
Summarize recent commits
Use Git context from the repo in a direct prompt.
Inject a file into the prompt context
Reference a file inline inside the interactive UI.