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.

AI CLI·25 commands·Last updated 2026-08-21

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 alias
Emit a shell alias config snippet
gh copilot alias --help
Show alias subcommand help
gh copilot config
View/change Copilot CLI config
gh copilot config set <k> <v>
Set a config value
gh extension list | grep copilot
Confirm the copilot extension is installed

Integration & Debug 5

@copilot
Mention Copilot in GitHub issues/PRs
gh copilot suggest --help
Show all suggest options
gh auth status
Confirm gh is signed in (prereq for Copilot)
gh extension install github/gh-copilot
Install the copilot extension if missing
gh copilot explain "$(history 1)"
Explain the command you just typed

Tips 5

Explain after suggest
suggest then explain for double-checking
Set -t explicitly
shell/gh/git stated explicitly is more accurate
Alias to save typing
source the snippet from gh copilot alias
Explain dangerous commands
Explain obscure commands before running
Pair with gh workflows
Chain 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