#compdef aider

# AUTOMATICALLY GENERATED by `shtab`


_shtab_aider_commands() {
  local _commands=(
    
  )
  _describe 'aider commands' _commands
}

_shtab_aider_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  "--model[Specify the model to use for the main chat]:model:"
  "--openai-api-key[Specify the OpenAI API key]:openai_api_key:"
  "--anthropic-api-key[Specify the Anthropic API key]:anthropic_api_key:"
  "--openai-api-base[Specify the api base url]:openai_api_base:"
  "--openai-api-type[(deprecated, use --set-env OPENAI_API_TYPE\=\<value\>)]:openai_api_type:"
  "--openai-api-version[(deprecated, use --set-env OPENAI_API_VERSION\=\<value\>)]:openai_api_version:"
  "--openai-api-deployment-id[(deprecated, use --set-env OPENAI_API_DEPLOYMENT_ID\=\<value\>)]:openai_api_deployment_id:"
  "--openai-organization-id[(deprecated, use --set-env OPENAI_ORGANIZATION\=\<value\>)]:openai_organization_id:"
  "*--set-env[Set an environment variable (to control API settings, can be used multiple times)]:set_env:"
  "*--api-key[Set an API key for a provider (eg\: --api-key provider\=\<key\> sets PROVIDER_API_KEY\=\<key\>)]:api_key:"
  {--list-models,--models}"[List known models which match the (partial) MODEL name]:list_models:"
  "--model-settings-file[Specify a file with aider model settings for unknown models]:model_settings_file:_files"
  "--model-metadata-file[Specify a file with context window and costs for unknown models]:model_metadata_file:_files"
  "*--alias[Add a model alias (can be used multiple times)]:alias:"
  "--reasoning-effort[Set the reasoning_effort API parameter (default\: not set)]:reasoning_effort:"
  "--thinking-tokens[Set the thinking token budget for models that support it. Use 0 to disable. (default\: not set)]:thinking_tokens:"
  {--verify-ssl,--no-verify-ssl}"[Verify the SSL cert when connecting to models (default\: True)]:verify_ssl:"
  "--timeout[Timeout in seconds for API calls (default\: None)]:timeout:"
  {--edit-format,--chat-mode}"[Specify what edit format the LLM should use (default depends on model)]:edit_format:(architect ask context diff diff-fenced editor-diff editor-diff-fenced editor-whole help patch udiff udiff-simple whole)"
  "--architect[Use architect edit format for the main chat]"
  {--auto-accept-architect,--no-auto-accept-architect}"[Enable\/disable automatic acceptance of architect changes (default\: True)]:auto_accept_architect:"
  "--weak-model[Specify the model to use for commit messages and chat history summarization (default depends on --model)]:weak_model:"
  "--editor-model[Specify the model to use for editor tasks (default depends on --model)]:editor_model:"
  "--editor-edit-format[Specify the edit format for the editor model (default\: depends on editor model)]:editor_edit_format:(architect ask context diff diff-fenced editor-diff editor-diff-fenced editor-whole help patch udiff udiff-simple whole)"
  {--show-model-warnings,--no-show-model-warnings}"[Only work with models that have meta-data available (default\: True)]:show_model_warnings:"
  {--check-model-accepts-settings,--no-check-model-accepts-settings}"[Check if model accepts settings like reasoning_effort\/thinking_tokens (default\: True)]:check_model_accepts_settings:"
  "--max-chat-history-tokens[Soft limit on tokens for chat history, after which summarization begins. If unspecified, defaults to the model\'s max_chat_history_tokens.]:max_chat_history_tokens:"
  {--cache-prompts,--no-cache-prompts}"[Enable caching of prompts (default\: False)]:cache_prompts:"
  "--cache-keepalive-pings[Number of times to ping at 5min intervals to keep prompt cache warm (default\: 0)]:cache_keepalive_pings:"
  "--map-tokens[Suggested number of tokens to use for repo map, use 0 to disable]:map_tokens:"
  "--map-refresh[Control how often the repo map is refreshed. Options\: auto, always, files, manual (default\: auto)]:map_refresh:(auto always files manual)"
  "--map-multiplier-no-files[Multiplier for map tokens when no files are specified (default\: 2)]:map_multiplier_no_files:"
  "--input-history-file[Specify the chat input history file (default\: .aider.input.history)]:input_history_file:_files"
  "--chat-history-file[Specify the chat history file (default\: .aider.chat.history.md)]:chat_history_file:_files"
  {--restore-chat-history,--no-restore-chat-history}"[Restore the previous chat history messages (default\: False)]:restore_chat_history:"
  "--llm-history-file[Log the conversation with the LLM to this file (for example, .aider.llm.history)]:llm_history_file:_files"
  "--dark-mode[Use colors suitable for a dark terminal background (default\: False)]"
  "--light-mode[Use colors suitable for a light terminal background (default\: False)]"
  {--pretty,--no-pretty}"[Enable\/disable pretty, colorized output (default\: True)]:pretty:"
  {--stream,--no-stream}"[Enable\/disable streaming responses (default\: True)]:stream:"
  "--user-input-color[Set the color for user input (default\: \#00cc00)]:user_input_color:"
  "--tool-output-color[Set the color for tool output (default\: None)]:tool_output_color:"
  "--tool-error-color[Set the color for tool error messages (default\: \#FF2222)]:tool_error_color:"
  "--tool-warning-color[Set the color for tool warning messages (default\: \#FFA500)]:tool_warning_color:"
  "--assistant-output-color[Set the color for assistant output (default\: \#0088ff)]:assistant_output_color:"
  "--completion-menu-color[Set the color for the completion menu (default\: terminal\'s default text color)]:completion_menu_color:"
  "--completion-menu-bg-color[Set the background color for the completion menu (default\: terminal\'s default background color)]:completion_menu_bg_color:"
  "--completion-menu-current-color[Set the color for the current item in the completion menu (default\: terminal\'s default background color)]:completion_menu_current_color:"
  "--completion-menu-current-bg-color[Set the background color for the current item in the completion menu (default\: terminal\'s default text color)]:completion_menu_current_bg_color:"
  "--code-theme[Set the markdown code theme (default\: default, other options include monokai, solarized-dark, solarized-light, or a Pygments builtin style, see https\:\/\/pygments.org\/styles for available themes)]:code_theme:"
  "--show-diffs[Show diffs when committing changes (default\: False)]"
  {--git,--no-git}"[Enable\/disable looking for a git repo (default\: True)]:git:"
  {--gitignore,--no-gitignore}"[Enable\/disable adding .aider\* to .gitignore (default\: True)]:gitignore:"
  {--add-gitignore-files,--no-add-gitignore-files}"[Enable\/disable the addition of files listed in .gitignore to Aider\'s editing scope.]:add_gitignore_files:"
  "--aiderignore[Specify the aider ignore file (default\: .aiderignore in git root)]:aiderignore:_files"
  "--subtree-only[Only consider files in the current subtree of the git repository]"
  {--auto-commits,--no-auto-commits}"[Enable\/disable auto commit of LLM changes (default\: True)]:auto_commits:"
  {--dirty-commits,--no-dirty-commits}"[Enable\/disable commits when repo is found dirty (default\: True)]:dirty_commits:"
  {--attribute-author,--no-attribute-author}"[Attribute aider code changes in the git author name (default\: True). If explicitly set to True, overrides --attribute-co-authored-by precedence.]:attribute_author:"
  {--attribute-committer,--no-attribute-committer}"[Attribute aider commits in the git committer name (default\: True). If explicitly set to True, overrides --attribute-co-authored-by precedence for aider edits.]:attribute_committer:"
  {--attribute-commit-message-author,--no-attribute-commit-message-author}"[Prefix commit messages with \'aider\: \' if aider authored the changes (default\: False)]:attribute_commit_message_author:"
  {--attribute-commit-message-committer,--no-attribute-commit-message-committer}"[Prefix all commit messages with \'aider\: \' (default\: False)]:attribute_commit_message_committer:"
  {--attribute-co-authored-by,--no-attribute-co-authored-by}"[Attribute aider edits using the Co-authored-by trailer in the commit message (default\: True). If True, this takes precedence over default --attribute-author and --attribute-committer behavior unless they are explicitly set to True.]:attribute_co_authored_by:"
  {--git-commit-verify,--no-git-commit-verify}"[Enable\/disable git pre-commit hooks with --no-verify (default\: False)]:git_commit_verify:"
  "--commit[Commit all pending changes with a suitable commit message, then exit]"
  "--commit-prompt[Specify a custom prompt for generating commit messages]:commit_prompt:"
  {--dry-run,--no-dry-run}"[Perform a dry run without modifying files (default\: False)]:dry_run:"
  "--skip-sanity-check-repo[Skip the sanity check for the git repository (default\: False)]"
  {--watch-files,--no-watch-files}"[Enable\/disable watching files for ai coding comments (default\: False)]:watch_files:"
  "--lint[Lint and fix provided files, or dirty files if none provided]"
  "*--lint-cmd[Specify lint commands to run for different languages, eg\: \"python\: flake8 --select\=...\" (can be used multiple times)]:lint_cmd:"
  {--auto-lint,--no-auto-lint}"[Enable\/disable automatic linting after changes (default\: True)]:auto_lint:"
  "--test-cmd[Specify command to run tests]:test_cmd:"
  {--auto-test,--no-auto-test}"[Enable\/disable automatic testing after changes (default\: False)]:auto_test:"
  "--test[Run tests, fix problems found and then exit]"
  {--analytics,--no-analytics}"[Enable\/disable analytics for current session (default\: random)]:analytics:"
  "--analytics-log[Specify a file to log analytics events]:analytics_log:_files"
  "--analytics-disable[Permanently disable analytics]"
  "--analytics-posthog-host[Send analytics to custom PostHog instance]:analytics_posthog_host:"
  "--analytics-posthog-project-api-key[Send analytics to custom PostHog project]:analytics_posthog_project_api_key:"
  "--just-check-update[Check for updates and return status in the exit code]"
  {--check-update,--no-check-update}"[Check for new aider versions on launch]:check_update:"
  {--show-release-notes,--no-show-release-notes}"[Show release notes on first run of new version (default\: None, ask user)]:show_release_notes:"
  "--install-main-branch[Install the latest version from the main branch]"
  {--upgrade,--update}"[Upgrade aider to the latest version from PyPI]"
  "(- : *)--version[Show the version number and exit]"
  {--message,--msg,-m}"[Specify a single message to send the LLM, process reply then exit (disables chat mode)]:message:"
  {--message-file,-f}"[Specify a file containing the message to send the LLM, process reply, then exit (disables chat mode)]:message_file:_files"
  {--gui,--no-gui,--browser,--no-browser}"[Run aider in your browser (default\: False)]:gui:"
  {--copy-paste,--no-copy-paste}"[Enable automatic copy\/paste of chat between aider and web UI (default\: False)]:copy_paste:"
  "--apply[Apply the changes from the given file instead of running the chat (debug)]:apply:_files"
  "--apply-clipboard-edits[Apply clipboard contents as edits using the main model\'s editor format]"
  "--exit[Do all startup activities then exit before accepting user input (debug)]"
  "--show-repo-map[Print the repo map and exit (debug)]"
  "--show-prompts[Print the system prompts and exit (debug)]"
  "--voice-format[Audio format for voice recording (default\: wav). webm and mp3 require ffmpeg]:voice_format:(wav mp3 webm)"
  "--voice-language[Specify the language for voice using ISO 639-1 code (default\: auto)]:voice_language:"
  "--voice-input-device[Specify the input device name for voice recording]:voice_input_device:"
  "--disable-playwright[Never prompt for or attempt to install Playwright for web scraping (default\: False).]"
  "*--file[specify a file to edit (can be used multiple times)]:file:_files"
  "*--read[specify a read-only file (can be used multiple times)]:read:_files"
  "--vim[Use VI editing mode in the terminal (default\: False)]"
  "--chat-language[Specify the language to use in the chat (default\: None, uses system settings)]:chat_language:"
  "--commit-language[Specify the language to use in the commit message (default\: None, user language)]:commit_language:"
  "--yes-always[Always say yes to every confirmation]"
  {-v,--verbose}"[Enable verbose output]"
  "--load[Load and execute \/commands from a file on launch]:load:_files"
  "--encoding[Specify the encoding for input and output (default\: utf-8)]:encoding:"
  "--line-endings[Line endings to use when writing files (default\: platform)]:line_endings:(platform lf crlf)"
  {-c,--config}"[Specify the config file (default\: search for .aider.conf.yml in git root, cwd or home directory)]:config:_files"
  "--env-file[Specify the .env file to load (default\: .env in git root)]:env_file:_files"
  {--suggest-shell-commands,--no-suggest-shell-commands}"[Enable\/disable suggesting shell commands (default\: True)]:suggest_shell_commands:"
  {--fancy-input,--no-fancy-input}"[Enable\/disable fancy input with history and completion (default\: True)]:fancy_input:"
  {--multiline,--no-multiline}"[Enable\/disable multi-line input mode with Meta-Enter to submit (default\: False)]:multiline:"
  {--notifications,--no-notifications}"[Enable\/disable terminal bell notifications when LLM responses are ready (default\: False)]:notifications:"
  "--notifications-command[Specify a command to run for notifications instead of the terminal bell. If not specified, a default command for your OS may be used.]:notifications_command:"
  {--detect-urls,--no-detect-urls}"[Enable\/disable detection and offering to add URLs to chat (default\: True)]:detect_urls:"
  "--editor[Specify which editor to use for the \/editor command]:editor:"
  "--shell-completions[Print shell completion script for the specified SHELL and exit. Supported shells\: bash, tcsh, zsh. Example\: aider --shell-completions bash]:shell_completions:(bash tcsh zsh)"
  "--opus[Use claude-3-opus-20240229 model for the main chat (deprecated, use --model)]"
  "--sonnet[Use anthropic\/claude-3-7-sonnet-20250219 model for the main chat (deprecated, use --model)]"
  "--haiku[Use claude-3-5-haiku-20241022 model for the main chat (deprecated, use --model)]"
  {--4,-4}"[Use gpt-4-0613 model for the main chat (deprecated, use --model)]"
  "--4o[Use gpt-4o model for the main chat (deprecated, use --model)]"
  "--mini[Use gpt-4o-mini model for the main chat (deprecated, use --model)]"
  "--4-turbo[Use gpt-4-1106-preview model for the main chat (deprecated, use --model)]"
  {--35turbo,--35-turbo,--3,-3}"[Use gpt-3.5-turbo model for the main chat (deprecated, use --model)]"
  "--deepseek[Use deepseek\/deepseek-chat model for the main chat (deprecated, use --model)]"
  "--o1-mini[Use o1-mini model for the main chat (deprecated, use --model)]"
  "--o1-preview[Use o1-preview model for the main chat (deprecated, use --model)]"
  "(*)::files to edit with an LLM (optional):_files"
)

# guard to ensure default positional specs are added only once per session
_shtab_aider_defaults_added=0


_shtab_aider() {
  local context state line curcontext="$curcontext" one_or_more='(*)' remainder='(-)*' default='*::: :->aider'

  # Add default positional/remainder specs only if none exist, and only once per session
  if (( ! _shtab_aider_defaults_added )); then
    if (( ${_shtab_aider_options[(I)${(q)one_or_more}*]} +          ${_shtab_aider_options[(I)${(q)remainder}*]} +          ${_shtab_aider_options[(I)${(q)default}]} == 0 )); then
      _shtab_aider_options+=(': :_shtab_aider_commands' '*::: :->aider')
    fi
    _shtab_aider_defaults_added=1
  fi
  _arguments -C -s $_shtab_aider_options

  case $state in
    aider)
      words=($line[1] "${words[@]}")
      (( CURRENT += 1 ))
      curcontext="${curcontext%:*:*}:_shtab_aider-$line[1]:"
      case $line[1] in
        
      esac
  esac
}



typeset -A opt_args

if [[ $zsh_eval_context[-1] == eval ]]; then
  # eval/source/. command, register function for later
  compdef _shtab_aider -N aider
else
  # autoload from fpath, call function directly
  _shtab_aider "$@"
fi

