ask-copilot
1.1.1
* No tools: shell, file read, file write, URL fetch, memory and the GitHub MCP server
are all denied (--deny-tool). Custom instructions (AGENTS.md etc.) are not loaded.
* No filesystem: Copilot runs in a fresh, empty working directory with a fresh, empty
COPILOT_H
* No tools: shell, file read, file write, URL fetch, memory and the GitHub MCP server
are all denied (--deny-tool). Custom instructions (AGENTS.md etc.) are not loaded.
* No filesystem: Copilot runs in a fresh, empty working directory with a fresh, empty
COPILOT_HOME, so it cannot see your files, settings, MCP servers, plugins or skills.
Both directories are deleted when the script exits.
* No permission overrides: every inherited COPILOT_* variable (e.g. COPILOT_ALLOW_ALL)
and every other GitHub token variable is removed from Copilot's environment.
Output is always Markdown. It is written to the pipeline as lines of text, so it can be
piped, redirected or captured (ask-copilot q | Set-Content answer.md, $x = ask-copilot q).
When glow (https://github.com/charmbracelet/glow) is installed and the output is going
straight to the terminal, it is rendered with glow; anything piped, redirected or captured
always gets the raw Markdown. Control this with -Glow.
Authentication uses a fine-grained personal access token with only the "Copilot Requests"
account permission. The token is never written to disk:
* By default you paste it at a masked prompt on each run (kept as a SecureString).
* Or use -OpReference to read it from 1Password with the `op` CLI (op://vault/item/field).
With the 1Password desktop app's CLI integration on, op unlocks via Windows Hello and
keeps no session token on disk.
* Or use -SecretName to pull it from a PowerShell SecretManagement vault. Use a remote
vault (e.g. Azure Key Vault, 1Password, Bitwarden). The local SecretStore vault is
refused because it saves secrets to a file on this machine.
The token goes only into the Copilot child process's environment, never into this
PowerShell session's environment, the command line, or `copilot login` (which would save it).
Create the token at https://github.com/settings/personal-access-tokens/new :
Resource owner: your personal account
Repository access: Public repositories (read-only)
Permissions > Account > Copilot Requests
Expiration: as short as you can tolerate
Installation Options
Owners
Copyright
(c) 2026 Emily Lockhart. MIT License.
Package Details
Author(s)
- Emily Lockhart
Tags
Copilot GitHubCopilot GitHub AI CLI Markdown glow 1Password Windows Linux
Functions
New-CopilotPrompt Test-OutputToTerminal Resolve-GlowExecutable Get-GlowPath Invoke-Glow Resolve-CopilotExecutable New-CopilotArgumentList Initialize-CopilotEnvironment Wait-CopilotOutput Remove-CopilotTempDirectory Read-OnePasswordToken Get-SecretVaultToken Get-CopilotToken ConvertFrom-SecureToken
PSEditions
Dependencies
This script has no dependencies.
Release Notes
FileList
- ask-copilot.nuspec
- ask-copilot.ps1
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.1.1 (current version) | 11 | 10/22/2026 |