GitHub Copilot CLI Cheatsheet - gh copilot Full Reference
All GitHub Copilot CLI (gh copilot) commands in one place — from explaining commands to generating suggestions, aliases, and config — organized by scenario. Copy and go.
Explain Commands 5
gh copilot explain "git rebase -i HEAD~3"Explain a command in plain language
gh copilot explain "kubectl get pods"Explain complex k8s commands
gh copilot explain "awk ..."Explain awk/sed scripts
gh copilot explain "docker compose up -d"Explain container orchestration
gh copilot explain ":(){:|:&};:"Explain dangerous/obscure commands before running
Generate Suggestions 5
gh copilot suggest -t shell "backup mysql to s3"Generate a shell command (-t shell)
gh copilot suggest -t gh "list my PRs"Generate a gh command (-t gh)
gh copilot suggest -t git "undo last commit keep changes"Generate a git command (-t git)
gh copilot suggest "monitor port 8080"Infer type from context by default
gh copilot suggest -t shell "batch rename files"Generate complex batch commands
Alias & Config 5
gh copilot aliasEmit a shell alias config snippet
gh copilot alias --helpShow alias subcommand help
gh copilot configView/change Copilot CLI config
gh copilot config set <k> <v>Set a config value
gh extension list | grep copilotConfirm the copilot extension is installed
Integration & Debug 5
@copilotMention Copilot in GitHub issues/PRs
gh copilot suggest --helpShow all suggest options
gh auth statusConfirm gh is signed in (prereq for Copilot)
gh extension install github/gh-copilotInstall the copilot extension if missing
gh copilot explain "$(history 1)"Explain the command you just typed
Tips 5
Explain after suggestsuggest then explain for double-checking
Set -t explicitlyshell/gh/git stated explicitly is more accurate
Alias to save typingsource the snippet from gh copilot alias
Explain dangerous commandsExplain obscure commands before running
Pair with gh workflowsChain with gh pr/issue for automation
Tips
- The GitHub Copilot CLI has the largest developer base (default in the gh ecosystem) but is "explain/suggest", not an autonomous agent — complementary to Claude Code-style tools.
- Always explain after suggest to verify generated commands, especially `-t shell` that delete/modify or hit the network — understand before running.
- Use `gh copilot alias` to emit aliases into your shell, shortening daily calls from `gh copilot suggest`.
- Prereqs: `gh auth login` signed in with an active Copilot subscription; install via `gh extension install github/gh-copilot` if missing.
Official References
Commands are compiled from the official docs below. Click to verify the latest usage.
Maintained by LaoHand
Publicly updated on Aug 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us