diff --git a/website/src/content/docs/learning-hub/copilot-configuration-basics.md b/website/src/content/docs/learning-hub/copilot-configuration-basics.md index c241f9ac..dbdd5100 100644 --- a/website/src/content/docs/learning-hub/copilot-configuration-basics.md +++ b/website/src/content/docs/learning-hub/copilot-configuration-basics.md @@ -3,7 +3,7 @@ title: 'Copilot Configuration Basics' description: 'Learn how to configure GitHub Copilot at user, workspace, and repository levels to optimize your AI-assisted development experience.' authors: - GitHub Copilot Learning Hub Team -lastUpdated: 2026-04-02 +lastUpdated: 2026-04-19 estimatedReadingTime: '10 minutes' tags: - configuration @@ -405,6 +405,20 @@ These files follow the same format as `config.json` and are loaded after the glo The model picker opens in a **full-screen view** with inline reasoning effort adjustment. Use the **← / →** arrow keys to change the reasoning effort level (`low`, `medium`, `high`) directly from the picker without leaving the session. The current reasoning effort level is also displayed in the model header (e.g., `claude-sonnet-4.6 (high)`) so you always know which level is active. +Select **`auto`** as your model to let Copilot automatically pick the best available model for each session. This is useful when you want consistent results without manually switching models as new ones become available: + +```bash +copilot --model auto +``` + +You can also set `auto` as your default model in `config.json`: + +```json +{ + "model": "auto" +} +``` + ### CLI Session Commands GitHub Copilot CLI has two commands for managing session state, with distinct behaviours: @@ -416,6 +430,12 @@ GitHub Copilot CLI has two commands for managing session state, with distinct be Both commands accept an optional prompt argument to seed the new session with an opening message, for example `/new Add error handling to the login flow`. +The `/ask` command lets you ask a quick question **without affecting conversation history**. It's useful for looking something up mid-task when you don't want the query to influence the ongoing session context: + +``` +/ask What's the difference between --rebase and --merge in git pull? +``` + The `/session rename` command renames the current session. When called **without a name argument**, it automatically generates a session name based on the conversation history: ``` @@ -457,6 +477,22 @@ The `/share html` command exports the current session — including conversation The exported file contains everything needed to view the session without a network connection and can be shared with teammates or stored for later reference. This complements `/share` (which shares via URL) for cases where an offline or attached format is preferred. +The `/env` command shows a summary of the loaded environment — which instructions, skills, MCP servers, agents, and plugins are active in your current session: + +``` +/env +``` + +This is especially useful when debugging configuration issues or verifying that a newly installed plugin or skill is being discovered correctly. + +The `/statusline` command (also available as `/footer`) lets you customise which items appear in the status bar at the bottom of the terminal UI: + +``` +/statusline # toggle or configure status bar items +``` + +Items you can show or hide include: directory, branch, effort level, context window usage, and quota. + **Keyboard shortcuts for queuing messages**: Use **Ctrl+Q** or **Ctrl+Enter** to queue a message (send it while the agent is still working). **Ctrl+D** no longer queues messages — it now has its default terminal behavior. If you have muscle memory for Ctrl+D queuing, switch to Ctrl+Q. The `/allow-all` command (also accessible as `/yolo`) enables autopilot mode, where the agent runs all tools without asking for confirmation. It now supports `on`, `off`, and `show` subcommands: @@ -477,6 +513,46 @@ gh copilot --effort high "Refactor the authentication module" Accepted values are `low`, `medium`, and `high`. You can also set a default via the `effortLevel` config setting. +### Resuming and Connecting to Sessions + +Use `--resume` or `/resume` with a **short session ID prefix** (7 or more hex characters) instead of the full ID when returning to a previous session: + +```bash +copilot --resume 4e51f5a # short prefix works, full ID not required +``` + +The `--connect` flag lets you connect directly to an existing remote session by ID without going through the resume picker: + +```bash +copilot --connect +``` + +This is useful in CI environments or when sharing a session between terminals. + +### Attaching Documents to Prompts + +You can attach supported document files (PDF, Word, text, etc.) directly to your prompts for the agent to read and reason about: + +``` +Summarise the key points from this spec. [drag-and-drop or paste file path] +``` + +Documents are included in the agent's context for that turn, making it easy to work with design documents, requirements, or reference materials without copying their content manually. + +### Startup and Diagnostic Flags + +The `--print-debug-info` flag displays version information, terminal capabilities, and active environment variables at startup — useful for reporting bugs or verifying your setup: + +```bash +copilot --print-debug-info +``` + +The `--session-idle-timeout` flag configures how long a session stays open when idle. It is disabled by default: + +```bash +copilot --session-idle-timeout 30m +``` + ## Common Questions **Q: How do I disable Copilot for specific files?** diff --git a/website/src/content/docs/learning-hub/installing-and-using-plugins.md b/website/src/content/docs/learning-hub/installing-and-using-plugins.md index 6788cbda..eb68a8b8 100644 --- a/website/src/content/docs/learning-hub/installing-and-using-plugins.md +++ b/website/src/content/docs/learning-hub/installing-and-using-plugins.md @@ -3,7 +3,7 @@ title: 'Installing and Using Plugins' description: 'Learn how to find, install, and manage plugins that extend GitHub Copilot CLI with reusable agents, skills, hooks, and integrations.' authors: - GitHub Copilot Learning Hub Team -lastUpdated: 2026-04-02 +lastUpdated: 2026-04-19 estimatedReadingTime: '8 minutes' tags: - plugins @@ -192,6 +192,9 @@ copilot plugin update my-plugin # Remove a plugin copilot plugin uninstall my-plugin + +# Refresh plugin catalogs for all registered marketplaces +copilot plugin marketplace update ``` ### Loading Plugins from a Local Directory diff --git a/website/src/content/docs/learning-hub/understanding-mcp-servers.md b/website/src/content/docs/learning-hub/understanding-mcp-servers.md index 72af15f3..4f17553e 100644 --- a/website/src/content/docs/learning-hub/understanding-mcp-servers.md +++ b/website/src/content/docs/learning-hub/understanding-mcp-servers.md @@ -3,7 +3,7 @@ title: 'Understanding MCP Servers' description: 'Learn how Model Context Protocol servers extend GitHub Copilot with access to external tools, databases, and APIs.' authors: - GitHub Copilot Learning Hub Team -lastUpdated: 2026-04-01 +lastUpdated: 2026-04-19 estimatedReadingTime: '8 minutes' tags: - mcp @@ -61,17 +61,13 @@ GitHub Copilot provides several **built-in tools** that are always available: ## Configuring MCP Servers -MCP servers are configured per-workspace. GitHub Copilot CLI discovers server definitions from several locations (loaded in order): +MCP servers are configured per-workspace. GitHub Copilot CLI reads server definitions from **`.mcp.json`** at the repository root. This is the single authoritative config source for the CLI. -| File | Scope | Notes | -|------|-------|-------| -| `.mcp.json` | Repository root | Preferred for repo-shared configuration | -| `.vscode/mcp.json` | VS Code workspace | VS Code–compatible workspace config | -| `devcontainer.json` | Dev container | Available when running inside a container | +> **Note**: GitHub Copilot CLI previously read MCP servers from `.vscode/mcp.json` and `devcontainer.json`, but support for those sources was removed in v1.0.22. If you have an existing `.vscode/mcp.json`, the CLI will display a migration hint pointing you to documentation with platform-specific instructions for migrating to `.mcp.json`. > **Security**: Workspace MCP servers are loaded **only after folder trust is confirmed**. If you haven't explicitly trusted a folder, servers defined in its config files won't start — protecting you from malicious MCP server configurations in untrusted repositories. -Example `.mcp.json` or `.vscode/mcp.json`: +Example `.mcp.json`: ```json { @@ -220,7 +216,7 @@ This enables sophisticated patterns like MCP servers that orchestrate multi-step > **Note**: Sampling requires explicit user approval every time a server requests inference. This is a security boundary — MCP servers cannot silently consume your AI quota or exfiltrate context without your knowledge. -## Finding MCP Servers +## Finding and Installing MCP Servers The MCP ecosystem is growing rapidly. Here are key resources: @@ -228,6 +224,36 @@ The MCP ecosystem is growing rapidly. Here are key resources: - **[MCP Specification](https://spec.modelcontextprotocol.io/)**: The protocol specification for building your own servers - **[Awesome MCP Servers](https://github.com/punkpeye/awesome-mcp-servers)**: Community-curated list of MCP servers +### Installing from the MCP Registry + +You can install MCP servers directly from the registry using the `copilot mcp` command, with guided configuration that walks you through the setup without hand-editing JSON: + +```bash +# Browse and install MCP servers from the registry (with guided setup) +copilot mcp install + +# Or install a specific server by name +copilot mcp install github +``` + +The CLI will prompt you for any required configuration values (such as API tokens or connection strings) during installation, so secrets never end up in your `.mcp.json`. + +> **Tip**: Use `copilot mcp list` to see which MCP servers are currently configured, and `copilot mcp remove ` to remove one. From within an interactive session, you can also run `/mcp show` to see which servers are active. + +### Remote MCP Servers + +For HTTP-based MCP servers (as opposed to locally-spawned stdio processes), the `type` field in `.mcp.json` can be omitted and the CLI will default to `http`: + +```json +{ + "servers": { + "my-remote-server": { + "url": "https://my-mcp-server.example.com" + } + } +} +``` + ### Building Your Own MCP Server If your team has internal tools or proprietary APIs, you can build custom MCP servers. The protocol supports three main capability types: @@ -245,7 +271,7 @@ MCP server SDKs are available in [Python](https://github.com/modelcontextprotoco - **Principle of least privilege**: Only give MCP servers the minimum access they need. Use read-only database connections for analysis agents. - **Keep secrets out of config files**: Use `${input:variableName}` for API keys and connection strings, or load from environment variables. - **Document your servers**: Add comments or a README explaining which MCP servers your project uses and why. -- **Version control carefully**: Commit `.mcp.json` or `.vscode/mcp.json` for shared server configurations, but use `.gitignore` for any files containing credentials. +- **Version control carefully**: Commit `.mcp.json` for shared server configurations, but use `.gitignore` for any files containing credentials. - **Test server connectivity**: Verify MCP servers start correctly before relying on them in agent workflows. - **Use the MCP allowlist (experimental)**: In high-security environments, the `MCP_ALLOWLIST` feature flag lets you validate MCP servers against a configured registry, blocking unrecognized servers from loading. MCP servers that are blocked by the allowlist policy are **hidden from `/mcp show`** to avoid confusion — only permitted servers appear in that view. This is an experimental feature for enterprise environments requiring strict control over which MCP servers are permitted. @@ -266,7 +292,7 @@ A: No, MCP servers typically run locally on your machine as child processes. The **Q: Can I use MCP servers without custom agents?** -A: Yes. Once configured in `.vscode/mcp.json`, MCP tools are available in any Copilot Chat session. Custom agents simply make it easier to pre-select the right tools for a workflow. +A: Yes. Once configured in `.mcp.json`, MCP tools are available in any Copilot session. Custom agents simply make it easier to pre-select the right tools for a workflow. **Q: Are MCP servers secure?**