copilot -p "Summarize what this file does: ./README.md"The `-p` flag lets you run one prompt and exit without opening the full interface.
Commands and prompt patterns for interactive use, one-shot prompts, file-aware context, and common terminal Copilot workflows.
Use Copilot as a terminal chat or as a single-command assistant.
copilot -p "Summarize what this file does: ./README.md"The `-p` flag lets you run one prompt and exit without opening the full interface.
copilot -p "Explain this file: ./complex.ts"A strong workflow for quick code comprehension.
echo "Explain this file: ./complex.ts" | copilotUseful in scripts or shell pipelines. If you also pass `-p`, the piped input is ignored.
copilot -p "In Git, how can I apply a commit from another branch"This is a high-traffic style query for a cheatsheet audience.
copilot -p "Plan a safe refactor of this module and list the files you would inspect first."Works well before delegating edits in a larger repository.
copilot -p "Summarize the intent of the last 10 commits in this repository."Helpful for release notes, standups, and onboarding.
Use file injection and local shell escapes to work faster in interactive mode.
@ README.mdType `@` followed by a file name to include that file's contents in the current prompt context.
Execute a local shell command directly from the session.
! git statusUseful for checking repo state while staying inside the interactive workflow.
Ctrl+GGreat for long prompts, multi-step instructions, or reusable templates.
Ctrl+LHandy when a session has accumulated a lot of scrollback.
EscA fast way to back out when Copilot starts the wrong action.
Ctrl+DUse twice-pressed `Ctrl+C` or `Ctrl+D` depending on the situation and shell.
Practical prompt patterns for code understanding, debugging, and repo work.
copilot -p "A test is failing after the last merge. Inspect the codebase, identify the likely cause, and propose the smallest safe fix."A practical starting point for debugging flows.
copilot -p "Add a health check endpoint to this app and explain which files need to change."Useful before moving into a longer interactive session.
copilot -p "Document the public API and side effects of this module in concise Markdown."Strong for maintainability and SEO-oriented docs generation.
copilot -p "Review the changes in this working tree and flag risky edits or missing tests."Good before committing or opening a pull request.
copilot -p "Give me a quick onboarding guide to this repository: main entry points, architecture, setup commands, and important directories."A high-value workflow for new team members.