Use GitHub Copilot Features
This skill area accounts for 25–30% of the exam — the largest weighted section. It covers enabling Copilot in IDEs, all trigger modes (inline, chat, Plan Mode), the full CLI, and file exclusions. Master every detail here.
GitHub Copilot in the IDE
Supported IDEs
GitHub Copilot works across a wide range of editors. Feature availability may vary — VS Code typically receives new features first.
| IDE / Editor | Notes |
|---|---|
| Visual Studio Code | Broadest feature set; first to receive new features; supports model selection for inline suggestions |
| Visual Studio 2022 (17.8+) | Includes comment suggestions; uses #solution chat variable to reference entire solution |
| JetBrains IDEs | IntelliJ IDEA, PyCharm, Android Studio, CLion, GoLand, PhpStorm, Rider, RubyMine, WebStorm, and more |
| Neovim / Vim | Core inline suggestions; minimal UI |
| Eclipse | Core functionality |
| Azure Data Studio | SQL-focused workflows |
| Xcode | Requires disabling native predictive text; full suggestions via modifier keys, not Tab |
| GitHub.com / Mobile | Chat, PR summaries, code review; not a local IDE extension |
| Windows Terminal Canary | CLI integration |
Enabling Copilot in the IDE
Prerequisites
- An active GitHub Copilot subscription (Free, Pro, Pro+, Max, Business, or Enterprise)
- The GitHub Copilot extension installed from your IDE's marketplace
- Authentication with your GitHub account inside the extension
- For Business / Enterprise: organization admin must enable Copilot and assign a seat to the user
- For Free plan: limited access with 50 premium requests/month included
Enable / Disable Granularity (VS Code)
- Click the Copilot status icon in the bottom status bar → Enable or Disable
- When disabling, VS Code asks whether to disable globally or just for the current file's language
- Per-language control also available under Settings → Extensions → GitHub Copilot → Editor: Enable Auto Completions
- You can enable inline suggestions for some languages while disabling them for others (e.g., disable for Markdown, keep enabled for Python)
As of late 2024 GitHub offers a free tier of Copilot with limited features. Students, educators, and verified open-source maintainers may qualify for complimentary access to higher tiers. Always check the plans page for current eligibility.
Inline Suggestions & Keyboard Shortcuts
Inline suggestions appear as gray "ghost text" as you type. They are the most fundamental form of Copilot interaction.
Ghost Text Behavior
- Suggestions appear automatically after a brief pause while typing
- Triggered by: writing code, writing comments, starting a new function, or naming a variable
- Multiple candidate suggestions exist — you can cycle through them
- If you receive no or limited suggestions, duplication detection may be enabled — this is a common troubleshooting point
Keyboard Shortcuts Reference
| Action | macOS | Windows / Linux |
|---|---|---|
| Accept full suggestion | Tab | Tab |
| Dismiss suggestion | Esc | Esc |
| Next suggestion | Option+] | Alt+] |
| Previous suggestion | Option+[ | Alt+[ |
| Accept word-by-word | Command+→ | Control+→ |
| Open multiple suggestions panel | Cmd+Shift+A (VS Code) | Ctrl+Enter (VS Code / JetBrains) |
| Open inline chat | Command+I (VS Code) | Ctrl+I (VS Code) / Ctrl+Shift+I (JetBrains) |
| Open quick chat | Shift+Option+Command+L | Ctrl+Shift+Alt+L |
Note: Xcode handles full suggestion acceptance via modifier keys rather than Tab. Line-by-line acceptance requires custom shortcut configuration in most editors.
Memorise the cycling shortcuts (Alt+] / Alt+[) and the accept shortcut (Tab). Know that opening the multiple suggestions panel is done with Ctrl+Enter on Windows. The "word-by-word" accept shortcut (Control+→) is also frequently tested.
Copilot Chat: Commands, Participants & Variables
Copilot Chat provides a conversational interface accessible from the IDE side panel, inline within the editor, and on GitHub.com. Reference: Asking Copilot questions in your IDE.
Slash Commands (type / to see full list)
| Command | Purpose |
|---|---|
/explain | Explain selected code or a concept |
/fix | Suggest a fix for a bug or error in selected code |
/test (or /tests) | Generate unit tests for selected code |
/doc | Generate documentation/comments for selected code |
/optimize | Suggest performance improvements |
Chat Participants (type @ to invoke)
| Participant | Available in | Purpose |
|---|---|---|
@workspace | VS Code | Query across the entire workspace/project |
@vscode | VS Code | Ask about VS Code settings, commands, extensions |
@terminal | VS Code | Get help with terminal commands in the current shell context |
@github | GitHub.com, IDEs | Access GitHub-specific skills, web search, advanced capabilities |
Chat Variables (type # to invoke)
| Variable | Available in | Purpose |
|---|---|---|
#file | VS Code, JetBrains | Reference a specific file as context |
#web | VS Code, GitHub.com | Invoke a web search to include real-time information |
#solution | Visual Studio | Reference the entire solution/project as context |
Image Attachments
- Copilot Chat supports attaching images to prompts: JPEG, PNG, GIF, WEBP
- Useful for describing UI mockups, diagrams, or error screenshots
Model Selection
- Users can switch the AI model Copilot uses for chat responses
- Available models depend on the plan (see Capabilities & Policies page for plan details)
- VS Code also supports model selection for inline (ghost text) suggestions
Plan Mode
Plan Mode lets Copilot create a detailed implementation plan before executing any changes. This is distinct from Agent Mode (autonomous execution).
- Copilot analyses the task and produces a step-by-step plan
- The plan shows which files will be created, edited, or deleted
- You review and approve the plan before any code changes are made
- After approval, you can switch to Agent Mode or Edit Mode to execute
- Best for complex, multi-file work where you want full visibility upfront
Know the distinction: Plan Mode = plan first, no auto-execution. Edit Mode = you pick files, Copilot edits with your approval per step. Agent Mode = fully autonomous, Copilot decides which files to touch and can run terminal commands. The exam tests which mode to use for a given scenario.
Smart Actions
- Appear as a sparkle ✨ icon in the editor margin or on selected code
- Provide context-sensitive Copilot actions without opening the chat panel
- Examples: fix this, explain selection, generate docs, review selection
- Available in VS Code and JetBrains IDEs
File & Repository Exclusions in the IDE
Exclusions are configured at the org/repo level in GitHub settings. The IDE enforces them locally.
- Excluded files: Copilot does not offer inline suggestions when editing them
- Excluded files: their content is not sent as context to the model
- Changes to exclusion rules take up to 30 minutes to propagate to IDE clients
- To force a refresh in VS Code: Command Palette → Developer: Reload Window
- To force a refresh in JetBrains / Visual Studio: close and reopen the IDE
- Important caveat: Copilot CLI, Copilot cloud agent, and Agent Mode do not support content exclusion
Command Palette
The Command Palette gives quick access to Copilot functions without memorising shortcuts.
- Open it in VS Code: Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
- Type Copilot to filter available commands
- Select actions like Explain This, Generate Unit Tests, or Developer: Reload Window
Troubleshooting in the IDE
- Log files: Command Palette → Developer: Open Log File or Developer: Open Extensions Logs Folder
- Electron/process-level logs: when nothing useful is in the regular logs, use Help → Toggle Developer Tools
- Network/firewall/proxy issues: open the Command Palette and run GitHub Copilot: Collect Diagnostics — this opens a new editor with connection diagnostics you can inspect or share with support
- Common cause of "no suggestions": content exclusion match, duplication detection, disabled-for-this-language setting, or an authentication/network failure
GitHub Copilot CLI
CLI Overview: Old Extension vs. New Agentic CLI
This is a frequently confused topic — there have been two different CLI tools with similar names. Know the distinction.
Old gh copilot extension (retired) | New GitHub Copilot CLI (current) | |
|---|---|---|
| Status | Retired | Current, actively developed |
| Install | gh extension install github/gh-copilot | npm install -g @github/copilot (or winget/brew/curl) |
| Invocation | gh copilot suggest / gh copilot explain | copilot (bare command) |
| Capability | Suggests/explains a single shell command | Full agentic AI in the terminal — can write/debug code, run multi-step tasks, interact with GitHub.com |
| Category | GitHub CLI extension | Standalone agent tool (same family as Agent Mode / cloud agent) |
If a question describes a tool that only suggests/explains a single shell command, that's the retired extension. If it describes an agent that can write code, debug, create PRs, and run multi-step tasks from the terminal, that's the current GitHub Copilot CLI.
Installation & Authentication
Install Commands by Platform
| Platform | Command |
|---|---|
| npm (all platforms) | npm install -g @github/copilot — requires Node.js 22+ |
| Windows | winget install GitHub.Copilot |
| macOS / Linux | brew install --cask copilot-cli |
| macOS / Linux (script) | curl -fsSL https://gh.io/copilot-install | bash |
Windows additionally requires PowerShell v6+. Requires an active Copilot subscription on all platforms.
Authentication
- On first launch inside a session, run the
/loginslash command and follow the prompts - Alternative: a fine-grained Personal Access Token with "Copilot Requests" permission, set via an environment variable
- Token environment variable precedence order:
COPILOT_GITHUB_TOKEN→GH_TOKEN→GITHUB_TOKEN - Exam trap: the "Copilot Requests" permission is only available on user-owned fine-grained PATs — an organization-owned token cannot be used to authenticate the CLI
Interactive vs. Programmatic Mode
Interactive Mode
- Start a conversation by running
copilotin your project directory - You're prompted to trust the folder before Copilot can act on it
- Two submodes:
- Default ask/execute mode — converse and approve actions as you go
- Plan Mode — toggle with Shift+Tab; Copilot analyzes the request, asks clarifying questions, and builds a structured plan before writing any code
- Auto-compaction: conversation history is automatically compacted once it reaches 95% of the context window
Programmatic Mode
- Pass a single prompt directly:
copilot -p "your prompt"(or--prompt) - Completes the task and exits automatically — no interactive back-and-forth
- Designed for scripts and CI/automation pipelines
Security: Trusted Directories & Tool Approval
- Trusted directories: you explicitly designate which directories Copilot CLI may access and modify
- Tool approval: by default, any command that modifies or executes files requires manual approval at each step
- Approval flags:
--allow-tool,--deny-tool,--allow-all-tools - Caution:
--allow-all-toolsgrants Copilot "the same access as you do to files on your computer" with no per-action approval — use only in trusted, sandboxed contexts - Supports both local and cloud-based sandbox environments for isolated execution
- Customizable via custom instructions, MCP servers, custom agents, hooks, skills, and persistent memory
- Model configuration: choose GitHub-hosted models, or configure custom providers (OpenAI-compatible, Azure, Anthropic, local Ollama) via environment variables
The manual tool-approval system (and trusted directories) exists specifically so an autonomous terminal agent doesn't make unreviewed changes to your filesystem. Expect a question framing --allow-all-tools as the highest-risk configuration option.
Legacy Commands: suggest & explain
Retained here because the exam may still reference this pattern as the historical baseline for "Copilot in the command line."
| Command | Purpose | Example |
|---|---|---|
gh copilot suggest |
Generate a shell command from a natural language description | gh copilot suggest "list all git branches sorted by last commit" |
gh copilot explain |
Explain what a command does, including flags | gh copilot explain "git rebase -i HEAD~3" |
After a suggest response, interactive options included:
- Run this command — execute directly
- Copy to clipboard — paste into your shell
- Revise the command — refine with follow-up prompt
- Explain this command — get an explanation before running
Suggestion Types (three categories)
| Type | Description |
|---|---|
| Generic shell command | Standard shell commands (ls, grep, find, awk, curl, etc.) |
| gh command | GitHub CLI-specific commands and workflows |
| git command | Git version control operations |
Know that suggest/explain belong to the retired extension, while copilot (interactive or with -p) is the current agentic CLI. Know the three legacy suggestion types and the four legacy interactive options — both remain testable as historical/conceptual baseline.
Study Resources
- Getting Code Suggestions in Your IDE (GitHub Docs) Keyboard shortcuts, ghost text behavior, all IDE-specific details.
- Copilot Chat in your IDE (GitHub Docs) Slash commands, chat participants, chat variables, keyboard shortcuts.
- About GitHub Copilot CLI (GitHub Docs) The current agentic CLI: modes, sandboxes, security model.
- Installing GitHub Copilot CLI (GitHub Docs) Exact install commands per platform and authentication steps.
- Introduction to GitHub Copilot (Microsoft Learn module) Module covering IDE setup, triggering Copilot, configuration, and troubleshooting. Source for the Command Palette and diagnostics content above.
- GitHub Copilot Fundamentals Part 1 (Microsoft Learn path) Full learning path — core IDE and CLI features.
- GH Certified — Practice Questions Community practice tests aligned to IDE/CLI skills.