Copilot Hyperlink
Copilot Hyperlink lets you open GitHub Copilot Chat with a pre-filled message and local file attachments from anywhere — a browser tab, a web app, a shell script, a CI pipeline, or a clickable link in any document. No server, no background process, no configuration required.
Construct a vscode:// URL with your message and file paths, open it, and VS Code instantly pops open Copilot Chat with the context loaded and ready to submit.
Features
- One-click deep links — trigger a pre-filled Copilot Chat session from any URL-capable surface
- File attachments — attach one or more local files directly from the URL
- Folder expansion — point at a folder and every file inside it is attached automatically
- Payload file mode — link to a local JSON file that carries the full message, mode, and attachments; ideal for automation tools and scripts that generate output
- Chat mode control — open in Ask, Agent, or Edit mode
- No server, no ports — purely driven by VS Code's
vscode:// URI protocol
Installation
Install from the VS Code Marketplace or search Copilot Hyperlink in the Extensions panel.
Requires GitHub Copilot to be installed and signed in.
Quick Start
Paste this into your browser address bar (update the path to a real file on your machine):
vscode://BearNecessities.copilot-hyperlink/chat?message=Review+this+file&path=C%3A%5CUsers%5Cme%5Cnotes.md&mode=ask
VS Code will open, the Copilot Chat panel will appear, and your message + file will be pre-filled.
URL Reference
All links follow this structure:
vscode://BearNecessities.copilot-hyperlink/chat?<params>
Parameters
| Parameter |
Required |
Description |
message |
Yes (inline mode) |
Pre-filled text for the Copilot Chat input. URL-encode the value. |
path |
No |
Absolute path to a file or folder. Repeat for multiple. Aliases: attachment, attachments |
mode |
No |
ask (default), agent, or edit |
payloadFile |
Yes (payload mode) |
Absolute path to a local JSON payload file (see below). |
Folder paths: if path points to a folder, every direct (non-recursive) file inside it is attached.
Inline mode — single file
vscode://BearNecessities.copilot-hyperlink/chat
?message=Why%20is%20this%20test%20failing%3F
&path=C%3A%5CProjects%5Cmyapp%5Csrc%5Cutils.ts
&mode=ask
Inline mode — multiple files
Repeat path for each file:
vscode://BearNecessities.copilot-hyperlink/chat
?message=Review%20these%20two%20files
&path=C%3A%5CProjects%5Cmyapp%5Csrc%5Cfoo.ts
&path=C%3A%5CProjects%5Cmyapp%5Csrc%5Cbar.ts
&mode=agent
Inline mode — entire folder
vscode://BearNecessities.copilot-hyperlink/chat
?message=Summarise%20everything%20in%20this%20folder
&path=C%3A%5CProjects%5Cmyapp%5Clogs
&mode=ask
All files directly inside C:\Projects\myapp\logs are attached.
PowerShell helper
Constructing the URL in PowerShell is straightforward:
$message = [Uri]::EscapeDataString("Review these files and suggest improvements")
$path1 = [Uri]::EscapeDataString("C:\Projects\myapp\src\main.ts")
$path2 = [Uri]::EscapeDataString("C:\Projects\myapp\src\utils.ts")
Start-Process "vscode://BearNecessities.copilot-hyperlink/chat?message=$message&path=$path1&path=$path2&mode=ask"
JavaScript / web app helper
const message = encodeURIComponent("Review the attached annotations");
const path = encodeURIComponent("C:\\Users\\me\\reports\\annotations.yaml");
window.open(`vscode://BearNecessities.copilot-hyperlink/chat?message=${message}&path=${path}&mode=ask`);
Payload file mode
For richer automation (e.g. a tool that generates a report and wants to send it to Copilot), create a JSON file anywhere on disk:
{
"message": "Please review the attached annotation report and apply the feedback.",
"mode": "ask",
"attachments": [
"C:\\Users\\me\\reports\\annotations.yaml",
"C:\\Users\\me\\reports\\screenshots"
]
}
Then open it with:
vscode://BearNecessities.copilot-hyperlink/chat?payloadFile=C%3A%5CUsers%5Cme%5Creports%5Cpayload.json
Notes:
mode and attachments are optional in the JSON.
- Attachment paths may be absolute or relative to the JSON file's directory.
- A folder in
attachments expands to all direct files inside it.
Payload file — PowerShell example
# Write the payload
$payload = @{
message = "Here is the generated report. Please action the feedback."
mode = "ask"
attachments = @(".\report.yaml", ".\screenshots")
} | ConvertTo-Json
$payload | Set-Content "C:\Temp\payload.json"
# Open it in Copilot Chat
$encoded = [Uri]::EscapeDataString("C:\Temp\payload.json")
Start-Process "vscode://BearNecessities.copilot-hyperlink/chat?payloadFile=$encoded"
Commands
Access these from the Command Palette (Ctrl+Shift+P):
| Command |
Description |
| Copilot Hyperlink: Show Payload Folder |
Shows the path to the extension's local payload inbox and offers to copy or reveal it |
| Copilot Hyperlink: Copy Payload Folder Path |
Copies the inbox path to the clipboard silently |
The Copilot Hyperlink output channel (View → Output) logs the inbox path and both URL formats every time the extension activates.
Requirements
Extension Settings
This extension has no configurable settings.
Release Notes
See CHANGELOG.md.
License
MIT — © 2026 Bear Necessities