GitHub Copilot Cheat Sheet: CLI & Slash Commands, Variables, and Shortcuts

GitHub Copilot CLI commands, interactive shortcuts, variables, permission controls, customization files, automation flags, and needed VS Code references in one cheat sheet.

GitHub Copilot CLI is a coding agent that runs in your terminal. It can inspect and edit files, run commands, manage sessions, delegate tasks, and connect to GitHub and VS Code.

You can use this cheat sheet to find its commands, shortcuts, flags, environment variables, permission controls, and customization options. The VS Code companion section lists Chat commands, context variables, participants, and inline suggestion shortcuts.

Enter /help inside Copilot CLI to open the installed command list. In VS Code Chat, type /, #, or @ to open live lists filtered by extension version, chat context, and organization policy.

Last updated: September 13, 2026.

GitHub Copilot Cheat Sheet

GitHub Copilot CLI Quick Reference

The ! prefix executes one command directly. Enter ! alone to stay in shell mode for several commands, then press Esc or Ctrl+C on an empty prompt to return. A lone $ hands the terminal to $SHELL on Unix or %COMSPEC% on Windows. Exit that shell to restore Copilot CLI.

SyntaxAction
copilotStart an interactive Copilot CLI session.
/commandRun an interactive Copilot command.
@ pathAttach a file to the current prompt.
# numberAttach a GitHub issue or pull request.
! commandRun a local shell command outside the agent tool flow.
$Suspend Copilot CLI and open a real interactive shell.
--flagSet startup or programmatic behavior.
COPILOT_*Configure the process through environment variables.

Start here

TaskCommand or shortcut
Start an interactive sessioncopilot
Sign incopilot login or /login
Initialize repository instructionscopilot init or /init
Open command helpcopilot help or /help
Open the Copilot appcopilot app or /app
Resume the latest sessioncopilot --continue
Choose a saved sessioncopilot --resume or /resume
Switch Standard, Plan, and AutopilotShift+Tab
Start with a selected modecopilot --mode=MODE
Select a modelcopilot --model=MODEL or /model
Review current changes/diff (experimental)
Undo the previous turn/undo
Connect to VS Code/ide
End the session/exit, /quit, or Ctrl+D

Install and authenticate Copilot CLI

Install Copilot CLI with npm, WinGet, Homebrew, the shell installer, or a standalone binary. npm installation requires Node.js 22 or later. Windows installation requires PowerShell 6 or later. Copilot CLI is also included in the default Codespaces image and available as a Dev Container Feature.

Run copilot version after installation. Run copilot update to install an available release. copilot completion bash, copilot completion zsh, and copilot completion fish print shell-completion scripts for those shells.

npm install -g @github/copilot
winget install GitHub.Copilot
brew install --cask copilot-cli
curl -fsSL https://gh.io/copilot-install | bash

Top-level commands

CommandPurpose
copilotStart an interactive Copilot CLI session.
copilot appOpen the GitHub Copilot app in the current directory or open its download page.
copilot completion SHELLPrint tab-completion setup for Bash, Zsh, or Fish.
copilot help [TOPIC]Read help for commands, configuration, billing, providers, logging, permissions, monitoring, or sandboxing.
copilot initCreate or update repository custom instructions.
copilot login [OPTION]Authenticate through OAuth, a device-code flow, or a token from standard input.
copilot mcpManage MCP server configurations from the command line.
copilot pluginManage plugins and plugin marketplaces. copilot plugins is a legacy alias.
copilot instructionList custom instruction sources discovered for the current working directory.
copilot lspList configured language servers outside an interactive session.
copilot skillList, add, remove, enable, or disable agent skills.
copilot updateInstall the latest CLI version.
copilot versionPrint the installed version and check for updates.

Authentication

On a local terminal, copilot login starts a browser flow. Remote terminals and CI environments use the device-code flow by default. Use --web-flow or --device-code to choose explicitly. Use --with-token to read a token from standard input. Add --host https://HOSTNAME for a GitHub Enterprise Cloud account with data residency.

Copilot checks GitHub credentials in this order:

  1. COPILOT_GITHUB_TOKEN
  2. GH_TOKEN
  3. GITHUB_TOKEN
  4. OAuth token in the operating-system credential store
  5. GitHub CLI authentication fallback

Copilot CLI slash commands

Conversation, context, and navigation

CommandAction
/ask QUESTION, /btw QUESTIONAsk a side question that stays out of the conversation history.
/clear [PROMPT], /new [PROMPT], /reset [PROMPT]Start a fresh conversation, with an optional first prompt.
/compact [FOCUS]Summarize history and preserve the requested focus.
/contextDisplay context-window usage.
/copyCopy the latest response.
/cwd, /cd [PATH]Show or change the working directory.
/diagnose [PROMPT]Analyze the current session log for errors or unexpected behavior.
/refine TEXTRewrite rough prompt text for review before submission.
/restartRestart the CLI and restore the live sessions in the current process.
/search [QUERY], /find [QUERY]Search the session timeline.
/helpDisplay the installed interactive command list.

Sessions, history, and sharing

CommandAction
/resume [ID], /continue [ID]Open another local or remote session.
/rename [NAME]Name the current session.
/session infoShow identifiers, links, and session details.
/session checkpoints [N]List recent restoration points.
/session filesList files associated with the session.
/session planDisplay the current session plan.
/session cleanupClean session data through the built-in manager.
/session prunePrune stored sessions.
/session delete [ID]Delete one saved session.
/session delete-allDelete all saved sessions after confirmation.
/fork [NAME], /branch [NAME]Fork the conversation into another session. Experimental.
/share, /exportCreate a link or export the session.
/share file [PATH]Export the transcript as Markdown.
/share html [PATH]Export the transcript as HTML.
/share gistCreate a GitHub gist from the session.
/share offStop link sharing.

Models, reasoning, plans, and autonomy

CommandAction
/model [MODEL], /modelsSelect Auto or a model for the current session.
/model --session MODELSet the model for the current session only.
/model --global MODELSave the default for future sessions.
/model --repo MODELSave a repository model setting.
/model --local MODELSave an untracked local repository model setting.
/plan [PROMPT]Create an implementation plan before coding.
/autopilot [OBJECTIVE], /goal [OBJECTIVE]Start or refocus an Autopilot objective.
/limitsOpen response-limit controls.
/limits set max-ai-credits VALUESet a soft AI Credits limit per response.
/limits unset max-ai-creditsRemove the response credit limit.
/rubber-duck [PROMPT]Request a second opinion on a plan, implementation, or test set.

Agents, research, review, and delegation

CommandAction
/agentBrowse and choose a custom agent.
/agents, /subagentsConfigure subagent models.
/tasksInspect background subagents and shell commands.
/fleet [PROMPT]Split suitable work across parallel subagents.
/delegate [PROMPT]Send work to a remote repository and create an AI-generated pull request.
/research TOPICRun a source-backed GitHub and web investigation.
/review [PROMPT]Invoke the code-review agent on current changes.
/security-review [PROMPT]Inspect active local changes for high-confidence security defects.
/pr viewShow the pull request for the current branch.
/pr createCreate a pull request.
/pr fixRepair pull request issues.
/pr autoWork until the pull request reaches green status.
/pr automergeWork until green status, then merge under repository controls.

Compare terminal agents: Claude Code Commands Cheat Sheet

Files, directories, and worktrees

CommandAction
/add-dir PATHGrant file access to another directory.
/list-dirsDisplay directories approved for file access.
/reset-allowed-toolsClear the saved allowed-tool list.
/permissions [default|assisted|allow-all|show]Change or inspect the current permission mode.
/allow-all [off|auto|show], /yolo [off|auto|show]Control the allow-all permission mode.
/permissions resetClear in-memory tool and path approvals for this session.
/diffReview working-tree changes or the branch diff. Experimental.
/worktree [BRANCH]Start work in a new Git worktree. Experimental.
/worktree new [PROMPT]Open a new conversation in a new worktree. Experimental.
/move [BRANCH|TASK]Move uncommitted changes to a new worktree. Experimental.

Configuration, extensions, and terminal controls

CommandAction
/settings, /configOpen the settings manager.
/settings show KEYDisplay the effective value of a setting.
/settings KEY VALUESave a user setting.
/settings --repo KEY VALUESave an overridable repository setting.
/settings --local KEY VALUESave an untracked local repository setting.
/instructionsView and toggle loaded custom instruction files.
/envList loaded instructions, agents, skills, hooks, plugins, MCP servers, LSPs, and extensions.
/pluginOpen the plugin dashboard. Use /mcp for MCP servers and /skills for skills.
/extensions, /extensionManage CLI extensions. Experimental.
/lsp showShow language-server configuration.
/lsp test SERVERTest a language server.
/lsp reloadReload language-server configuration.
/statusline, /footerConfigure status-line fields.
/terminal-setupConfigure multiline terminal input.
/theme [NAME]Select a terminal color theme.
/vimToggle Vim-style editing in the input composer.
/voice [ACTION]Configure voice input with on, off, models, or devices.
/appOpen the current session in the GitHub Copilot app or show its download page.

Maintenance, diagnostics, and account commands

CommandAction
/changelog, /release-notesDisplay release history, with optional version range or summary.
/chronicle standupGenerate a standup from session history.
/chronicle tipsFind usage tips from past sessions.
/chronicle improveAnalyze session habits.
/chronicle reindexRebuild the session-history index.
/experimental [ACTION]Manage experimental features with on, off, or show.
/feedback, /bugSend product feedback.
/usageShow per-session and per-model usage.
/versionDisplay the installed version.
/update, /upgradeInstall the latest release.
/downgrade VERSIONInstall a selected version on supported team accounts.
/user showShow the active GitHub account.
/user listList saved accounts.
/user switchChange the active account.
/logoutRemove the active login.
/clikit [COMPONENT], /tuikit [COMPONENT]Preview internal CLI components.

Remote control and scheduled work

CommandAction
/remoteShow remote-control status.
/remote onEnable steering from GitHub.com or GitHub Mobile.
/remote offEnd the remote connection.
/ideConnect, switch, or disconnect a trusted VS Code workspace.
/keep-alive on, /caffeinate onPrevent sleep during an active session.
/keep-alive busy, /caffeinate busyPrevent sleep during agent work.
/keep-alive DURATION, /caffeinate DURATIONPrevent sleep for a fixed period.
/after DELAY PROMPTSchedule one action in the current session. Experimental.
/every INTERVAL PROMPTSchedule a recurring action in the current session. Experimental.

Copilot CLI keyboard shortcuts

Global and input shortcuts

ShortcutAction
? on an empty promptOpen quick help.
EscCancel the current operation; press twice to stop the running turn.
Ctrl+CCancel, clear input, or exit after a second press.
Ctrl+DShut down the CLI.
Ctrl+GEdit the prompt in the configured external editor.
Ctrl+LClear the screen.
Ctrl+Q or Ctrl+EnterQueue input during agent work.
Ctrl+RSearch input history in reverse.
Ctrl+SpaceToggle voice dictation where the terminal and OS pass the shortcut through.
Ctrl+VPaste clipboard content as an attachment.
Alt+VPaste a clipboard image as an attachment.
Ctrl+X, then /Run a slash command and keep the typed prompt text.
Ctrl+X, then eOpen typed prompt text in the external editor.
Ctrl+X, then bMove the active task or shell command to the background.
Ctrl+X, then gCollapse or expand the Autopilot goal panel.
Ctrl+X, then hHide the current-session sidebar.
Ctrl+X, then oOpen the newest link in the timeline.
Ctrl+X, then vToggle voice dictation.
Ctrl+X, then xClose the current session.
Ctrl+Z on UnixSuspend the process to the background.
Shift+EnterInsert a newline where the terminal supports it.
Alt+Enter on Windows/LinuxInsert a newline.
Option+Enter on macOSInsert a newline.
Shift+TabCycle Standard, Plan, and Autopilot.
Tab or Ctrl+YAccept the current inline input completion.

Timeline, tasks, sessions, and diff shortcuts

ContextMain keys
TimelineCtrl+F search, Ctrl+O expand recent items, Ctrl+E expand all, Ctrl+T toggle reasoning, Page Up and Page Down scroll.
Tasks dialogArrow keys select, Enter opens details, a toggles nested agents, f shows finished work, X stops an active task, R removes a finished task, B backgrounds a synchronous task.
Session pickerArrow keys select, Enter opens, s changes sort, Tab switches local and remote, x deletes, Esc closes.
Sessions sidebar←/→ move between timeline and sidebar, arrow keys or j/k select sessions, Enter switches, n starts a session, x twice closes a session.
Diff viewerj and k move by line, h and l change file, g and G jump to ends, c comments, s summarizes comments, b toggles branch diff, w hides whitespace changes.

Modes, permissions, and safety

Standard, Plan, and Autopilot

ModeBehavior
StandardThe agent works interactively and follows the active permission policy.
PlanThe agent inspects the repository, resolves requirements, and prepares a plan before file edits.
AutopilotThe agent continues through tool calls and follow-up turns until completion or a configured limit.

Permission modes and patterns

Permission patterns use Kind(argument). The :* suffix in shell(git:*) matches the command stem followed by a space. Path checks resolve symlinks and ./.. segments before matching.

FlagEffect
--allow-tool=PATTERNAuto-approve a matching tool.
--deny-tool=PATTERNBlock a matching tool. Deny rules win over allow rules.
--allow-url=URLApprove a URL or domain.
--deny-url=URLBlock a URL or domain.
--add-dir=PATHAdd a readable or writable directory.
--allow-all-toolsApprove every tool.
--allow-all-pathsRemove path verification.
--allow-all-urlsApprove every URL.
--allow-allApply all three elevated settings.
--available-tools=LISTExpose only selected tools to the model.
--no-ask-userRemove the agent’s ability to pause for a question.
copilot --allow-tool='shell(git:*)' --deny-tool='shell(git push)'
copilot --allow-tool='github(create_issue)'
copilot --deny-tool='write(secret.txt)'

Sandbox and change review

/sandbox status displays OS-level shell sandbox status. /sandbox policy prints effective filesystem and network rules. /sandbox enable and /sandbox disable change the active setting. Startup flags --sandbox and --no-sandbox apply to one session and require experimental mode.

Use /diff before accepting a large set of changes. Add line comments inside the diff viewer and submit them together. Use /undo immediately after a bad turn. Keep Git commits as durable checkpoints for work that spans several turns or external tools.

Command-line flags for sessions and automation

Session and terminal flags

FlagPurpose
-C DIRECTORYChange directory before startup.
-i PROMPT, --interactive=PROMPTStart an interactive session and run the first prompt.
-n NAME, --name=NAMEName a new session.
--continueResume the newest session for the current directory, with global fallback.
-r, --resume[=VALUE]Open the session picker or resume by ID, prefix, or exact name.
--connect[=ID]Connect to a remote session.
--remoteEnable remote steering.
--remote-exportExport the session for read-only remote viewing.
--attachment PATHAttach a file to the initial prompt.
--model=MODELSelect a model or auto.
--reasoning-effort=LEVELSet low, medium, high, xhigh, or max where available.
--context=default|long_contextChoose a context tier for models with tiered context windows.
--screen-readerEnable screen-reader adjustments.
--no-colorRemove terminal color output.
--mouse=on|offChoose CLI mouse capture or native terminal selection.
--stream=on|offEnable or disable progressive response streaming.

Agent, tool, MCP, and Autopilot flags

FlagPurpose
--agent=AGENTStart with a selected custom agent.
--autopilotEnable Autopilot continuation.
--mode=interactive|plan|autopilotChoose the initial agent mode.
--max-ai-credits=CREDITSSet a soft AI Credits limit for each response.
--max-autopilot-continues=COUNTLimit Autopilot continuation messages.
--available-tools=LISTExpose only selected tools to the model.
--excluded-tools=LISTHide selected tools from the model.
--disable-builtin-mcpsDisable built-in MCP servers for the session.
--disable-mcp-server=NAMEDisable a selected MCP server for the session.
--enable-mcp-server=NAMERe-enable a server disabled in saved settings for the session.
--enable-memoryEnable memory in prompt mode.
--plugin-dir=DIRECTORYLoad a plugin from a local directory for the session.
--sandbox, --no-sandboxEnable or disable OS-level sandboxing for the current session when policy permits it. Experimental.

Programmatic mode

-p runs one prompt and exits. -s prints only the agent response. --output-format=json emits JSON Lines for automation. The process waits for background agents and shell commands before exit, subject to COPILOT_TASK_WAIT_TIMEOUT_SECONDS.

Use --secret-env-vars=NAME for extra secrets that need output redaction. GitHub token values receive default redaction. --share=PATH saves a Markdown transcript after a programmatic run, and --share-gist publishes a secret gist. Session transcripts can contain source code, prompts, paths, and tool output. Inspect them before sharing.

Repository-controlled hooks, extensions, and workspace MCP servers stay disabled in prompt mode unless the folder is trusted or the matching opt-in environment variable is set. This protects unattended jobs from executable configuration committed by an untrusted repository.

copilot -sp "Summarize the request flow and list the main entry points"
copilot -p "Fix the failing unit tests and report changed files" \
  --allow-tool='read,write,shell(npm test)' \
  --output-format=json
copilot -C ./services/api --plan -i "Plan the authentication migration"

Copilot CLI environment variables

Authentication, directories, and runtime

VariablePurpose
COPILOT_GITHUB_TOKENHighest-priority GitHub authentication token.
GH_TOKENSecond-priority token.
GITHUB_TOKENThird-priority token.
GH_HOSTGitHub hostname shared with GitHub CLI.
COPILOT_GH_HOSTCopilot-only hostname override.
COPILOT_HOMEConfiguration and state directory; default is $HOME/.copilot.
COPILOT_CACHE_HOMECache location for updates and marketplace data.
COPILOT_EDITORPrompt editor checked after VISUAL and EDITOR.
COPILOT_AUTO_UPDATESet false to disable automatic CLI and first-party plugin updates.
COPILOT_ENABLE_HTTP2Set 1 or true to use HTTP/2 transport.
COPILOT_ENABLE_INTERRUPTED_SESSION_RESTORESet 1 to enable the temporary opt-in interrupted-session restore flow.
COPILOT_ALLOW_ALLSet true to allow all permissions.
COPILOT_MODELSelect the model for the process.
COPILOT_PLAN_THEN_AUTOPILOTRequest plan-then-Autopilot when command-line options cannot be injected.

Context, skills, plugins, and unattended work

VariablePurpose
COPILOT_CUSTOM_INSTRUCTIONS_DIRSAdd comma-separated instruction directories.
COPILOT_SKILLS_DIRSAdd comma-separated skill directories.
COPILOT_PROVIDERS_CONFIGPoint to a BYOK provider/model registry; default is <COPILOT_HOME>/providers.json.
PLUGINS_DASHBOARDSet false to disable the dashboard used by bare /plugin, /mcp, and /skills.
COPILOT_LARGE_OUTPUT_THRESHOLD_BYTESSet the direct tool-output threshold; default is 20 KiB.
COPILOT_MCP_TOOL_CACHESet false to disable local MCP tool snapshot caching.
COPILOT_PROMPT_FRAMESet 1 or 0 to override the decorative prompt frame.
COPILOT_STRIP_REASONING_ON_RESUMESet 0 or false to retain BYOK reasoning tokens across resume.
COPILOT_SUBAGENT_MAX_CONCURRENTSet the process-level concurrent subagent limit within account constraints.
COPILOT_SUBAGENT_MAX_DEPTHSet the process-level maximum subagent nesting depth.
COPILOT_TASK_WAIT_TIMEOUT_SECONDSSet how long prompt mode waits for background work.
COPILOT_WEB_FETCH_ALLOW_LOCALHOSTSet 1 to let web_fetch reach a local development server.
GITHUB_COPILOT_PROMPT_MODE_EXTENSIONSSet true to load project extensions in prompt mode.
GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKSSet true to load repository hooks in prompt mode.
GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCPSet true to load workspace MCP servers in prompt mode.
PLAIN_DIFFSet true to disable rich diff rendering.
USE_BUILTIN_RIPGREPSet false to use the system rg executable.

BYOK and offline variables

Copilot CLI can use OpenAI-compatible endpoints, Azure OpenAI, and Anthropic through BYOK. Models must provide streaming and tool calling. The CLI can also use local OpenAI-compatible services such as Ollama.

For reusable multi-provider configuration, use ~/.copilot/providers.json or point COPILOT_PROVIDERS_CONFIG to another registry file. The older COPILOT_PROVIDER_* variables continue to work. A provider registry takes precedence when it defines providers or models.

VariablePurpose
COPILOT_PROVIDERS_CONFIGSet the BYOK provider/model registry file.
COPILOT_PROVIDER_BASE_URLLegacy provider API endpoint.
COPILOT_PROVIDER_TYPELegacy provider type: openai, azure, or anthropic.
COPILOT_PROVIDER_API_KEYLegacy provider credential when the endpoint requires one.
COPILOT_MODELProvider model or Azure deployment identifier.
COPILOT_OFFLINESet true to stop GitHub network requests and disable telemetry. Provider traffic continues if the BYOK endpoint is remote.

Logging and OpenTelemetry

Use --log-level=none|error|warning|info|debug|all|default and --log-dir=PATH for local logs. OpenTelemetry is disabled until an enabling variable is present.

VariablePurpose
COPILOT_OTEL_ENABLEDSet true to enable OpenTelemetry.
OTEL_EXPORTER_OTLP_ENDPOINTSet the OTLP collector endpoint and enable telemetry export.
COPILOT_OTEL_EXPORTER_TYPESelect otlp-http or file.
COPILOT_OTEL_FILE_EXPORTER_PATHWrite telemetry signals to a file.
OTEL_EXPORTER_OTLP_PROTOCOLSelect http/json or http/protobuf.
OTEL_SERVICE_NAMEOverride the default github-copilot service name.
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTSet true to record prompts, responses, and tool data.

Custom instructions, agents, skills, plugins, hooks, and MCP

FeatureBest use
Custom instructionsPersistent repository or personal rules loaded automatically.
Prompt filesReusable IDE prompt templates invoked manually.
Custom agentsSpecialist agents with their own instructions, tools, and model settings.
Agent skillsTask-specific procedures and resources loaded on demand.
PluginsInstallable bundles of agents, skills, hooks, MCP servers, and extensions.
HooksDeterministic commands at agent lifecycle events.
MCP serversExternal tools, services, APIs, and live data.

Custom instructions

Instruction files can import another file with a line that starts with @path. Use /instructions to inspect and toggle loaded sources. Use /env to confirm the effective customization set. --no-custom-instructions disables these files for the session.

copilot init and /init analyze the repository and create or improve .github/copilot-instructions.md. Good repository instructions record build, test, and lint commands, architecture boundaries, generated files, coding conventions, and release constraints.

Copilot CLI merges instructions found in these locations:

  • .github/copilot-instructions.md
  • .github/instructions/**/*.instructions.md
  • AGENTS.md, CLAUDE.md, and GEMINI.md in the Git root and working directory
  • $HOME/.copilot/copilot-instructions.md
  • $HOME/.copilot/instructions/**/*.instructions.md
  • Extra directories in COPILOT_CUSTOM_INSTRUCTIONS_DIRS

Prompt files

Prompt files live in .github/prompts/*.prompt.md and are invoked from supported IDEs. They package a repeatable prompt with variables and context for a focused action, such as test generation or an API review. Prompt files are unavailable as a native Copilot CLI customization type. Use a skill or a command file for a reusable CLI action.

Custom agents

Project agents live in .github/agents/ or .claude/agents/. Personal agents live in ~/.copilot/agents/. The file name becomes the agent ID. The required description tells Copilot when to use it; optional fields set name, model, tools, inference behavior, and MCP servers.

Select an agent with /agent or start directly with copilot --agent=test-reviewer. A read-only agent should omit write and shell tools. Built-in agents handle exploration, command execution, code review, research, security review, and general delegated work.

---
name: test-reviewer
description: Reviews unit tests for missing cases and brittle assertions
tools:
  - view
  - grep
---
Review tests only. Report findings with file paths and line numbers. Do not edit files.

Agent skills and commands

A skill is a directory with SKILL.md. Project skills can live under .github/skills/, .claude/skills/, or .agents/skills/. Personal skills can live under ~/.copilot/skills/ or ~/.agents/skills/. A valid skill declares name and description in YAML frontmatter.

Copilot selects a relevant skill automatically, or you can invoke /release-check. Use /skills list, /skills info NAME, /skills add, /skills remove, and /skills reload for management. Individual Markdown commands under .claude/commands/ provide a lighter alternative. A command has lower precedence when a skill uses that command name.

---
name: release-check
description: Checks version, changelog, tests, and package contents before release
---
Read the project release policy. Run the documented checks and report every failure.

Read More: Most Popular Agent Skills on GitHub for Coding Agents

Plugins

Open the plugin dashboard with /plugin. Use /plugin install SOURCE, /plugin update NAME, /plugin uninstall NAME, and /plugin list for plugin lifecycle management. Marketplace subcommands add, remove, list, browse, and refresh registries.

Outside an interactive session, use copilot plugin list --json for a machine-readable plugin inventory. Use copilot skill, copilot mcp, copilot instruction, and copilot lsp for those resource types. The old /plugins command has been removed.

Review a plugin before installation. A plugin can include hooks, MCP servers, agents, skills, commands, rules, and language-server configuration.

Hooks

Hooks live in .github/hooks/*.json. They run deterministic shell commands at defined lifecycle events. Suitable jobs include formatting edited files, checking commands before execution, enforcing path rules, or scanning output for secrets. Review repository hooks before trusting the checkout because they execute code.

MCP servers

Persistent personal MCP configuration lives at ~/.copilot/mcp-config.json. Repository and workspace servers can come from .github/mcp.json or .mcp.json. One-session configuration uses --additional-mcp-config=JSON or --additional-mcp-config=@FILE.

Use /mcp list, /mcp show NAME, /mcp add, /mcp edit, /mcp delete, /mcp disable, /mcp enable, /mcp auth NAME, /mcp reload, and /mcp search during a session. Every MCP tool call requires permission. Remote servers receive the lowest trust level and always require review. When server names collide, session configuration wins, followed by plugin, workspace, and personal configuration.

copilot mcp add local-tools -- npx -y @example/mcp-server
copilot mcp add --transport http team-api https://example.com/mcp
copilot mcp list --json

Related reference: OpenAI Codex Commands Cheat Sheet (2026)

GitHub Copilot app slash commands

The GitHub Copilot app has its own slash-command set. Type / in the app to see the commands available for the current session and repository context.

CommandAction
/afFind installable MCP servers, skills, agents, and other extensions with Agent Finder.
/agentSelect a custom agent for the session.
/allow-all-tools, /yoloTurn tool auto-approval on or show its current state.
/attach-filesAttach files through a file picker.
/attach-folderAttach a folder through a folder picker.
/autopilot [PROMPT]Switch to Autopilot mode and optionally run a prompt.
/chronicleOpen session-history and analysis features.
/chronicle cost-tipsShow suggestions for reducing token use and cost.
/chronicle improveSuggest improvements for the instructions file.
/chronicle reindexRebuild the Chronicle session index.
/chronicle searchSearch session history by keyword or topic.
/chronicle standupSummarize work from the previous day.
/chronicle tipsShow personalized workflow tips.
/clear, /resetClear the current transcript and open a fresh session.
/collect-debug-logsCreate a debug archive or upload one as a secret gist.
/compactSummarize earlier conversation history to reduce context use.
/contextShow context usage for the current session.
/create-canvas [PROMPT]Run the built-in canvas-authoring skill.
/debugCopy session debug JSON to the clipboard.
/export-gistExport the transcript to a secret gist.
/fleet [PROMPT]Launch multiple agents in parallel for one task.
/forkFork the current session at its latest turn.
/inboxOpen the interactive inbox widget.
/initGenerate or improve repository instructions.
/interactive [PROMPT]Switch to Interactive mode and optionally run a prompt.
/merge-to-parentMerge work from a forked session back into its parent.
/model, /models [MODEL]Open model selection or select a model.
/orchestrate [PROMPT]Coordinate work across sessions or repositories.
/plan [PROMPT]Switch to Plan mode and optionally run a prompt.
/pr-fix-checksWork on failing pull-request checks.
/pr-mergeMerge the current pull request when it is mergeable.
/pr-openOpen a pull request from the current session changes.
/pr-resolve-commentsWork on unresolved pull-request review comments.
/remoteEnable or manage remote control for the active session.
/renameRename the current chat or session.
/research [PROMPT]Run a research workflow and produce a cited report.
/reset-allowed-toolsClear session tool approvals and turn auto-approval off.
/restart-sessionRestart the active session and keep its history.
/reviewReview changes from the current session.
/rubber-duck [PROMPT]Request a second-model critique of the current approach or implementation.
/security-reviewRun a security review against the current changes.
/skillsManage agent skills.
/spar [PROMPT]Run an adversarial reasoning pass against the current approach.
/spawn [PROMPT]Create a focused child session for delegated work.
/terminal [COMMAND]Open a terminal panel and optionally run a command.
/usageOpen plan usage and rate-limit details.

Connect Copilot CLI to VS Code

Copilot CLI automatically connects when its working directory matches a trusted workspace open in VS Code. Run /ide to inspect the connection, switch workspaces, or disconnect.

The connection shares the active editor selection, diagnostics, workspace trust, and change-review view. Select code in VS Code, then enter Debug this in the CLI. Proposed edits can open as side-by-side VS Code diffs with accept and reject controls. Elevated edit permission applies changes directly and skips that approval diff.

VS Code’s Sessions view displays CLI transcripts for the current workspace. A saved CLI session can resume in the integrated terminal from that view.

VS Code Copilot Chat cheat sheet

Chat modes

ModeUse it for
AskQuestions, explanations, and code suggestions with no autonomous repository edits.
PlanDetailed implementation planning before code changes.
AgentMulti-step work that reads files, edits code, runs commands, and iterates.
EditDirect edits across selected files in client versions that expose this mode.

VS Code slash commands

CommandAction
/clearStart a new chat session.
/explainExplain code in the active editor.
/fixPropose a repair for selected code.
/fixTestFailureDiagnose and repair a failing test.
/helpDisplay Chat basics and available features.
/newCreate a new project.
/testsGenerate tests for selected code.

VS Code chat variables

VariableContext added
#blockCurrent code block.
#classCurrent class.
#commentCurrent comment.
#fileCurrent file or another file you specify.
#functionCurrent function or method.
#lineCurrent line.
#pathFile path.
#projectProject context.
#selectionSelected editor text.
#symCurrent symbol.

VS Code chat participants

ParticipantSpecialty
@githubGitHub repositories, issues, pull requests, and GitHub-specific Copilot capabilities.
@terminalTerminal commands and visible shell context.
@vscodeVS Code commands, settings, and editor features.
@azureAzure services and deployment context; this participant is in public preview.

Useful VS Code prompt patterns

/explain #selection
/fix #file:src/auth.ts Keep the public API unchanged and add a regression test.
#project Trace the request from the HTTP route to the database write. List files in execution order.
@terminal Explain the latest test failure and identify the first actionable error.
#file:src/cache.ts #file:test/cache.test.ts Add tests for expiration and concurrent reads.

VS Code inline suggestion shortcuts

ActionmacOSWindows and Linux
Accept suggestionTabTab
Dismiss suggestionEscEsc
Show next suggestionOption+]Alt+]
Show previous suggestionOption+[Alt+[
Trigger suggestionOption+\Alt+\
Open additional suggestionsCtrl+ReturnCtrl+Enter

Platform and customization matrix

Customization support differs across Copilot surfaces. Preview marks features that GitHub currently labels as preview on that surface.

FeatureAvailablePreview / unavailable
Custom instructionsVS Code, Visual Studio, GitHub.com, Copilot CLIPreview: JetBrains, Eclipse, Xcode
Prompt filesVS Code, Visual StudioPreview: JetBrains, Xcode. Unavailable: Eclipse, GitHub.com, Copilot CLI
Custom agentsVS Code, Visual Studio, GitHub.com, Copilot CLIPreview: JetBrains, Eclipse, Xcode
SubagentsVS Code, Copilot CLIPreview: JetBrains, Eclipse. Unavailable: Visual Studio, Xcode, GitHub.com
Agent skillsVS Code, Visual Studio, GitHub.com, Copilot CLIPreview: JetBrains. Unavailable: Eclipse, Xcode
HooksGitHub.com, Copilot CLIPreview: VS Code. Unavailable: Visual Studio, JetBrains, Eclipse, Xcode
MCP serversVS Code, Visual Studio, JetBrains, Eclipse, Xcode, GitHub.com, Copilot CLINone in the current matrix

Workflow Examples

Explore a repository before editing

Start in Standard or Plan mode. Attach relevant files with @ and confirm the working directory with /cwd. Request evidence paths and a concrete architecture summary.

Map the application entry points, request flow, persistence layer, and test layout. Read only. Return file paths and the commands used to verify your findings.

Plan a multi-file change

Review the plan for migration impact, failure behavior, and test scope before switching modes. Run /rubber-duck when the change has a risky assumption or several valid designs.

/plan Add idempotency to payment creation. Preserve the public API, reuse the existing database transaction helper, include rollback behavior, and name the tests that must pass.

Fix a failing test

Grant only the shell commands and paths required for the repair. Avoid global permission bypass for an unfamiliar repository.

Run the failing test in isolation. Find the first product-code defect, apply the smallest correction, rerun the focused test, then run the related test suite. Report commands and changed files.

Review a change set

Inspect /diff, add line comments, and run /security-review for security-sensitive code. Commit after the change passes its required tests.

/review Focus on correctness, security, data loss, concurrency, and missing regression tests. Ignore formatting unless it changes behavior.

Delegate independent work

Use parallel agents when repository areas can be investigated independently.

/fleet Inspect the API, database, and test layers independently. Return one combined implementation risk report. Do not edit files.

Troubleshooting

ProblemCheck
A documented command is missingRun /help, /version, and /update; check /experimental show and account policy. Use /diagnose for session-specific failures.
Login uses the wrong accountInspect /user show and token variables; an environment token overrides stored OAuth.
Classic PAT failsUse OAuth or a fine-grained PAT with Copilot Requests permission.
Agent mode is absentCheck organization policy, account access, extension version, and the active IDE mode picker.
Copilot cannot read a directoryRun /list-dirs, then /add-dir PATH after reviewing the target.
Permission prompts repeatInspect /permissions show; review exact tool, path, and URL patterns.
Context fills too quicklyRun /context, reduce attached files, then /compact with focus instructions.
Wrong files are being editedRun /cwd, inspect /env, and verify the Git root before continuing.
Model is unavailableOpen /model; availability depends on provider, plan, policy, and catalog.
MCP server fails to startRun /mcp list, /mcp show NAME, and /mcp reload; keep stdio logs on stderr.
Workspace MCP is absent under -pTrust the folder or opt in with GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP=true.
VS Code connection is absentOpen the matching trusted workspace, then run /ide.
Rich diff blocks text selectionStart with --mouse=off or set mouse support off in settings.
An autonomous run continues too longPress Esc twice and set a continuation or AI Credits limit before resuming.

FAQs

Does BYOK require a GitHub login?

No. GitHub authentication is optional when Copilot CLI uses an external or local model provider. /delegate, GitHub Code Search, and the built-in GitHub MCP server require a GitHub login. Use GitHub authentication when the session needs those hosted features.

Where does Copilot CLI store sign-in credentials?

OAuth credentials go to the operating-system credential store: Keychain Access on macOS, Credential Manager on Windows, or a supported secret service on Linux. If no credential store is available, Copilot can save the token in plain text at ~/.copilot/config.json, or under the directory set by COPILOT_HOME. Protect that file and avoid the plain-text fallback on shared systems.

Do commands entered with ! use Copilot permission rules?

No. The ! prefix runs a command directly in the local shell and bypasses the agent tool approval flow. The command receives the permissions of the user account running the terminal. Read it as carefully as any command copied from another source.

How can I keep a Copilot CLI session local?

Start the session with --no-remote, set the remote configuration value to off, or disable remote access through /remote off. This prevents session syncing and remote control. A model provider still receives prompts and context unless the session uses an approved local provider in offline mode.

Does /undo replace Git commits?

No. /undo restores conversation state and tracked file changes from a selected turn. Git commits record durable project history, support team review, and remain available after session data is removed. Commit tested milestones during long or high-risk changes.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!