update-completions
Update PowerShell tab completions for the GitHub Copilot CLI based on its current help output. Use when asked to update, sync, or refresh completions, or when the CLI has been updated and completions need to match the latest flags, subcommands, and help topics.
소스 정보
- 저장소
- scaryrawr/copilot.pwsh
- 최근 소스 활동
- 2026년 2월 18일 02:50
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
SKILL.md 표시 중
SKILL.md
소스 지침 · 읽기 전용 미리보기- name
- update-completions
- description
- Update PowerShell tab completions for the GitHub Copilot CLI based on its current help output. Use when asked to update, sync, or refresh completions, or when the CLI has been updated and completions need to match the latest flags, subcommands, and help topics.
- license
- MIT
- compatibility
- Requires copilot CLI and PowerShell 7.0+
# Update Copilot CLI PowerShell Completions
## When to Use
- When the Copilot CLI has been updated and completions may be out of date
- When asked to update, sync, or refresh the PowerShell completions
- When new flags, subcommands, or help topics have been added to the CLI
## Instructions
1. Run the following commands to gather the current CLI help output:
```powershell
copilot --help
copilot help commands
copilot help config
copilot help environment
copilot help logging
copilot help permissions
copilot init --help
copilot update --help
copilot version --help
copilot login --help
copilot plugin --help
copilot plugin install --help
copilot plugin uninstall --help
copilot plugin update --help
copilot plugin list --help
copilot plugin marketplace --help
copilot plugin marketplace add --help
copilot plugin marketplace remove --help
copilot plugin marketplace list --help
copilot plugin marketplace browse --help
```
2. Compare the help output against the existing completions in `copilot.pwsh.psm1`.
3. Update `copilot.pwsh.psm1` to reflect any changes:
- Add entries to the relevant `$script:_*` hashtables/arrays in the **Completion Data** region
- Remove entries for deprecated/removed flags or subcommands
- Update descriptions to match current help text
- Add new subcommands or help topics
- If a new flag accepts a value, add it to `$script:_flagsWithValues`
- If a new flag has enumerated values, add a handler in the `$prevToken` check section of the completer
4. Update the fallback model list in `$script:_models` if the set of available models has changed. Parse the model list from `copilot --help` output under the `--model` section.
5. Validate changes by importing the module and triggering completions:
```powershell
Import-Module .\copilot.pwsh.psm1 -Force
# Verify no parse errors
$null = [System.Management.Automation.Language.Parser]::ParseFile(
(Resolve-Path .\copilot.pwsh.psm1).Path, [ref]$null, [ref]$null)
```
## Key Files
- `copilot.pwsh.psm1` — All completion logic; organized into three regions:
- **Completion Data** — Static `$script:_*` hashtables and arrays
- **Dynamic Completion Helpers** — Functions that shell out to `copilot` at runtime with 30s TTL caching
- **Completer Registration** — `Register-ArgumentCompleter -Native -CommandName copilot` block
- `copilot.pwsh.psd1` — Module manifest (exports nothing; side effect is completer registration)
## Conventions
- All module-level state uses `$script:` scope prefix (e.g., `$script:_topLevelCommands`)
- Completion data variables are prefixed with `_` (e.g., `$script:_globalFlags`, `$script:_models`)
- Flag dictionaries use `[ordered]@{}` to preserve display order in completions
- Dynamic completions parse bullet-point output (`•`) from `copilot` CLI using regex
- `[Console]::OutputEncoding` is temporarily set to UTF-8 and restored in `finally` blocks when invoking external commands
- The manifest exports nothing (`FunctionsToExport = @()`); the module's only side effect is argument completer registration
GitHub에서 보기