# AUTOMATICALLY GENERATED by `shtab`



_shtab_aider_option_strings=('-h' '--help' '--model' '--openai-api-key' '--anthropic-api-key' '--openai-api-base' '--openai-api-type' '--openai-api-version' '--openai-api-deployment-id' '--openai-organization-id' '--set-env' '--api-key' '--list-models' '--models' '--model-settings-file' '--model-metadata-file' '--alias' '--reasoning-effort' '--thinking-tokens' '--verify-ssl' '--no-verify-ssl' '--timeout' '--edit-format' '--chat-mode' '--architect' '--auto-accept-architect' '--no-auto-accept-architect' '--weak-model' '--editor-model' '--editor-edit-format' '--show-model-warnings' '--no-show-model-warnings' '--check-model-accepts-settings' '--no-check-model-accepts-settings' '--max-chat-history-tokens' '--cache-prompts' '--no-cache-prompts' '--cache-keepalive-pings' '--map-tokens' '--map-refresh' '--map-multiplier-no-files' '--input-history-file' '--chat-history-file' '--restore-chat-history' '--no-restore-chat-history' '--llm-history-file' '--dark-mode' '--light-mode' '--pretty' '--no-pretty' '--stream' '--no-stream' '--user-input-color' '--tool-output-color' '--tool-error-color' '--tool-warning-color' '--assistant-output-color' '--completion-menu-color' '--completion-menu-bg-color' '--completion-menu-current-color' '--completion-menu-current-bg-color' '--code-theme' '--show-diffs' '--git' '--no-git' '--gitignore' '--no-gitignore' '--add-gitignore-files' '--no-add-gitignore-files' '--aiderignore' '--subtree-only' '--auto-commits' '--no-auto-commits' '--dirty-commits' '--no-dirty-commits' '--attribute-author' '--no-attribute-author' '--attribute-committer' '--no-attribute-committer' '--attribute-commit-message-author' '--no-attribute-commit-message-author' '--attribute-commit-message-committer' '--no-attribute-commit-message-committer' '--attribute-co-authored-by' '--no-attribute-co-authored-by' '--git-commit-verify' '--no-git-commit-verify' '--commit' '--commit-prompt' '--dry-run' '--no-dry-run' '--skip-sanity-check-repo' '--watch-files' '--no-watch-files' '--lint' '--lint-cmd' '--auto-lint' '--no-auto-lint' '--test-cmd' '--auto-test' '--no-auto-test' '--test' '--analytics' '--no-analytics' '--analytics-log' '--analytics-disable' '--analytics-posthog-host' '--analytics-posthog-project-api-key' '--just-check-update' '--check-update' '--no-check-update' '--show-release-notes' '--no-show-release-notes' '--install-main-branch' '--upgrade' '--update' '--version' '--message' '--msg' '-m' '--message-file' '-f' '--gui' '--no-gui' '--browser' '--no-browser' '--copy-paste' '--no-copy-paste' '--apply' '--apply-clipboard-edits' '--exit' '--show-repo-map' '--show-prompts' '--voice-format' '--voice-language' '--voice-input-device' '--disable-playwright' '--file' '--read' '--vim' '--chat-language' '--commit-language' '--yes-always' '-v' '--verbose' '--load' '--encoding' '--line-endings' '-c' '--config' '--env-file' '--suggest-shell-commands' '--no-suggest-shell-commands' '--fancy-input' '--no-fancy-input' '--multiline' '--no-multiline' '--notifications' '--no-notifications' '--notifications-command' '--detect-urls' '--no-detect-urls' '--editor' '--shell-completions' '--opus' '--sonnet' '--haiku' '--4' '-4' '--4o' '--mini' '--4-turbo' '--35turbo' '--35-turbo' '--3' '-3' '--deepseek' '--o1-mini' '--o1-preview')

_shtab_aider_pos_0_COMPGEN=_shtab_compgen_files
_shtab_aider___model_settings_file_COMPGEN=_shtab_compgen_files
_shtab_aider___model_metadata_file_COMPGEN=_shtab_compgen_files
_shtab_aider___input_history_file_COMPGEN=_shtab_compgen_files
_shtab_aider___chat_history_file_COMPGEN=_shtab_compgen_files
_shtab_aider___llm_history_file_COMPGEN=_shtab_compgen_files
_shtab_aider___aiderignore_COMPGEN=_shtab_compgen_files
_shtab_aider___analytics_log_COMPGEN=_shtab_compgen_files
_shtab_aider___message_file_COMPGEN=_shtab_compgen_files
_shtab_aider__f_COMPGEN=_shtab_compgen_files
_shtab_aider___apply_COMPGEN=_shtab_compgen_files
_shtab_aider___file_COMPGEN=_shtab_compgen_files
_shtab_aider___read_COMPGEN=_shtab_compgen_files
_shtab_aider___load_COMPGEN=_shtab_compgen_files
_shtab_aider__c_COMPGEN=_shtab_compgen_files
_shtab_aider___config_COMPGEN=_shtab_compgen_files
_shtab_aider___env_file_COMPGEN=_shtab_compgen_files

_shtab_aider___edit_format_choices=('architect' 'ask' 'context' 'diff' 'diff-fenced' 'editor-diff' 'editor-diff-fenced' 'editor-whole' 'help' 'patch' 'udiff' 'udiff-simple' 'whole')
_shtab_aider___chat_mode_choices=('architect' 'ask' 'context' 'diff' 'diff-fenced' 'editor-diff' 'editor-diff-fenced' 'editor-whole' 'help' 'patch' 'udiff' 'udiff-simple' 'whole')
_shtab_aider___editor_edit_format_choices=('architect' 'ask' 'context' 'diff' 'diff-fenced' 'editor-diff' 'editor-diff-fenced' 'editor-whole' 'help' 'patch' 'udiff' 'udiff-simple' 'whole')
_shtab_aider___map_refresh_choices=('auto' 'always' 'files' 'manual')
_shtab_aider___voice_format_choices=('wav' 'mp3' 'webm')
_shtab_aider___line_endings_choices=('platform' 'lf' 'crlf')
_shtab_aider___shell_completions_choices=('bash' 'tcsh' 'zsh')

_shtab_aider_pos_0_nargs=*
_shtab_aider__h_nargs=0
_shtab_aider___help_nargs=0
_shtab_aider___verify_ssl_nargs=0
_shtab_aider___no_verify_ssl_nargs=0
_shtab_aider___architect_nargs=0
_shtab_aider___auto_accept_architect_nargs=0
_shtab_aider___no_auto_accept_architect_nargs=0
_shtab_aider___show_model_warnings_nargs=0
_shtab_aider___no_show_model_warnings_nargs=0
_shtab_aider___check_model_accepts_settings_nargs=0
_shtab_aider___no_check_model_accepts_settings_nargs=0
_shtab_aider___cache_prompts_nargs=0
_shtab_aider___no_cache_prompts_nargs=0
_shtab_aider___restore_chat_history_nargs=0
_shtab_aider___no_restore_chat_history_nargs=0
_shtab_aider___dark_mode_nargs=0
_shtab_aider___light_mode_nargs=0
_shtab_aider___pretty_nargs=0
_shtab_aider___no_pretty_nargs=0
_shtab_aider___stream_nargs=0
_shtab_aider___no_stream_nargs=0
_shtab_aider___show_diffs_nargs=0
_shtab_aider___git_nargs=0
_shtab_aider___no_git_nargs=0
_shtab_aider___gitignore_nargs=0
_shtab_aider___no_gitignore_nargs=0
_shtab_aider___add_gitignore_files_nargs=0
_shtab_aider___no_add_gitignore_files_nargs=0
_shtab_aider___subtree_only_nargs=0
_shtab_aider___auto_commits_nargs=0
_shtab_aider___no_auto_commits_nargs=0
_shtab_aider___dirty_commits_nargs=0
_shtab_aider___no_dirty_commits_nargs=0
_shtab_aider___attribute_author_nargs=0
_shtab_aider___no_attribute_author_nargs=0
_shtab_aider___attribute_committer_nargs=0
_shtab_aider___no_attribute_committer_nargs=0
_shtab_aider___attribute_commit_message_author_nargs=0
_shtab_aider___no_attribute_commit_message_author_nargs=0
_shtab_aider___attribute_commit_message_committer_nargs=0
_shtab_aider___no_attribute_commit_message_committer_nargs=0
_shtab_aider___attribute_co_authored_by_nargs=0
_shtab_aider___no_attribute_co_authored_by_nargs=0
_shtab_aider___git_commit_verify_nargs=0
_shtab_aider___no_git_commit_verify_nargs=0
_shtab_aider___commit_nargs=0
_shtab_aider___dry_run_nargs=0
_shtab_aider___no_dry_run_nargs=0
_shtab_aider___skip_sanity_check_repo_nargs=0
_shtab_aider___watch_files_nargs=0
_shtab_aider___no_watch_files_nargs=0
_shtab_aider___lint_nargs=0
_shtab_aider___auto_lint_nargs=0
_shtab_aider___no_auto_lint_nargs=0
_shtab_aider___auto_test_nargs=0
_shtab_aider___no_auto_test_nargs=0
_shtab_aider___test_nargs=0
_shtab_aider___analytics_nargs=0
_shtab_aider___no_analytics_nargs=0
_shtab_aider___analytics_disable_nargs=0
_shtab_aider___just_check_update_nargs=0
_shtab_aider___check_update_nargs=0
_shtab_aider___no_check_update_nargs=0
_shtab_aider___show_release_notes_nargs=0
_shtab_aider___no_show_release_notes_nargs=0
_shtab_aider___install_main_branch_nargs=0
_shtab_aider___upgrade_nargs=0
_shtab_aider___update_nargs=0
_shtab_aider___version_nargs=0
_shtab_aider___gui_nargs=0
_shtab_aider___no_gui_nargs=0
_shtab_aider___browser_nargs=0
_shtab_aider___no_browser_nargs=0
_shtab_aider___copy_paste_nargs=0
_shtab_aider___no_copy_paste_nargs=0
_shtab_aider___apply_clipboard_edits_nargs=0
_shtab_aider___exit_nargs=0
_shtab_aider___show_repo_map_nargs=0
_shtab_aider___show_prompts_nargs=0
_shtab_aider___disable_playwright_nargs=0
_shtab_aider___vim_nargs=0
_shtab_aider___yes_always_nargs=0
_shtab_aider__v_nargs=0
_shtab_aider___verbose_nargs=0
_shtab_aider___suggest_shell_commands_nargs=0
_shtab_aider___no_suggest_shell_commands_nargs=0
_shtab_aider___fancy_input_nargs=0
_shtab_aider___no_fancy_input_nargs=0
_shtab_aider___multiline_nargs=0
_shtab_aider___no_multiline_nargs=0
_shtab_aider___notifications_nargs=0
_shtab_aider___no_notifications_nargs=0
_shtab_aider___detect_urls_nargs=0
_shtab_aider___no_detect_urls_nargs=0
_shtab_aider___opus_nargs=0
_shtab_aider___sonnet_nargs=0
_shtab_aider___haiku_nargs=0
_shtab_aider___4_nargs=0
_shtab_aider__4_nargs=0
_shtab_aider___4o_nargs=0
_shtab_aider___mini_nargs=0
_shtab_aider___4_turbo_nargs=0
_shtab_aider___35turbo_nargs=0
_shtab_aider___35_turbo_nargs=0
_shtab_aider___3_nargs=0
_shtab_aider__3_nargs=0
_shtab_aider___deepseek_nargs=0
_shtab_aider___o1_mini_nargs=0
_shtab_aider___o1_preview_nargs=0


# $1=COMP_WORDS[1]
_shtab_compgen_files() {
  compgen -f -- $1  # files
}

# $1=COMP_WORDS[1]
_shtab_compgen_dirs() {
  compgen -d -- $1  # recurse into subdirs
}

# $1=COMP_WORDS[1]
_shtab_replace_nonword() {
  echo "${1//[^[:word:]]/_}"
}

# set default values (called for the initial parser & any subparsers)
_set_parser_defaults() {
  local subparsers_var="${prefix}_subparsers[@]"
  sub_parsers=${!subparsers_var-}

  local current_option_strings_var="${prefix}_option_strings[@]"
  current_option_strings=${!current_option_strings_var}

  completed_positional_actions=0

  _set_new_action "pos_${completed_positional_actions}" true
}

# $1=action identifier
# $2=positional action (bool)
# set all identifiers for an action's parameters
_set_new_action() {
  current_action="${prefix}_$(_shtab_replace_nonword $1)"

  local current_action_compgen_var=${current_action}_COMPGEN
  current_action_compgen="${!current_action_compgen_var-}"

  local current_action_choices_var="${current_action}_choices[@]"
  current_action_choices="${!current_action_choices_var-}"

  local current_action_nargs_var="${current_action}_nargs"
  if [ -n "${!current_action_nargs_var-}" ]; then
    current_action_nargs="${!current_action_nargs_var}"
  else
    current_action_nargs=1
  fi

  current_action_args_start_index=$(( $word_index + 1 - $pos_only ))

  current_action_is_positional=$2
}

# Notes:
# `COMPREPLY`: what will be rendered after completion is triggered
# `completing_word`: currently typed word to generate completions for
# `${!var}`: evaluates the content of `var` and expand its content as a variable
#     hello="world"
#     x="hello"
#     ${!x} -> ${hello} -> "world"
_shtab_aider() {
  local completing_word="${COMP_WORDS[COMP_CWORD]}"
  local previous_word="${COMP_WORDS[COMP_CWORD-1]}"
  local completed_positional_actions
  local current_action
  local current_action_args_start_index
  local current_action_choices
  local current_action_compgen
  local current_action_is_positional
  local current_action_nargs
  local current_option_strings
  local sub_parsers
  COMPREPLY=()

  local prefix=_shtab_aider
  local word_index=0
  local pos_only=0 # "--" delimeter not encountered yet
  _set_parser_defaults
  word_index=1

  # determine what arguments are appropriate for the current state
  # of the arg parser
  while [ $word_index -ne $COMP_CWORD ]; do
    local this_word="${COMP_WORDS[$word_index]}"

    if [[ $pos_only = 1 || " $this_word " != " -- " ]]; then
      if [[ -n $sub_parsers && " ${sub_parsers[@]} " == *" ${this_word} "* ]]; then
        # valid subcommand: add it to the prefix & reset the current action
        prefix="${prefix}_$(_shtab_replace_nonword $this_word)"
        _set_parser_defaults
      fi

      if [[ " ${current_option_strings[@]} " == *" ${this_word} "* ]]; then
        # a new action should be acquired (due to recognised option string or
        # no more input expected from current action);
        # the next positional action can fill in here
        _set_new_action $this_word false
      fi

      if [[ "$current_action_nargs" != "*" ]] && \
         [[ "$current_action_nargs" != "+" ]] && \
         [[ "$current_action_nargs" != "?" ]] && \
         [[ "$current_action_nargs" != *"..." ]] && \
         (( $word_index + 1 - $current_action_args_start_index - $pos_only >= \
            $current_action_nargs )); then
        $current_action_is_positional && let "completed_positional_actions += 1"
        _set_new_action "pos_${completed_positional_actions}" true
      fi
    else
      pos_only=1 # "--" delimeter encountered
    fi

    let "word_index+=1"
  done

  # Generate the completions

  if [[ $pos_only = 0 && "${completing_word}" == -* ]]; then
    # optional argument started: use option strings
    COMPREPLY=( $(compgen -W "${current_option_strings[*]}" -- "${completing_word}") )
  elif [[ "${previous_word}" == ">" || "${previous_word}" == ">>" ||
          "${previous_word}" =~ ^[12]">" || "${previous_word}" =~ ^[12]">>" ]]; then
    # handle redirection operators
    COMPREPLY=( $(compgen -f -- "${completing_word}") )
  else
    # use choices & compgen
    local IFS=$'\n' # items may contain spaces, so delimit using newline
    COMPREPLY=( $([ -n "${current_action_compgen}" ] \
                  && "${current_action_compgen}" "${completing_word}") )
    unset IFS
    COMPREPLY+=( $(compgen -W "${current_action_choices[*]}" -- "${completing_word}") )
  fi

  return 0
}

complete -o filenames -F _shtab_aider aider
