Verified against GitHub Copilot CLI · 2026-06-15
Get a safe, explained shell command out of Copilot in the CLI, not a blind paste
A gh copilot suggest and explain pairing that forces the command, its plain-language explanation, and a pre-committed reject list before you run anything against a real environment.
The prompt
Ready to copy — highlighted parts are example details you can swap.
Run this through GitHub Copilot in the CLI as: gh copilot suggest -t shell "find all files larger than 50MB in this repo and list them by size" Before running whatever it returns, also run gh copilot explain on the exact command string it suggested, and require that explanation to be read against this context. CONTEXT Running locally on a laptop, inside a git repo with uncommitted changes I have not backed up yet. RISK TOLERANCE Read-only operations are fine. Anything that deletes, moves, or overwrites a file needs a narrower, explicitly scoped alternative. Do not run the suggested command if the explanation surfaces any of the following that you did not explicitly ask for: a recursive delete, a force push, a change to a permission or ownership bit, or a write outside the current directory. If the explanation flags one of those, ask Copilot to suggest a narrower alternative that matches the risk tolerance above before running anything.
Customize the highlighted detailsoptional — the prompt above already works
Why this works
gh copilot suggest generates a shell, git, or gh CLI command from a natural-language description, but it is a suggestion returned for you to run manually, not something Copilot executes on your behalf — the CLI extension is deliberately built with that manual confirmation step, because a wrong command against a real filesystem or a real git remote is not something you want auto-executed. Pairing it with gh copilot explain on the exact returned string, rather than trusting the one-line description in the suggest output, matters because suggest and explain are two separate calls to the model and can each catch something the other omitted — asking a second time, specifically what does this do, is a documented way to surface a side effect a first-pass generation glossed over. Naming a risk tolerance up front and pre-committing to a reject list, recursive delete, force push, permission changes, writes outside the working directory, turns read the explanation carefully into a checkable gate applied the same way every time, instead of relying on catching a dangerous flag by attentiveness alone in the moment right before you run it.
What you get back
gh copilot suggest returns: find . -type f -size +50M -exec ls -lh {} \; | sort -k5 -h. gh copilot explain confirms this is read-only — it lists matching files without modifying anything — so it clears the reject list and is safe to run as suggested.
Verified against
GitHub Copilot CLI gh-copilot extension 1.8 · 2026-06-15
Changelog
- 2026-06-15 — Initial publish, verified against the gh-copilot CLI extension 1.8.
Need this built into your business?
If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.
EXPLORE CUSTOM SOFTWARE

