Update Completions
This skill updates the _copilot Zsh completion file to reflect the current
copilot CLI interface.
Steps
- •
Gather current CLI help output. Run these commands and capture the output:
shcopilot --help copilot help config copilot help commands copilot help environment copilot help logging copilot help permissions copilot plugin --help copilot plugin marketplace --help copilot login --help copilot init --help
- •
Compare with
_copilot. Read the_copilotcompletion file and compare it against the help output. Identify:- •New, removed, or renamed flags/options (the
optionsarray) - •New, removed, or renamed subcommands (the
commandsarray and subcommand dispatch in theargscase) - •New, removed, or renamed help topics (the
help_topicsarray) - •New or removed models (the fallback
modelsarray) - •Changes to log levels or stream modes
- •New or changed plugin subcommands
- •New or changed login options
- •New, removed, or renamed flags/options (the
- •
Update
_copilot. Apply minimal, surgical edits to bring the completion file in sync. Preserve the existing code style:- •Options use Zsh
_argumentsspec format:'--flag-name[Description]:arg-name:completer' - •Repeatable options are prefixed with
'*' - •Short/long pairs use
'(-s --long)'{-s,--long}'[Desc]'syntax - •Subcommand arrays use
'name:Description'format - •Model entries use
'model-id:Display Name'format
- •Options use Zsh
- •
Update
copilot.plugin.zshif needed. If new wrapper functions or fpath changes are warranted by CLI changes, update the plugin file too. - •
Verify. After editing, read back the modified file(s) to confirm the changes are syntactically correct and consistent with the surrounding code.
Important Notes
- •The
_copilot__models_from_helpfunction dynamically extracts models fromcopilot --helpat completion time. The staticmodelsarray is only a fallback — update it to stay reasonably current but do not remove the dynamic extraction logic. - •Do not remove or alter the
_copilot__installed_plugins,_copilot__marketplaces,_copilot__browsable_plugins, or_copilot__installable_pluginshelper functions unless the CLI changes require it. These provide live dynamic completions. - •Keep the guard at the bottom:
if (( $+compstate )); then _copilot "$@"; fi