#compdef copilot

autoload -U is-at-least

# Copyright (c) Microsoft Corporation. All rights reserved.
_copilot_config_context() {
    cfg_mode=read cfg_scope=user cfg_key='' cfg_position=0 cfg_literal=0
    local cfg_stage=root cfg_skip='' cfg_word
    for cfg_word in "$@"; do
        if [ "$cfg_skip" = required ]; then
            cfg_skip=''
            continue
        fi
        if [ "$cfg_skip" = optional ]; then
            cfg_skip=''
            case "$cfg_word" in -*) ;; *) continue ;; esac
        fi
        case "$cfg_stage" in
            root)
                case "$cfg_word" in
                    --interactive|-i|--prompt|-p|--model|--reasoning-effort|--context|--auto-tier|--agent|--name|-n|--session-id|--new-session-id|-C|--log-dir|--extension-sdk-path|--config-dir|--log-level|--save-trajectory-output|--prefer-version|--stream|--output-format|--add-dir|--attachment|--disable-mcp-server|--add-github-mcp-toolset|--add-github-mcp-tool|--plugin-dir|--additional-mcp-config|--mcp-github-auth|--additional-content-exclusion-policies|--max-autopilot-continues|--mode|--host|--port|--session-idle-timeout|--auth-token-env|--collect-debug-logs|--collect-debug-logs-output|--ahp-authenticate|--environment|--host-environment|--host-compute-id|--host-ahp-token|--host-ahp-listen|--host-directory|--dynamic-retrieval|--enable-mcp-server|--max-ai-credits|--usage-output-file) cfg_skip=required ;;
                    --resume|-r|--connect|--worktree|-w|--share|--allow-tool|--deny-tool|--available-tools|--excluded-tools|--secret-env-vars|--allow-url|--deny-url|--bash-env|--mouse|--sync-session|--ahp) cfg_skip=optional ;;
                    --interactive=*|-i?*|--prompt=*|-p?*|--model=*|--reasoning-effort=*|--context=*|--auto-tier=*|--agent=*|--resume=*|-r?*|--name=*|-n?*|--session-id=*|--new-session-id=*|--connect=*|--worktree=*|-w?*|-C?*|--log-dir=*|--extension-sdk-path=*|--config-dir=*|--log-level=*|--save-trajectory-output=*|--prefer-version=*|--stream=*|--output-format=*|--share=*|--add-dir=*|--attachment=*|--disable-mcp-server=*|--add-github-mcp-toolset=*|--add-github-mcp-tool=*|--plugin-dir=*|--additional-mcp-config=*|--mcp-github-auth=*|--additional-content-exclusion-policies=*|--allow-tool=*|--deny-tool=*|--available-tools=*|--excluded-tools=*|--secret-env-vars=*|--allow-url=*|--deny-url=*|--max-autopilot-continues=*|--mode=*|--bash-env=*|--mouse=*|--host=*|--sync-session=*|--port=*|--session-idle-timeout=*|--auth-token-env=*|--collect-debug-logs=*|--collect-debug-logs-output=*|--ahp=*|--ahp-authenticate=*|--environment=*|--host-environment=*|--host-compute-id=*|--host-ahp-token=*|--host-ahp-listen=*|--host-directory=*|--dynamic-retrieval=*|--enable-mcp-server=*|--max-ai-credits=*|--usage-output-file=*|--version|-v|--fleet|--trust-folder|--silent|-s|--disable-client-telemetry|--enable-memory|--enable-reasoning-summaries|--continue|--cloud|--allow-all-tools|--allow-all-paths|--disallow-temp-dir|--banner|--screen-reader|--plain-diff|--share-gist|--disable-builtin-mcps|--enable-all-github-mcp-tools|--allow-all-mcp-server-instructions|--allow-all-urls|--allow-all|--yolo|--autopilot|--plan|--experimental|--show-timing|--server|--ui-server|--headless|--managed-server|--acp|--stdio|--disable-remote-sessions|--remote|--log-interactive-shells|--print-debug-info|--host-ahp|--host-ahp-disable-token|--sandbox|--assisted-approval|--embedded-host|--no-custom-instructions|--no-auto-update|--no-ask-user|--no-color|--no-experimental|--no-bash-env|--no-mouse|--no-auto-login|--no-sandbox|--no-eager-powershell-resolution|--help|-h) ;;
                    config) cfg_stage=args ;;
                    *) return 1 ;;
                esac
                ;;
            args)
                if [ "$cfg_literal" = 0 ]; then
                    case "$cfg_word" in
                        --repo|--local) cfg_scope=repo; continue ;;
                        --global) cfg_scope=user; continue ;;
                        --rm) cfg_mode=remove; continue ;;
                        --list) cfg_mode=list; continue ;;
                        --json) continue ;;
                        --) cfg_literal=1; continue ;;
                        -*) return 1 ;;
                    esac
                fi
                if [ "$cfg_position" = 0 ]; then cfg_key="$cfg_word"; fi
                cfg_position=$((cfg_position + 1))
                ;;
        esac
    done
    [ "$cfg_stage" = args ] || return 1
    if [ "$cfg_mode" = read ] && [ "$cfg_position" -gt 0 ]; then cfg_mode=write; fi
    return 0
}

_copilot_config_candidates() {
cfg_values='' cfg_path='' cfg_list=''
if [ "$cfg_position" = 0 ]; then
case "$cfg_scope:$cfg_mode" in
user:remove) cfg_values='ahpEnvironment.acceptRemoteConnections ahpEnvironment.allowCreatingNewSessions ahpEnvironment.computeId ahpEnvironment.name ahpEnvironment.publishNewSessionsByDefault ahpEnvironment.requireConnectionBinding allowedUrls askUser assistedApprovalInstructions autoTier autoUpdate autoUpdatesChannel banner bannerStyle bashEnv beep beepOnSchedule commandHistoryMaxSize compactPaste companyAnnouncements connectors contextManagementTools contextTier continueOnAutoMode copyOnCodeBlockClick copyOnSelect customAgents.defaultLocalOnly defaultMode defaultPermissionMode deniedUrls disableAllHooks disabledHooks disabledMcpServers disabledSkills dynamicRetrieval.mcp dynamicRetrieval.skills editorMode effortLevel enableAllGithubMcpTools enabledMcpServers experimental extensions.disabledExtensions extensions.mode feature_flags.enabled footer.showAgent footer.showAiUsed footer.showBranch footer.showCiStatus footer.showCodeChanges footer.showContextWindow footer.showCustom footer.showDirectory footer.showModelEffort footer.showPullRequest footer.showQuota footer.showSandbox footer.showSchedules footer.showUsername footer.showYolo githubMcpInsiders githubMcpTools githubMcpToolsets ide.autoConnect ide.openDiffOnEdit ignoredSkillsLocations imageGeneration imageGenerationWatermark includeCoAuthoredBy inlineImageLiveWindow inlineImages keepAlive memory mergeStrategy model modelProviderId mouse notifications pinnedPrompts planContextTier planEffortLevel planModel planModelProviderId powershellFlags proxyKerberosServicePrincipal proxyUrl remoteExport renderHexColors renderMarkdown respectGitignore sandbox.addCurrentWorkingDirectory sandbox.allowBypass sandbox.allowDevToolAccess sandbox.auth.gh sandbox.auth.git sandbox.credentials.envVars.*.injectHosts sandbox.enabled sandbox.sandboxLspServers sandbox.sandboxMcpServers sandbox.userPolicy.filesystem.deniedPaths sandbox.userPolicy.filesystem.readonlyPaths sandbox.userPolicy.filesystem.readwritePaths sandbox.userPolicy.network.allowedHosts sandbox.userPolicy.network.allowLocalNetwork sandbox.userPolicy.network.allowOutbound sandbox.userPolicy.network.blockedHosts sandbox.userPolicy.network.proxy.url sandbox.userPolicy.network.proxy.username screenReader scrollbar showReasoning showTimestamps showTipsOnStartup showToolDurations sidebar.accentActiveSession sidebar.coloredHints sidebar.enabled sidebar.hoverFocus sidebar.showCloseButton sidebar.showHeaderButtons sidebar.showResumableSessions skillDirectories statusLine.padding statusLine.refreshInterval statusLine.type stayInAutopilot stream subagents.contextManagementTools subagents.maxConcurrency subagents.maxDepth tabs.enabled tabs.hide tabs.sort taskbarPresence terminalNotifications terminalProgress theme toolSearch transcriptView updateTerminalTitle voice.selectedDevice.name voice.selectedDevice.occurrence workflows.logPhaseNames workflows.maxConcurrentRuns worktreeBaseRef worktreePathTemplate' ;;
repo:remove) cfg_values='autoTier companyAnnouncements contextTier deniedUrls disableAllHooks disabledMcpServers disabledSkills effortLevel includeCoAuthoredBy mergeStrategy model modelProviderId respectGitignore skillDirectories' ;;
*:read) cfg_values='ahpEnvironment.acceptRemoteConnections ahpEnvironment.allowCreatingNewSessions ahpEnvironment.computeId ahpEnvironment.name ahpEnvironment.publishNewSessionsByDefault ahpEnvironment.requireConnectionBinding allowedUrls askUser assistedApprovalInstructions autoTier autoUpdate autoUpdatesChannel banner bannerStyle bashEnv beep beepOnSchedule builtInAgents.rubberDuck builtInAgents.rubberDuckAutoInvoke commandHistoryMaxSize compactPaste companyAnnouncements connectors contextManagementTools contextTier continueOnAutoMode copilotUrl copyOnCodeBlockClick copyOnSelect customAgents.defaultLocalOnly defaultMode defaultPermissionMode deniedUrls disableAllHooks disabledHooks disabledMcpServers disabledSkills dynamicRetrieval.mcp dynamicRetrieval.skills editorMode effortLevel enableAllGithubMcpTools enabledMcpServers experimental extensions.disabledExtensions extensions.mode feature_flags.enabled footer.showAgent footer.showAiUsed footer.showBranch footer.showCiStatus footer.showCodeChanges footer.showContextWindow footer.showCustom footer.showDirectory footer.showModelEffort footer.showPullRequest footer.showQuota footer.showSandbox footer.showSchedules footer.showUsername footer.showYolo githubMcpInsiders githubMcpTools githubMcpToolsets ide.autoConnect ide.openDiffOnEdit ignoredSkillsLocations imageGeneration imageGenerationWatermark includeCoAuthoredBy inlineImageLiveWindow inlineImages keepAlive logLevel memory mergeStrategy model modelProviderId mouse notifications permissions.disableAssistedPermissionsMode permissions.disableBypassPermissionsMode pinnedPrompts planContextTier planEffortLevel planModel planModelProviderId powershellFlags proxyKerberosServicePrincipal proxyUrl remoteExport remoteSessions renderHexColors renderMarkdown respectGitignore sandbox.addCurrentWorkingDirectory sandbox.allowBypass sandbox.allowDevToolAccess sandbox.auth.gh sandbox.auth.git sandbox.credentials.envVars.*.injectHosts sandbox.enabled sandbox.sandboxLspServers sandbox.sandboxMcpServers sandbox.userPolicy.experimental.seatbelt.keychainAccess sandbox.userPolicy.filesystem.deniedPaths sandbox.userPolicy.filesystem.readonlyPaths sandbox.userPolicy.filesystem.readwritePaths sandbox.userPolicy.network.allowedHosts sandbox.userPolicy.network.allowLocalNetwork sandbox.userPolicy.network.allowOutbound sandbox.userPolicy.network.blockedHosts sandbox.userPolicy.network.proxy.password sandbox.userPolicy.network.proxy.url sandbox.userPolicy.network.proxy.username sandbox.userPolicy.seatbelt.keychainAccess screenReader scrollbar shellShortcut showReasoning showTimestamps showTipsOnStartup showToolDurations sidebar.accentActiveSession sidebar.coloredHints sidebar.enabled sidebar.hoverFocus sidebar.showCloseButton sidebar.showHeaderButtons sidebar.showResumableSessions skillDirectories statusLine.command statusLine.padding statusLine.refreshInterval statusLine.type stayInAutopilot storeTokenPlaintext stream streamerMode subagents.contextManagementTools subagents.disabledSubagents subagents.maxConcurrency subagents.maxDepth tabs.enabled tabs.hide tabs.sort taskbarPresence telemetry.capture.identity telemetry.capture.policyDetail telemetry.capture.prompts telemetry.capture.responses telemetry.capture.toolArguments telemetry.capture.toolOutput telemetry.captureContent terminalNotifications terminalProgress theme toolSearch transcriptView updateTerminalTitle voice.enabled voice.selectedDevice.name voice.selectedDevice.occurrence voice.selectedModel workflows.defaultLimits.maxAiCredits workflows.defaultLimits.maxConcurrentSubagents workflows.defaultLimits.maxTotalSubagents workflows.defaultLimits.timeoutSeconds workflows.logPhaseNames workflows.maxConcurrentRuns worktreeBaseRef worktreePathTemplate' ;;
esac
return
fi
[ "$cfg_position" = 1 ] || return
[ "$cfg_mode" != list ] || return
case "$cfg_scope:$cfg_key" in
'user:ahpEnvironment.acceptRemoteConnections') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:ahpEnvironment.allowCreatingNewSessions') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:ahpEnvironment.computeId') cfg_values='' cfg_path='' cfg_list='' ;;
'user:ahpEnvironment.name') cfg_values='' cfg_path='' cfg_list='' ;;
'user:ahpEnvironment.publishNewSessionsByDefault') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:ahpEnvironment.requireConnectionBinding') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:allowedUrls') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:askUser') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:assistedApprovalInstructions') cfg_values='' cfg_path='' cfg_list='' ;;
'user:autoTier'|'repo:autoTier') cfg_values='efficiency balance intelligence' cfg_path='' cfg_list='' ;;
'user:autoUpdate') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:autoUpdatesChannel') cfg_values='stable prerelease' cfg_path='' cfg_list='' ;;
'user:banner') cfg_values='always once never' cfg_path='' cfg_list='' ;;
'user:bannerStyle') cfg_values='mona classic' cfg_path='' cfg_list='' ;;
'user:bashEnv') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:beep') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:beepOnSchedule') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:commandHistoryMaxSize') cfg_values='' cfg_path='' cfg_list='' ;;
'user:compactPaste') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:companyAnnouncements'|'repo:companyAnnouncements') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:connectors') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:contextManagementTools') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:contextTier'|'repo:contextTier') cfg_values='default long_context' cfg_path='' cfg_list='' ;;
'user:continueOnAutoMode') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:copyOnCodeBlockClick') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:copyOnSelect') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:customAgents.defaultLocalOnly') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:defaultMode') cfg_values='interactive plan autopilot' cfg_path='' cfg_list='' ;;
'user:defaultPermissionMode') cfg_values='manual assisted allow-all' cfg_path='' cfg_list='' ;;
'user:deniedUrls'|'repo:deniedUrls') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:disableAllHooks'|'repo:disableAllHooks') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:disabledHooks') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:disabledMcpServers'|'repo:disabledMcpServers') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:disabledSkills'|'repo:disabledSkills') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:dynamicRetrieval.mcp') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:dynamicRetrieval.skills') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:editorMode') cfg_values='normal vim' cfg_path='' cfg_list='' ;;
'user:effortLevel'|'repo:effortLevel') cfg_values='' cfg_path='' cfg_list='' ;;
'user:enableAllGithubMcpTools') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:enabledMcpServers') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:experimental') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:extensions.disabledExtensions') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:extensions.mode') cfg_values='disabled load_only load_and_augment' cfg_path='' cfg_list='' ;;
'user:feature_flags.enabled') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:footer.showAgent') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showAiUsed') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showBranch') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showCiStatus') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showCodeChanges') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showContextWindow') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showCustom') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showDirectory') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showModelEffort') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showPullRequest') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showQuota') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showSandbox') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showSchedules') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showUsername') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:footer.showYolo') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:githubMcpInsiders') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:githubMcpTools') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:githubMcpToolsets') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:ide.autoConnect') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:ide.openDiffOnEdit') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:ignoredSkillsLocations') cfg_values='' cfg_path='directory' cfg_list='yes' ;;
'user:imageGeneration') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:imageGenerationWatermark') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:includeCoAuthoredBy'|'repo:includeCoAuthoredBy') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:inlineImageLiveWindow') cfg_values='' cfg_path='' cfg_list='' ;;
'user:inlineImages') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:keepAlive') cfg_values='on off busy' cfg_path='' cfg_list='' ;;
'user:memory') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:mergeStrategy'|'repo:mergeStrategy') cfg_values='rebase merge' cfg_path='' cfg_list='' ;;
'user:model'|'repo:model') cfg_values='' cfg_path='' cfg_list='' ;;
'user:modelProviderId'|'repo:modelProviderId') cfg_values='' cfg_path='' cfg_list='' ;;
'user:mouse') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:notifications') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:pinnedPrompts') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:planContextTier') cfg_values='default long_context' cfg_path='' cfg_list='' ;;
'user:planEffortLevel') cfg_values='' cfg_path='' cfg_list='' ;;
'user:planModel') cfg_values='' cfg_path='' cfg_list='' ;;
'user:planModelProviderId') cfg_values='' cfg_path='' cfg_list='' ;;
'user:powershellFlags') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:proxyKerberosServicePrincipal') cfg_values='' cfg_path='' cfg_list='' ;;
'user:proxyUrl') cfg_values='' cfg_path='' cfg_list='' ;;
'user:remoteExport') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:renderHexColors') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:renderMarkdown') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:respectGitignore'|'repo:respectGitignore') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.addCurrentWorkingDirectory') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.allowBypass') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.allowDevToolAccess') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.auth.gh') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.auth.git') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.credentials.envVars.*.injectHosts') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:sandbox.enabled') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.sandboxLspServers') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.sandboxMcpServers') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.userPolicy.filesystem.deniedPaths') cfg_values='' cfg_path='file' cfg_list='yes' ;;
'user:sandbox.userPolicy.filesystem.readonlyPaths') cfg_values='' cfg_path='file' cfg_list='yes' ;;
'user:sandbox.userPolicy.filesystem.readwritePaths') cfg_values='' cfg_path='file' cfg_list='yes' ;;
'user:sandbox.userPolicy.network.allowedHosts') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:sandbox.userPolicy.network.allowLocalNetwork') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.userPolicy.network.allowOutbound') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sandbox.userPolicy.network.blockedHosts') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:sandbox.userPolicy.network.proxy.url') cfg_values='' cfg_path='' cfg_list='' ;;
'user:sandbox.userPolicy.network.proxy.username') cfg_values='' cfg_path='' cfg_list='' ;;
'user:screenReader') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:scrollbar') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:showReasoning') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:showTimestamps') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:showTipsOnStartup') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:showToolDurations') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sidebar.accentActiveSession') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sidebar.coloredHints') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sidebar.enabled') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sidebar.hoverFocus') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sidebar.showCloseButton') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sidebar.showHeaderButtons') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:sidebar.showResumableSessions') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:skillDirectories'|'repo:skillDirectories') cfg_values='' cfg_path='directory' cfg_list='yes' ;;
'user:statusLine.padding') cfg_values='' cfg_path='' cfg_list='' ;;
'user:statusLine.refreshInterval') cfg_values='' cfg_path='' cfg_list='' ;;
'user:statusLine.type') cfg_values='command' cfg_path='' cfg_list='' ;;
'user:stayInAutopilot') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:stream') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:subagents.contextManagementTools') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:subagents.maxConcurrency') cfg_values='' cfg_path='' cfg_list='' ;;
'user:subagents.maxDepth') cfg_values='' cfg_path='' cfg_list='' ;;
'user:tabs.enabled') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:tabs.hide') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:tabs.sort') cfg_values='' cfg_path='' cfg_list='yes' ;;
'user:taskbarPresence') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:terminalNotifications') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:terminalProgress') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:theme') cfg_values='default github dim high-contrast colorblind' cfg_path='' cfg_list='' ;;
'user:toolSearch') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:transcriptView') cfg_values='default concise' cfg_path='' cfg_list='' ;;
'user:updateTerminalTitle') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:voice.selectedDevice.name') cfg_values='' cfg_path='' cfg_list='' ;;
'user:voice.selectedDevice.occurrence') cfg_values='' cfg_path='' cfg_list='' ;;
'user:workflows.logPhaseNames') cfg_values='true false' cfg_path='' cfg_list='' ;;
'user:workflows.maxConcurrentRuns') cfg_values='' cfg_path='' cfg_list='' ;;
'user:worktreeBaseRef') cfg_values='head defaultBranch' cfg_path='' cfg_list='' ;;
'user:worktreePathTemplate') cfg_values='' cfg_path='directory' cfg_list='' ;;
esac
if [ "$cfg_mode" = remove ] && [ "$cfg_list" != yes ]; then
cfg_values='' cfg_path=''
fi
}

_copilot_config_key_candidates() {
local candidate prefix suffix name
for candidate in "$@"; do
    case "$candidate" in
        *'.*.'*)
            prefix="${candidate%%\*.*}"
            suffix="${candidate#*.\*}"
            case "$cur" in
                "$prefix"*)
                    name="${cur#"$prefix"}"
                    case "$name" in
                        ?*.*) name="${name%.*}"; candidate="$prefix$name$suffix" ;;
                        *) continue ;;
                    esac
                    ;;
                *) candidate="$prefix" ;;
            esac
            ;;
    esac
    case "$candidate" in "$cur"*) printf '%s\n' "$candidate" ;; esac
done
}

# Copyright (c) Microsoft Corporation. All rights reserved.
_copilot_config_complete() {
    local cfg_mode cfg_scope cfg_key cfg_position cfg_literal cfg_values cfg_path cfg_list
    local cur="${words[CURRENT]}"
    _copilot_config_context "${words[@]:1:$((CURRENT-2))}" || return 1
    if [[ "$cur" == -* && "$cfg_literal" = 0 ]]; then return 1; fi
    _copilot_config_candidates
    if [[ -n "$cfg_values" ]]; then
        local -a candidates
        candidates=(${=cfg_values})
        if [[ "$cfg_position" = 0 ]]; then
            local matches="$(_copilot_config_key_candidates "${candidates[@]}")"
            [[ -n "$matches" ]] || return 0
            candidates=("${(@f)matches}")
            local candidate
            for candidate in "${candidates[@]}"; do
                if [[ "$candidate" = *. ]]; then
                    compadd -S '' -- "$candidate"
                else
                    compadd -- "$candidate"
                fi
            done
        else
            compadd -- "${candidates[@]}"
        fi
    elif [[ "$cfg_path" = directory ]]; then
        _files -/
    elif [[ "$cfg_path" = file ]]; then
        _files
    fi
    return 0
}

_copilot() {
    _copilot_config_complete && return 0
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'-i+[Start interactive mode and automatically execute this prompt]:prompt:_default' \
'--interactive=[Start interactive mode and automatically execute this prompt]:prompt:_default' \
'-p+[Execute a prompt in non-interactive mode (exits after completion)]:text:_default' \
'--prompt=[Execute a prompt in non-interactive mode (exits after completion)]:text:_default' \
'--model=[Set the AI model to use (use '\''auto'\'' to let Copilot pick automatically)]:model:(auto claude-sonnet-5.5 claude-sonnet-5 claude-fable-5.1 claude-fable-5 claude-opus-5.5 claude-opus-5 claude-opus-4.8 claude-opus-4.8-fast claude-sonnet-4.6 claude-haiku-5.5 claude-haiku-4.5 gpt-6.1-sol gpt-6-sol gpt-6-luna gpt-6-astra gpt-5.6-sol gpt-5.6-terra gpt-5.6-luna gpt-5.5 gpt-5.4 gpt-5.4-mini gpt-5.3-codex gpt-5-mini mai-code-1.1-flash gemini-4-argon gemini-3.8-flash gemini-3.7-flash grok-4.7 grok-4.6 grok-4.5 kimi-k3)' \
'--reasoning-effort=[Set the reasoning effort level]:level:(none minimal low medium high xhigh max)' \
'--context=[Set the context window tier (overrides persisted setting)]:tier:(default long_context)' \
'--auto-tier=[Set the Auto routing profile (validated against the available catalog)]:preference:_default' \
'--agent=[Specify a custom agent to use]:agent:_default' \
'(--continue)-r+[Resume from a previous session (optionally specify existing session ID, task ID, ID prefix, or name; name matching is exact, case-insensitive)]::value:_default' \
'(--continue)--resume=[Resume from a previous session (optionally specify existing session ID, task ID, ID prefix, or name; name matching is exact, case-insensitive)]::value:_default' \
'(-r --resume --continue --connect)-n+[Set a name for the new session]:name:_default' \
'(-r --resume --continue --connect)--name=[Set a name for the new session]:name:_default' \
'(-r --resume --continue --connect --cloud --server --headless --acp)--session-id=[Resume an existing session or task by ID, or set the UUID for a new session]:id:_default' \
'(--session-id -r --resume --continue --connect --cloud --acp -w --worktree --environment --ahp)--new-session-id=[Create a new local session with the supplied UUID]:id:_default' \
'(-r --resume --continue)--connect=[Connect directly to a remote session (optionally specify session ID or task ID)]::sessionId:_default' \
'(-r --resume --continue --connect --cloud --session-id --new-session-id)-w+[Create or reuse an isolated git worktree and start the session inside it (name is optional; the location follows the worktreePathTemplate setting)]::name:_default' \
'(-r --resume --continue --connect --cloud --session-id --new-session-id)--worktree=[Create or reuse an isolated git worktree and start the session inside it (name is optional; the location follows the worktreePathTemplate setting)]::name:_default' \
'-C+[Change working directory before doing anything else]:directory:_default' \
'--log-dir=[Set log file directory (default\: ~/.copilot/logs/)]:directory:_default' \
'--extension-sdk-path=[Override the bundled @github/copilot-sdk injected into extension subprocesses with a local \`copilot-sdk/\` folder. Invalid paths fall back to the bundled SDK.]:directory:_default' \
'--config-dir=[Set the configuration directory (default\: ~/.copilot). Deprecated\: use COPILOT_HOME env var instead.]:directory:_default' \
'--log-level=[Set the log level]:level:(none error warning info debug all default)' \
'--save-trajectory-output=[Save execution trajectory to specified file]:file:_default' \
'--prefer-version=[Load a specific cached package version (used by /downgrade)]:version:_default' \
'--stream=[Enable or disable streaming mode]:mode:(on off)' \
'--output-format=[Output format\: '\''text'\'' (default) or '\''json'\'' (JSONL, one JSON object per line)]:format:(text json)' \
'--share=[Share session to markdown file after completion in non-interactive mode (default\: ./copilot-session-<id>.md)]::path:_default' \
'*--add-dir=[Allow file access to a directory and load its .github/skills and .github/agents as trusted configuration (can be used multiple times). A relative path resolves against the session working directory (the --resume/--worktree/-C directory), whatever order the options appear in]:directory:_default' \
'*--attachment=[Attach a file (image or native document) to the initial prompt; only valid in non-interactive mode (can be used multiple times)]:path:_default' \
'*--disable-mcp-server=[Disable a specific MCP server (can be used multiple times)]:server-name:_default' \
'*--add-github-mcp-toolset=[Add a toolset to enable for the GitHub MCP server instead of the default CLI subset (can be used multiple times). Use "all" for all toolsets.]:toolset:_default' \
'*--add-github-mcp-tool=[Add a tool to enable for the GitHub MCP server instead of the default CLI subset (can be used multiple times). Use "*" for all tools.]:tool:_default' \
'*--plugin-dir=[Load a plugin from a local directory (can be used multiple times). A relative path resolves against the session working directory (the --resume/--worktree/-C directory), whatever order the options appear in]:directory:_default' \
'*--additional-mcp-config=[Additional MCP servers configuration as JSON string or file path (prefix with @) (can be used multiple times; augments config from ~/.copilot/mcp-config.json for this session). A relative @ path resolves against the session working directory (the --resume/--worktree/-C directory) and a leading ~/ expands to your home directory]:json:_default' \
'(--connect --cloud --environment --ahp --host-ahp)*--mcp-github-auth=[Send the signed-in GitHub account credential only to this explicit --additional-mcp-config server and approved origin. HTTPS is required except for literal loopback HTTP. Never put a token in this argument. Can be used multiple times.]:server=origin:_default' \
'*--additional-content-exclusion-policies=[Additional content exclusion policies as JSON string or file path (prefix with @) (can be used multiple times)]:json:_default' \
'*--allow-tool=[Tools the CLI has permission to use; will not prompt for permission]::tools:_default' \
'*--deny-tool=[Tools the CLI does not have permission to use; will not prompt for permission]::tools:_default' \
'*--available-tools=[Only these tools will be available to the model]::tools:_default' \
'*--excluded-tools=[These tools will not be available to the model]::tools:_default' \
'*--secret-env-vars=[Environment variable names whose values are stripped from shell and MCP server environments and redacted from output (e.g., --secret-env-vars=MY_KEY,OTHER_KEY)]::vars:_default' \
'*--allow-url=[Allow access to specific URLs or domains]::urls:_default' \
'*--deny-url=[Deny access to specific URLs or domains, takes precedence over --allow-url]::urls:_default' \
'--max-autopilot-continues=[Maximum number of continuation messages in autopilot mode]:count:_default' \
'(--autopilot)--mode=[Set the initial agent mode]:mode:(interactive plan autopilot)' \
'--bash-env=[Enable BASH_ENV support for bash shells (on|off)]::value:_default' \
'--mouse=[Enable mouse support in alt screen mode (on|off)]::value:_default' \
'--host=[Host address to bind server to (default\: 127.0.0.1)]:host:_default' \
'--sync-session=[Enable or disable read-only account history sync for this run only (omitted\: use configured/default behavior). Without a value, enables sync; does not enable incoming control.]::on|off:(on off)' \
'--port=[Port to listen on when in server mode (default\: random available port)]:port:_default' \
'--session-idle-timeout=[Session idle timeout in seconds (0 = disabled)]:seconds:_default' \
'--auth-token-env=[Read auth token from specified environment variable (for SDK use)]:var:_default' \
'--collect-debug-logs=[Collect debug logs for a session and save to a .tgz file]:sessionId:_default' \
'--collect-debug-logs-output=[Output path for --collect-debug-logs (default\: copilot-debug-logs-<sessionId>.tgz in cwd)]:path:_default' \
'(--environment --cloud)--ahp=[Experimental\: attach to an Agent Host Protocol host and run its sessions (default\: ws\://127.0.0.1\:8765)]::url:_default' \
'--ahp-authenticate=[Experimental\: share your GitHub credential with the --ahp servers for this launch using scheme github. Enable only for servers you trust. Off by default; requires --ahp.]:scheme:(github)' \
'(--cloud --ahp)--environment=[Experimental\: connect to an existing Mission Control environment]:uuid:_default' \
'(--environment --ahp --cloud --stdio --server --headless --acp -p --prompt --usage-output-file)--host-environment=[Start a headless Mission Control environment (no local listener unless --host-ahp is also set)]:name:_default' \
'--host-compute-id=[Stable environment compute identity override (default\: generate, persist, and reuse the CLI identity)]:id:_default' \
'(--host-ahp-disable-token)--host-ahp-token=[Use a fixed, nonempty local connection token for --host-ahp (default\: random required token). Visible in process arguments and shell history. GitHub authentication is still required.]:value:_default' \
'--host-ahp-listen=[Address --host-ahp binds, as host\:port]:address:_default' \
'--host-directory=[Hosted runtime working directory (default\: current working directory)]:directory:_default' \
'*--dynamic-retrieval=[Enable or disable embeddings-based dynamic retrieval per category and persist the choice (category\: skills). Repeatable, e.g. --dynamic-retrieval skills=off]:category=on|off:_default' \
'*--enable-mcp-server=[Enable an MCP server disabled in settings for this run only; nothing is persisted (can be used multiple times)]:server-name:_default' \
'--max-ai-credits=[Set max AI credits for this session]:credits:_default' \
'(--server --headless --acp --embedded-host)--usage-output-file=[Write final usage statistics as JSON to the specified file]:file:_default' \
'-v[show version information]' \
'--version[show version information]' \
'--fleet[Run the prompt in fleet mode (parallel subagent orchestration); combine with -i, -p, or piped stdin]' \
'(-i --interactive --server --headless --acp --cloud --connect --environment --ahp --host-ahp --ui-server --stdio -r --resume --continue --session-id)--trust-folder[Trust the resolved working directory'\''s configuration for one new prompt-mode session only (no saved trust or tool, path, or URL approvals)]' \
'-s[Output only the agent response (no stats), useful for scripting with -p]' \
'--silent[Output only the agent response (no stats), useful for scripting with -p]' \
'--disable-client-telemetry[Disable telemetry sent by the CLI (does not affect server-side telemetry)]' \
'--enable-memory[Enable memory in prompt mode (disabled by default)]' \
'--enable-reasoning-summaries[Deprecated compatibility flag (accepted but ignored)]' \
'--continue[Resume the most recent session]' \
'(-r --resume --continue --connect -n --name -i --interactive -p --prompt)--cloud[Create a cloud sandbox session and connect to it]' \
'--allow-all-tools[Allow all tools to run automatically without confirmation; required for non-interactive mode. Run \`copilot help environment\` for what COPILOT_ALLOW_ALL accepts and what exact "true" grants]' \
'--allow-all-paths[Disable file path verification and allow access to any path]' \
'--disallow-temp-dir[Prevent automatic access to the system temporary directory]' \
'--banner[Show the startup banner]' \
'--screen-reader[Enable screen reader optimizations]' \
'--plain-diff[Disable rich diff rendering (syntax highlighting via diff tool specified by git config)]' \
'--share-gist[Share session to a secret GitHub gist after completion in non-interactive mode]' \
'--disable-builtin-mcps[Disable all built-in MCP servers (currently\: github-mcp-server, githubiq)]' \
'--enable-all-github-mcp-tools[Enable all GitHub MCP server tools instead of the default CLI subset. Overrides --add-github-mcp-toolset and --add-github-mcp-tool options.]' \
'--allow-all-mcp-server-instructions[Include initialization instructions from all MCP servers in the system prompt instead of only allowlisted servers]' \
'--allow-all-urls[Allow access to all URLs without confirmation]' \
'--allow-all[Enable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls)]' \
'--yolo[Enable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls)]' \
'(--mode --plan)--autopilot[Start in autopilot mode]' \
'(--autopilot)--plan[Start in plan mode (combine with --mode autopilot to auto-approve the plan and implement it autonomously)]' \
'--experimental[Enable experimental features]' \
'--show-timing[Show LLM turn duration timing information. For accurate tool timing, consider using --allow-all-tools to avoid confirmation delays.]' \
'--server[Enable headless JSON-RPC server mode]' \
'--ui-server[Enable TUI with embedded JSON-RPC server]' \
'--headless[Enable headless JSON-RPC server mode (alias for --server)]' \
'--managed-server[Bootstrap a managed-server session under headless --server so a controller'\''s attach picker can drive it]' \
'--acp[Start as Agent Client Protocol server]' \
'--stdio[Use stdio transport for server mode (instead of TCP)]' \
'--disable-remote-sessions[Disable remote session access]' \
'--log-interactive-shells[Log raw PTY data from interactive shell sessions]' \
'--print-debug-info[Print CLI version, terminal capabilities, and detection-related env vars, then exit]' \
'(--cloud --environment --ahp --stdio --server --headless --acp -p --prompt)--host-ahp[Experimental\: serve AHP 1.0 with copilotd'\''s in-process backend]' \
'(--host-ahp-token)--host-ahp-disable-token[Disable only the local connection token for --host-ahp. GitHub authentication and authorization are still required.]' \
'--sandbox[Run this session'\''s shell commands inside the OS-level sandbox for this run only (does not change your saved sandbox setting)]' \
'--assisted-approval[Review tool permission requests with the assisted-approval safety judge instead of approving them outright. The judge is probabilistic and not a security boundary. Equivalent to the \`assisted\` mode of /permissions. Takes precedence over --allow-all-tools when the judge engages; requires --experimental or enabledFeatureFlags.AUTO_APPROVAL. (env\: COPILOT_ASSISTED_APPROVAL)]' \
'--embedded-host[Run as an in-process FFI embedded host (Rust engine driven over the C ABI; no stdio/TCP transport)]' \
'--no-custom-instructions[Disable loading of custom instructions from AGENTS.md and related files]' \
'--no-auto-update[Disable downloading CLI updates automatically. Copilot then runs the version bundled in the executable you launched rather than a newer previously downloaded one]' \
'--no-ask-user[Disable the ask_user tool (agent works autonomously without asking questions)]' \
'--no-color[Disable all color output]' \
'--no-experimental[Disable experimental features]' \
'--no-bash-env[Disable BASH_ENV support for bash shells]' \
'--no-mouse[Disable mouse support in alt screen mode]' \
'--no-auto-login[Disable automatic login detection (stored OAuth tokens and gh CLI)]' \
'--no-sandbox[Disable the OS-level sandbox for this run only (does not change your saved sandbox setting)]' \
'--no-eager-powershell-resolution[Disable background PowerShell prompt resolution on Windows]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_copilot_commands" \
"*::: :->copilot" \
&& ret=0
    case $state in
    (copilot)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-command-$line[1]:"
        case $line[1] in
            (app)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(login)
_arguments "${_arguments_options[@]}" : \
'--host=[GitHub host URL (default\: https\://github.com)]:host:_default' \
'--config-dir=[Set the configuration directory (deprecated\: use COPILOT_HOME env var)]:directory:_default' \
'(--web-flow)--device-code[Authenticate using the OAuth device code flow (default in remote or headless environments)]' \
'(--device-code)--web-flow[Authenticate using the browser (web) flow (default on local desktops)]' \
'(--device-code --web-flow)--with-token[Read an authentication token from standard input]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::topic -- Help topic (e.g., environment):_default' \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" : \
'--disable-client-telemetry[Disable telemetry sent by the CLI (does not affect server-side telemetry)]' \
'--sandbox[Run this session'\''s shell commands inside the OS-level sandbox for this run only (does not change your saved sandbox setting)]' \
'--experimental[Enable experimental features]' \
'--no-sandbox[Disable the OS-level sandbox for this run only (does not change your saved sandbox setting)]' \
'--no-experimental[Disable experimental features]' \
'--no-eager-powershell-resolution[Disable background PowerShell prompt resolution on Windows]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(config)
_arguments "${_arguments_options[@]}" : \
'(--rm)--list[List settings as key=value lines]' \
'(--list)--rm[Remove the key, or only the given item from a list]' \
'(--rm)--json[Output --list as JSON]' \
'(--repo --local)--global[Use your user settings file (the default)]' \
'(--global --local)--repo[Use the repository'\''s .github/copilot/settings.json]' \
'(--global --repo)--local[Use the repository'\''s .github/copilot/settings.local.json]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::key -- Setting key in dot notation:_default' \
'::value -- Value to set, append, or remove from a list with --rm:_default' \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::channel -- update channel:(stable prerelease)' \
&& ret=0
;;
(version)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(workflow)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_copilot__subcmd__workflow_commands" \
"*::: :->workflow" \
&& ret=0

    case $state in
    (workflow)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-workflow-command-$line[1]:"
        case $line[1] in
            (run)
_arguments "${_arguments_options[@]}" : \
'--args=[Workflow arguments as inline JSON or an @-prefixed JSON file]:json|@path:_default' \
'--result-file=[Write only the workflow result to this JSON file]:path:_default' \
'--output-format=[Output format\: '\''text'\'' (default) or '\''json'\'' (JSONL)]:format:(text json)' \
'-s[Suppress workflow progress output]' \
'--silent[Suppress workflow progress output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Registered dynamic workflow name:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(sessions)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_copilot__subcmd__sessions_commands" \
"*::: :->sessions" \
&& ret=0

    case $state in
    (sessions)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-sessions-command-$line[1]:"
        case $line[1] in
            (import)
_arguments "${_arguments_options[@]}" : \
'--output=[Output format]:format:(json)' \
'--working-directory=[Override the imported working directory]:path:_default' \
'--name=[Override the imported session name]:name:_default' \
'--dry-run[Validate without writing a session]' \
'-h[Print help]' \
'--help[Print help]' \
':input_file -- Semantic session JSONL file:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(memories)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_copilot__subcmd__memories_commands" \
"*::: :->memories" \
&& ret=0

    case $state in
    (memories)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-memories-command-$line[1]:"
        case $line[1] in
            (import)
_arguments "${_arguments_options[@]}" : \
'--output=[Output format]:format:(json)' \
'--on-conflict=[Conflict behavior]:behavior:(skip error)' \
'--dry-run[Validate without submitting memories]' \
'-h[Print help]' \
'--help[Print help]' \
':input_file -- Semantic memory JSONL file:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(plugin)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_copilot__subcmd__plugin_commands" \
"*::: :->plugin" \
&& ret=0

    case $state in
    (plugin)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-plugin-command-$line[1]:"
        case $line[1] in
            (install)
_arguments "${_arguments_options[@]}" : \
'--from-github=[Install a verified Skill or plugin from GitHub by its resource and revision IDs]:resource@revision:_default' \
'--descriptor-digest=[Descriptor digest for --from-github]:sha256:digest:_default' \
'--bundle-digest=[Bundle digest for --from-github]:sha256:digest:_default' \
'--schema-version=[Descriptor schema version for --from-github (default\: 1.0.0)]:version:_default' \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::source -- Plugin source (plugin@marketplace, owner/repo,
owner/repo\:path, or URL):_default' \
&& ret=0
;;
(uninstall)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Plugin name (plugin-name or plugin-name@marketplace-name):_default' \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--all[Update all installed plugins]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::name -- Plugin name (plugin-name@marketplace-name); omit when using
--all:_default' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--json[Output as JSON]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(enable)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Plugin name, name@marketplace, or direct-install source id:_default' \
&& ret=0
;;
(disable)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Plugin name, name@marketplace, or direct-install source id:_default' \
&& ret=0
;;
(marketplace)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_copilot__subcmd__plugin__subcmd__marketplace_commands" \
"*::: :->marketplace" \
&& ret=0

    case $state in
    (marketplace)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-plugin-marketplace-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':source -- Marketplace source (owner/repo for GitHub, URL, or local
path):_default' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-f[Force removal even if plugins are installed]' \
'--force[Force removal even if plugins are installed]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Marketplace name:_default' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--json[Output as JSON]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(browse)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--json[Output as JSON]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Marketplace name:_default' \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::name -- Marketplace name (omit to update all):_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(mcp)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_copilot__subcmd__mcp_commands" \
"*::: :->mcp" \
&& ret=0

    case $state in
    (mcp)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-mcp-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--json[Output as JSON]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--json[Output as JSON]' \
'--show-secrets[Show full environment variable and header values (masked by default)]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Server name:_default' \
&& ret=0
;;
(add)
_arguments "${_arguments_options[@]}" : \
'--transport=[Server transport]:transport:(stdio http sse)' \
'*--env=[Environment variable (KEY=VALUE, can be repeated)]:env:_default' \
'*--header=[HTTP header for remote servers, can be repeated]:header:_default' \
'--tools=[Tool filter\: "*" for all, comma-separated list, or "" for none]:tools:_default' \
'--timeout=[Timeout in milliseconds (1-4294967295)]:ms:_default' \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--json[Output added config as JSON]' \
'--show-secrets[Show full environment variable and header values in output, masked by default]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Server name:_default' \
'*::url_or_command_and_args -- URL for remote servers, or command and args for local
servers (after --):_default' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Server name:_default' \
&& ret=0
;;
(enable)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- MCP server name:_default' \
&& ret=0
;;
(disable)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- MCP server name:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(skill)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_copilot__subcmd__skill_commands" \
"*::: :->skill" \
&& ret=0

    case $state in
    (skill)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-skill-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--json[Output as JSON]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(add)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--project[Install the skill into the project'\''s .github/skills directory]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':source -- Skill source (file path, URL, or directory):_default' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name_or_directory -- Skill name or custom skill directory:_default' \
&& ret=0
;;
(enable)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Skill name:_default' \
&& ret=0
;;
(disable)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Skill name:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(instruction)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_copilot__subcmd__instruction_commands" \
"*::: :->instruction" \
&& ret=0

    case $state in
    (instruction)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-instruction-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--json[Output as JSON]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
        esac
    ;;
esac
;;
(lsp)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_copilot__subcmd__lsp_commands" \
"*::: :->lsp" \
&& ret=0

    case $state in
    (lsp)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-lsp-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
'--config-dir=[Path to the configuration directory (deprecated\: use COPILOT_HOME env var)]:path:_default' \
'--json[Output as JSON]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
        esac
    ;;
esac
;;
(sandbox)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_copilot__subcmd__sandbox_commands" \
"*::: :->sandbox" \
&& ret=0

    case $state in
    (sandbox)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-sandbox-command-$line[1]:"
        case $line[1] in
            (ca)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_copilot__subcmd__sandbox__subcmd__ca_commands" \
"*::: :->ca" \
&& ret=0

    case $state in
    (ca)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:copilot-sandbox-ca-command-$line[1]:"
        case $line[1] in
            (status)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(rotate)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(create)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(trust)
_arguments "${_arguments_options[@]}" : \
'*--allow-host=[Also allow a host the certificate may be constrained to (can be used multiple times)]:host:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::certificate_file -- Certificate file that `copilot sandbox ca create` printed
(default\: your own):_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(taskbar-selftest)
_arguments "${_arguments_options[@]}" : \
'--strict[Exit non-zero unless tasks.json was actually written]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(completion)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':shell -- Target shell:(bash zsh fish)' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_copilot_commands] )) ||
_copilot_commands() {
    local commands; commands=(
'app:Open the GitHub Copilot app' \
'login:Authenticate with Copilot' \
'help:Display help information' \
'init:Initialize Copilot instructions' \
'config:Manage configuration settings' \
'update:Download the latest version' \
'version:Display version information' \
'workflow:Run dynamic workflows' \
'sessions:Manage saved sessions' \
'memories:Manage memories' \
'plugin:Manage plugins' \
'mcp:Manage MCP servers' \
'skill:Manage skills' \
'instruction:Inspect instruction sources' \
'lsp:Inspect language server configuration' \
'sandbox:Manage command sandboxing' \
'taskbar-selftest:Diagnose the Windows taskbar-presence (Forerunner) pipeline' \
'completion:Generate a shell completion script' \
    )
    _describe -t commands 'copilot commands' commands "$@"
}
(( $+functions[_copilot__subcmd__app_commands] )) ||
_copilot__subcmd__app_commands() {
    local commands; commands=()
    _describe -t commands 'copilot app commands' commands "$@"
}
(( $+functions[_copilot__subcmd__completion_commands] )) ||
_copilot__subcmd__completion_commands() {
    local commands; commands=()
    _describe -t commands 'copilot completion commands' commands "$@"
}
(( $+functions[_copilot__subcmd__config_commands] )) ||
_copilot__subcmd__config_commands() {
    local commands; commands=()
    _describe -t commands 'copilot config commands' commands "$@"
}
(( $+functions[_copilot__subcmd__help_commands] )) ||
_copilot__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'copilot help commands' commands "$@"
}
(( $+functions[_copilot__subcmd__init_commands] )) ||
_copilot__subcmd__init_commands() {
    local commands; commands=()
    _describe -t commands 'copilot init commands' commands "$@"
}
(( $+functions[_copilot__subcmd__instruction_commands] )) ||
_copilot__subcmd__instruction_commands() {
    local commands; commands=(
'list:List discovered instruction sources' \
    )
    _describe -t commands 'copilot instruction commands' commands "$@"
}
(( $+functions[_copilot__subcmd__instruction__subcmd__list_commands] )) ||
_copilot__subcmd__instruction__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'copilot instruction list commands' commands "$@"
}
(( $+functions[_copilot__subcmd__login_commands] )) ||
_copilot__subcmd__login_commands() {
    local commands; commands=()
    _describe -t commands 'copilot login commands' commands "$@"
}
(( $+functions[_copilot__subcmd__lsp_commands] )) ||
_copilot__subcmd__lsp_commands() {
    local commands; commands=(
'list:List configured language servers' \
    )
    _describe -t commands 'copilot lsp commands' commands "$@"
}
(( $+functions[_copilot__subcmd__lsp__subcmd__list_commands] )) ||
_copilot__subcmd__lsp__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'copilot lsp list commands' commands "$@"
}
(( $+functions[_copilot__subcmd__mcp_commands] )) ||
_copilot__subcmd__mcp_commands() {
    local commands; commands=(
'list:List configured MCP servers' \
'get:Show server details' \
'add:Add an MCP server' \
'remove:Remove an MCP server' \
'enable:Enable an MCP server' \
'disable:Disable an MCP server' \
    )
    _describe -t commands 'copilot mcp commands' commands "$@"
}
(( $+functions[_copilot__subcmd__mcp__subcmd__add_commands] )) ||
_copilot__subcmd__mcp__subcmd__add_commands() {
    local commands; commands=()
    _describe -t commands 'copilot mcp add commands' commands "$@"
}
(( $+functions[_copilot__subcmd__mcp__subcmd__disable_commands] )) ||
_copilot__subcmd__mcp__subcmd__disable_commands() {
    local commands; commands=()
    _describe -t commands 'copilot mcp disable commands' commands "$@"
}
(( $+functions[_copilot__subcmd__mcp__subcmd__enable_commands] )) ||
_copilot__subcmd__mcp__subcmd__enable_commands() {
    local commands; commands=()
    _describe -t commands 'copilot mcp enable commands' commands "$@"
}
(( $+functions[_copilot__subcmd__mcp__subcmd__get_commands] )) ||
_copilot__subcmd__mcp__subcmd__get_commands() {
    local commands; commands=()
    _describe -t commands 'copilot mcp get commands' commands "$@"
}
(( $+functions[_copilot__subcmd__mcp__subcmd__list_commands] )) ||
_copilot__subcmd__mcp__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'copilot mcp list commands' commands "$@"
}
(( $+functions[_copilot__subcmd__mcp__subcmd__remove_commands] )) ||
_copilot__subcmd__mcp__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'copilot mcp remove commands' commands "$@"
}
(( $+functions[_copilot__subcmd__memories_commands] )) ||
_copilot__subcmd__memories_commands() {
    local commands; commands=(
'import:Import semantic memories through the native memory service' \
    )
    _describe -t commands 'copilot memories commands' commands "$@"
}
(( $+functions[_copilot__subcmd__memories__subcmd__import_commands] )) ||
_copilot__subcmd__memories__subcmd__import_commands() {
    local commands; commands=()
    _describe -t commands 'copilot memories import commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin_commands] )) ||
_copilot__subcmd__plugin_commands() {
    local commands; commands=(
'install:Install a plugin' \
'uninstall:Uninstall a plugin' \
'update:Update a plugin' \
'list:List installed and --plugin-dir plugins' \
'enable:Enable a plugin' \
'disable:Disable a plugin' \
'marketplace:Manage plugin marketplaces' \
    )
    _describe -t commands 'copilot plugin commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__disable_commands] )) ||
_copilot__subcmd__plugin__subcmd__disable_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin disable commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__enable_commands] )) ||
_copilot__subcmd__plugin__subcmd__enable_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin enable commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__install_commands] )) ||
_copilot__subcmd__plugin__subcmd__install_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin install commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__list_commands] )) ||
_copilot__subcmd__plugin__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin list commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__marketplace_commands] )) ||
_copilot__subcmd__plugin__subcmd__marketplace_commands() {
    local commands; commands=(
'add:Add a marketplace' \
'remove:Remove a marketplace' \
'list:List registered marketplaces' \
'browse:Browse plugins in a marketplace' \
'update:Update marketplace plugin catalogs' \
    )
    _describe -t commands 'copilot plugin marketplace commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__marketplace__subcmd__add_commands] )) ||
_copilot__subcmd__plugin__subcmd__marketplace__subcmd__add_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin marketplace add commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__marketplace__subcmd__browse_commands] )) ||
_copilot__subcmd__plugin__subcmd__marketplace__subcmd__browse_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin marketplace browse commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__marketplace__subcmd__list_commands] )) ||
_copilot__subcmd__plugin__subcmd__marketplace__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin marketplace list commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__marketplace__subcmd__remove_commands] )) ||
_copilot__subcmd__plugin__subcmd__marketplace__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin marketplace remove commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__marketplace__subcmd__update_commands] )) ||
_copilot__subcmd__plugin__subcmd__marketplace__subcmd__update_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin marketplace update commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__uninstall_commands] )) ||
_copilot__subcmd__plugin__subcmd__uninstall_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin uninstall commands' commands "$@"
}
(( $+functions[_copilot__subcmd__plugin__subcmd__update_commands] )) ||
_copilot__subcmd__plugin__subcmd__update_commands() {
    local commands; commands=()
    _describe -t commands 'copilot plugin update commands' commands "$@"
}
(( $+functions[_copilot__subcmd__sandbox_commands] )) ||
_copilot__subcmd__sandbox_commands() {
    local commands; commands=(
'ca:Manage the credential proxy certificate authority' \
    )
    _describe -t commands 'copilot sandbox commands' commands "$@"
}
(( $+functions[_copilot__subcmd__sandbox__subcmd__ca_commands] )) ||
_copilot__subcmd__sandbox__subcmd__ca_commands() {
    local commands; commands=(
'status:Show whether the OS trusts the certificate authority' \
'rotate:Replace the certificate authority' \
'remove:Remove the certificate authority from OS trust' \
'create:Create the certificate authority without trusting it' \
'trust:Add the certificate authority to OS trust' \
    )
    _describe -t commands 'copilot sandbox ca commands' commands "$@"
}
(( $+functions[_copilot__subcmd__sandbox__subcmd__ca__subcmd__create_commands] )) ||
_copilot__subcmd__sandbox__subcmd__ca__subcmd__create_commands() {
    local commands; commands=()
    _describe -t commands 'copilot sandbox ca create commands' commands "$@"
}
(( $+functions[_copilot__subcmd__sandbox__subcmd__ca__subcmd__remove_commands] )) ||
_copilot__subcmd__sandbox__subcmd__ca__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'copilot sandbox ca remove commands' commands "$@"
}
(( $+functions[_copilot__subcmd__sandbox__subcmd__ca__subcmd__rotate_commands] )) ||
_copilot__subcmd__sandbox__subcmd__ca__subcmd__rotate_commands() {
    local commands; commands=()
    _describe -t commands 'copilot sandbox ca rotate commands' commands "$@"
}
(( $+functions[_copilot__subcmd__sandbox__subcmd__ca__subcmd__status_commands] )) ||
_copilot__subcmd__sandbox__subcmd__ca__subcmd__status_commands() {
    local commands; commands=()
    _describe -t commands 'copilot sandbox ca status commands' commands "$@"
}
(( $+functions[_copilot__subcmd__sandbox__subcmd__ca__subcmd__trust_commands] )) ||
_copilot__subcmd__sandbox__subcmd__ca__subcmd__trust_commands() {
    local commands; commands=()
    _describe -t commands 'copilot sandbox ca trust commands' commands "$@"
}
(( $+functions[_copilot__subcmd__sessions_commands] )) ||
_copilot__subcmd__sessions_commands() {
    local commands; commands=(
'import:Import a semantic session from JSONL' \
    )
    _describe -t commands 'copilot sessions commands' commands "$@"
}
(( $+functions[_copilot__subcmd__sessions__subcmd__import_commands] )) ||
_copilot__subcmd__sessions__subcmd__import_commands() {
    local commands; commands=()
    _describe -t commands 'copilot sessions import commands' commands "$@"
}
(( $+functions[_copilot__subcmd__skill_commands] )) ||
_copilot__subcmd__skill_commands() {
    local commands; commands=(
'list:List available skills' \
'add:Add a skill from a file, URL, or directory' \
'remove:Remove a skill or custom skill directory' \
'enable:Enable a skill' \
'disable:Disable a skill' \
    )
    _describe -t commands 'copilot skill commands' commands "$@"
}
(( $+functions[_copilot__subcmd__skill__subcmd__add_commands] )) ||
_copilot__subcmd__skill__subcmd__add_commands() {
    local commands; commands=()
    _describe -t commands 'copilot skill add commands' commands "$@"
}
(( $+functions[_copilot__subcmd__skill__subcmd__disable_commands] )) ||
_copilot__subcmd__skill__subcmd__disable_commands() {
    local commands; commands=()
    _describe -t commands 'copilot skill disable commands' commands "$@"
}
(( $+functions[_copilot__subcmd__skill__subcmd__enable_commands] )) ||
_copilot__subcmd__skill__subcmd__enable_commands() {
    local commands; commands=()
    _describe -t commands 'copilot skill enable commands' commands "$@"
}
(( $+functions[_copilot__subcmd__skill__subcmd__list_commands] )) ||
_copilot__subcmd__skill__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'copilot skill list commands' commands "$@"
}
(( $+functions[_copilot__subcmd__skill__subcmd__remove_commands] )) ||
_copilot__subcmd__skill__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'copilot skill remove commands' commands "$@"
}
(( $+functions[_copilot__subcmd__taskbar-selftest_commands] )) ||
_copilot__subcmd__taskbar-selftest_commands() {
    local commands; commands=()
    _describe -t commands 'copilot taskbar-selftest commands' commands "$@"
}
(( $+functions[_copilot__subcmd__update_commands] )) ||
_copilot__subcmd__update_commands() {
    local commands; commands=()
    _describe -t commands 'copilot update commands' commands "$@"
}
(( $+functions[_copilot__subcmd__version_commands] )) ||
_copilot__subcmd__version_commands() {
    local commands; commands=()
    _describe -t commands 'copilot version commands' commands "$@"
}
(( $+functions[_copilot__subcmd__workflow_commands] )) ||
_copilot__subcmd__workflow_commands() {
    local commands; commands=(
'run:Run a registered dynamic workflow' \
    )
    _describe -t commands 'copilot workflow commands' commands "$@"
}
(( $+functions[_copilot__subcmd__workflow__subcmd__run_commands] )) ||
_copilot__subcmd__workflow__subcmd__run_commands() {
    local commands; commands=()
    _describe -t commands 'copilot workflow run commands' commands "$@"
}

if [ "$funcstack[1]" = "_copilot" ]; then
    _copilot "$@"
else
    compdef _copilot copilot
fi
