Skip to content

Copilot Cheatsheet

This is a reference page — "what is the key, the flag, the plan?" Concepts: Glossary. First run: Tutorial. Recipes: Cookbook.

Currency: Copilot ships weekly on the GitHub changelog and monthly with VS Code Stable. Every keybinding, command, and setting on this page was checked against the official lists. If it is not on the official list, it is not here. Evidence base: High-quality sources.

Term index

One line each; details in the Glossary:

TermOne-liner
GitHub CopilotGitHub's AI coding assistant; many doors, many models
Prompt / PE / ContextInput / how you shape the input / extra information attached
Four surfacesCompletion, Chat, CLI, Cloud agent
Ask / Edit / AgentThree autonomy levels inside Chat
Chat participant@ prefix; pins the question to a domain
Tools / tool sets# prefix; capabilities Chat can call
Custom instructionsAuto-injected project constraints
Prompt files.prompt.md; manually invoked reusable tasks
Agent SkillsDirectory with assets; specialized task pack
PluginsInstallable pack of agents / skills / hooks — not the sunset Extensions
MCPOpen protocol between AI hosts and external tools
Cloud agentRuns in GitHub's cloud; output is usually a PR
Copilot appDesktop shell for parallel agent sessions
Copilot SpacesNamed context pack (repos + files + notes)
Copilot CLITerminal Copilot agent
GitHub SparkMicro-app builder; closed to new users 2026-08-04
AI creditsUsage billing unit

Surface selection

Your taskSurfaceWhy
Next line, boilerplateCode completionZero cost, zero interrupt
"What does this code do?"Chat / AskAnswer only
"Refactor these two files"Chat / EditYou want the diff
"Install deps, run tests, multi-step rewrite"Chat / AgentNeeds commands and iteration
"How do I write this shell command?"Inline Chat (⌘I in the terminal) or CLIThe context is the terminal
"A 20-minute mechanical migration"Cloud agentDoes not occupy your machine; output is a PR
"Ask about this repo on github.com"Copilot Chat on GitHubRepo context is already there
"Run several agents in parallel, stay out of the IDE"Copilot appDesktop shell on top of Copilot CLI
"Build a micro-app from a prompt"Do not start GitHub SparkClosed to new users / new apps on 2026-08-04

Mode selection

AskEditAgent
Edits files?NoYes, only the ones you nameYes, it chooses
Runs commands?NoNoYes (you approve)
Your checkpointNoneAccept / discard each diffApprove tool calls + review the result
Signal to pick itI need to understand firstI know where, I do not want to typeI know the goal, not the process

Rule of thumb: can you tell at a glance that it is wrong? Yes → lean Agent. No → fall back to Edit or Ask.


Plan comparison

Source: Plans for GitHub Copilot and Choosing your enterprise plan

PlanPriceWhat matters
Copilot FreeFree2,000 code completions / month; models via auto-selection only
Copilot Pro$10 / monthIndividual; unlimited completions; Cloud agent; monthly AI credits
Copilot Pro+$39 / monthLarger credit allowance; broader model catalog
Copilot Max$100 / monthHighest individual credit allowance; priority access to new models
Copilot Business$19 / seat / month1,900 AI credits / user (pooled); org policies; Cloud agent
Copilot Enterprise$39 / seat / month3,900 AI credits / user (pooled); everything in Business + priority models/features + extra enterprise controls
Students / teachers / OSS maintainersFree after verificationEligibility required

Three facts you need:

  1. Paid plans include a pool of GitHub AI credits. Per-request "premium request" billing is marked legacy on the official plans page.
  2. Copilot is not available on GitHub Enterprise Server. Enterprise Copilot requires GitHub Enterprise Cloud. Owners can assign Enterprise or Business per organization.
  3. Official pages recorded two temporary new-signup pauses: 2026-04-20 (Pro / Pro+ / Max / Student) and 2026-04-22 (self-serve Business on GitHub Free / Team orgs). Check the live plans page before you treat those pauses as still in force.

Overage on org plans is billed at $0.01 per AI credit unless you set a budget.


Keybindings

Source: VS Code Copilot feature reference. macOS keys.

SceneKeyAction
CompletionTabAccept inline suggestion / jump to next edit suggestion
EscapeDismiss the current suggestion
Open Chat⌃⌘IOpen the Chat view
⌘IInline Chat (editor or terminal)
⇧⌥⌘LQuick Chat
Inside Chat⌘NNew Chat session
⇧⌘ISwitch the Chat view to an agent
⌥⌘.Model picker
Editor assistF2AI-assisted rename

Older site docs listed "Shift Tab accept line / ⌘→ accept word / ⌃Enter show all / ⌥] ⌥[ cycle suggestions." Those four are not on the current official key list and are omitted. Why: Glossary · Retired concepts.


Chat participants

Invoke with @. Same source as above.

ParticipantRoleExample
@githubGitHub context (repos, Issues, PRs)@github list recent open bug issues in this repo
@terminalIntegrated terminal shell and contents@terminal find the largest file in the src directory
@vscodeVS Code commands and features@vscode how do I change my colors
@vscode how can I change key bindings
@vscode tell me how to debug a node.js app

Extensions can contribute their own participants; they appear in the same @ list.

@workspace and @regex are not on the official list. See retired concepts.


Tool sets and file references

Cite with #. Citing a tool set allows the tools under it.

Tool setTools inside
#agent/runSubagent
#browserBrowser tools
#changesCurrent source-control changes as context
#edit/createDirectory, /createFile, /editFiles, /editNotebook
#execute/createAndRunTask, /getTerminalOutput, /runInTerminal, /runNotebookCell, /testFailure
#githubRepoSearch a named GitHub repo
#githubTextSearchGitHub text search
#newWorkspaceScaffold a new workspace
#read/getNotebookSummary, /problems, /readFile, /readNotebookCellOutput, /terminalLastCommand, /terminalSelection
#search/changes, /codebase, /fileSearch, /listDirectory, /textSearch, /usages
#selectionCurrent editor selection
#todosTodo list
#vscode/askQuestions, /extensions, /getProjectSetupInfo, /installExtension, /runCommand, /VSCodeAPI
#web/fetch

Files directly: #file:path, e.g. #file:gameReducer.js #file:gameInit.js how are these files related.

MCP tools appear in the same # list.


Slash commands (VS Code Chat)

CommandAction
/explainExplain the selection
/fixSuggest a fix for the selection
/docGenerate doc comments
/testsGenerate tests for the selection
/setupTestsHelp set up a test framework
/fixTestFailureSuggest fixes for failing tests
/newScaffold a project / file
/newNotebookNew Jupyter notebook
/initGenerate or update workspace Copilot config
/planProduce an implementation plan
/searchSearch the workspace
/debug, /startDebugging, /troubleshootDebug-related
/clearClear the session
/compactCompact session history
/forkFork the session
/agents, /hooks, /instructions, /prompts, /skillsManage those customizations
/create-agent, /create-hook, /create-instruction, /create-prompt, /create-skillCreate those customizations
/yolo (/autoApprove), /disableYolo (/disableAutoApprove)Toggle auto-approve
/<skill name>, /<prompt name>Run a skill or prompt file

/new-from, /runCommand as a top-level slash command, and /help are not on the current official list. See retired concepts.


Custom instructions

Source: Custom instructions support matrix

TypeLocationScope
👤 PersonalGitHub personal settingsAll of your projects
📦 Repository.github/copilot-instructions.mdEvery conversation in that repo
📂 Path-specific.github/instructions/**/*.instructions.mdFiles matching the frontmatter glob
🤖 AgentAGENTS.md (also CLAUDE.md, GEMINI.md)Cross-tool agent conventions
🏢 OrganizationOrg settingsEvery repo in the org

Copilot CLI personal instructions: ~/.copilot/copilot-instructions.md or ~/.copilot/instructions/**/*.instructions.md.

IDE support (GitHub.com / VS Code / Visual Studio / JetBrains / Eclipse / Xcode / Copilot CLI) is not uniform — use the official matrix.


Prompt files

ItemValue
Project location.github/prompts/*.prompt.md
User location.prompt.md in a VS Code profile; settings sync
Custom locationchat.promptFilesLocations
Invoke/<filename> in Chat, with args: /create-react-form: formName=MyForm

Frontmatter and a full example: Cookbook · Prompt files.


Common settings

Source: VS Code Copilot feature reference

KeyRole
chat.promptFilesLocationsExtra search paths for prompt files (including a Cursor-rules directory)
chat.tools.autoApproveAuto-approve tool calls
chat.tools.terminal.autoApproveAuto-approve terminal commands (per-command rules allowed)
chat.tools.global.autoApproveGlobal auto-approve
chat.tools.todos.showWidgetShow the todo widget
chat.math.enabledRender math in Chat
mermaid-chat.enabledRender Mermaid in Chat
github.copilot.chat.tools.memory.enabledEnable the Memory tool
github.copilot.chat.agentDebugLog.enabledAgent debug log
workbench.browser.enableChatToolsEnable browser tools
workbench.settings.showAISearchToggleAI search toggle in Settings
search.searchView.semanticSearchBehaviorSemantic search behavior in Search

Permission levels (Chat tool-approval policy): Default Approvals (ask each time) → Bypass ApprovalsAutopilot (preview, fully autonomous).


Copilot CLI

The standalone copilot agent (not gh copilot; difference in the Glossary). Sources: Install and CLI command reference. Generally available since 2026-02-25.

Install

bash
# npm (Node.js 22+)
npm install -g @github/copilot

# Homebrew
brew install --cask copilot-cli

# Windows
winget install GitHub.Copilot

# Install script (honors PREFIX, VERSION)
curl -fsSL https://gh.io/copilot-install | bash

Windows needs PowerShell v6+. If npm skipped install scripts, retry with npm_config_ignore_scripts=false.

Auth

MethodNotes
/loginInteractive (preferred)
copilot login [--host HOST] [--web-flow] [--device-code]CLI login
Env varsPrecedence COPILOT_GITHUB_TOKEN > GH_TOKEN > GITHUB_TOKEN

PATs must be fine-grained and include "Copilot Requests". Classic ghp_ PATs are not supported. Credentials go in the OS keychain; without one they are stored in the clear under ~/.copilot/ (COPILOT_HOME moves that directory).

Commands

CommandAction
copilotInteractive session
copilot initInit config in the current repo
copilot help [TOPIC]Help. TOPIC: billing, commands, config, environment, logging, monitoring, permissions, providers, sandbox
copilot completion SHELLShell completion (bash / zsh / fish)
copilot login / copilot logoutSign in / out
copilot mcpManage MCP servers
copilot skillManage Agent Skills
copilot pluginManage plugins
copilot plugins list [--kind mcp|skill|instruction|plugin|lsp] [--scope SCOPE] [--json]List installed plugins
copilot plugins enable|disable|remove [--plugin|--mcp|--skill]Enable / disable / remove
copilot updateUpgrade
copilot versionVersion

--config-dir=DIRECTORY is deprecated; use COPILOT_HOME.

In-session slash commands

CommandAction
/clear, /new, /resetNew session
/compactCompact context
/contextContext usage
/add-dirExtra readable directory
/cwd, /cdShow / change cwd
/model, /modelsShow / switch models
/mcpMCP servers
/pluginsPlugins
/agentSwitch custom agent
/delegateDelegate a subtask
/planPlan mode
/autopilot, /goalAutonomous mode (--max-ai-credits N)
/allow-all, /yoloAllow all operations
/permissions [default|assisted|allow-all|show], /permissions resetPermission modes
/sandboxSandbox settings
/diffShow the diff
/reviewCode review
/security-reviewSecurity review
/researchResearch mode
/pr [view|create|fix|auto|automerge]Pull requests
/limits (set max-ai-credits, unset)Credit caps
/session, /sessionsSession management
/resume, /continueResume last session
/settings, /configSettings

In-session keys

KeyAction
@ filenameCite a file
# numberCite a numbered item
! command / bare !Run a shell command / enter shell mode
?Quick help
Shift+TabCycle standard / plan / autopilot
Shift+Enter, Option+Enter, Alt+EnterNewline without send
Ctrl+Enter, Ctrl+QQueue
EscInterrupt
Ctrl+CCancel
Ctrl+DQuit
Ctrl+LClear screen
Ctrl+GJump
Ctrl+RHistory search
Ctrl+V, Alt+VPaste helpers
Ctrl+X then /, e, b, oExtended actions
Ctrl+ZSuspend
Ctrl+F, Ctrl+O, Ctrl+E, Ctrl+T, PageUp / PageDownTimeline

Retired gh copilot

Official notice: the Copilot extension for GitHub CLI is retired. Use standalone copilot instead. The commands below are from this site's old single file, kept only so readers can map old tutorials:

bash
# Explain a command (retired)
gh copilot explain "sudo apt-get"

# Suggest a command (retired)
gh copilot suggest "Undo the last commit"

# Old aliases (retired)
ghce "sudo apt-get"
ghcs "Undo the last commit"

Troubleshooting

SymptomLook here first
Weak answers, wrong topicRelevant files open? #file: used? Custom instructions written?
Did this suggestion match public code?Find matching public code
Generic failuresTroubleshoot common issues
Agent misbehaves; you want the tool tracegithub.copilot.chat.agentDebugLog.enabled
Debug a prompt filePlay button in the prompt-file editor
CLI will not installNode.js ≥ 22; Windows PowerShell ≥ 6; npm retry npm_config_ignore_scripts=false
CLI auth failsFine-grained PAT with Copilot Requests (classic ghp_ is rejected)

High-quality sources

Ranked by trust. Use this order when you write or fact-check:

SourceUseCadence
GitHub Copilot docsProduct facts, concepts, how-tosContinuous
Copilot featuresOfficial assistive vs agentic surface listIrregular
About cloud agentCloud agent vs IDE Agent modeIrregular
About Copilot CLITerminal agent capabilitiesWith CLI releases
About the Copilot appDesktop parallel-agent appIrregular
VS Code Copilot feature referenceKeys, slash commands, tool sets, settingsMonthly Stable
Copilot plansPrices, AI credits, availabilityIrregular
Copilot CLI command referenceCLI subcommands, flags, session keysWith CLI releases
Custom instructions supportPer-IDE support for the five instruction typesIrregular
GitHub Changelog · CopilotLaunches and sunsetsSeveral per week
VS Code Release NotesMonthly deltas; Copilot lives under ChatMonthly
GitHub Blog · AI & MLMechanism essays (retrieval, etc.)Irregular
GitHub Copilot video seriesOfficial videosIrregular

Evidence rule: Chinese docs.github.com is incomplete and lags. docs.github.com/zh/enterprise-cloud@latest/... is widely dead. Cite docs.github.com/en/copilot/....


Built for frontend engineers · Powered by VitePress