#compdef aider local curcontext="$curcontext" state line typeset -A opt_args # Define completion for model options local -a model_options model_options=( 'claude-3-opus-20240229' 'claude-3-5-sonnet-20241022' 'claude-3-5-haiku-20241022' 'gpt-4-0613' 'gpt-4o' 'gpt-4o-mini' 'gpt-4-1106-preview' 'gpt-3.5-turbo' 'deepseek/deepseek-chat' 'o1-mini' 'o1-preview' 'o3-mini' 'openrouter/deepseek/deepseek-r1:free' 'anthropic/claude-3-7-sonnet-20250219' ) # Define completion for reasoning effort levels local -a reasoning_effort reasoning_effort=( 'low' 'medium' 'high' ) # Define completion for code themes local -a code_themes code_themes=( 'default' 'monokai' 'solarized-dark' 'solarized-light' 'bw' 'sas' 'staroffice' 'xcode' 'github-dark' 'rrt' 'abap' 'algol' 'algol_nu' 'arduino' 'autumn' 'borland' 'colorful' 'igor' 'lovelace' 'murphy' 'pastie' 'rainbow_dash' 'stata-light' 'trac' 'vs' 'emacs' 'tango' 'solarized-light' 'manni' 'gruvbox-light' 'friendly' 'friendly_grayscale' 'perldoc' 'paraiso-light' 'zenburn' 'nord' 'material' 'one-dark' 'dracula' 'nord-darker' 'gruvbox-dark' 'stata-dark' 'paraiso-dark' 'coffee' 'solarized-dark' 'native' 'inkpot' 'fruity' 'vim' ) # Define completion for map refresh options local -a map_refresh_options map_refresh_options=( 'auto' 'always' 'files' 'manual' ) # Define completion for line endings local -a line_endings line_endings=( 'platform' 'lf' 'crlf' ) # Define completion for voice formats local -a voice_formats voice_formats=( 'wav' 'webm' 'mp3' ) # Define completion for voice languages local -a voice_languages voice_languages=( 'auto' 'en' 'zh' 'ja' 'es' 'fr' 'de' 'it' 'ru' 'pt' 'nl' 'ko' 'ar' 'tr' 'pl' 'sv' 'fi' 'no' 'da' 'cs' 'hu' 'el' 'he' 'hi' 'th' 'vi' 'uk' 'ro' 'bg' 'sk' 'sl' 'hr' 'lt' 'lv' 'et' 'sq' 'mk' 'sr' 'bs' 'is' 'ga' 'cy' 'mt' 'gd' 'kw' 'gv' 'br' 'oc' 'ca' 'gl' 'eu' 'an' 'ast' 'wa' 'fur' 'lij' 'sc' 'co' 'rm' 'lad' 'frp' 'pms' 'nap' 'scn' 'vec' 'lld' ) # Define completion for editors local -a editors editors=( 'vim' 'emacs' 'nano' 'code' 'sublime' 'atom' 'gedit' 'kate' 'notepad++' 'textedit' 'bbedit' 'vscode' 'neovim' 'micro' 'helix' 'kakoune' 'zed' 'lapce' 'codium' 'lite-xl' 'brackets' 'bluefish' 'geany' 'jedit' 'komodo' 'notepadqq' 'textadept' 'ultraedit' 'xed' 'leafpad' 'mousepad' 'pluma' 'scratch' 'xwrite' 'abiwor' ) # Main completion arguments _arguments -C \ '(-h --help)'{-h,--help}'[Show help message and exit]' \ '(--version)'--version'[Show the version number and exit]' \ '(-v --verbose)'{-v,--verbose}'[Enable verbose output]' \ '(--verbose)'--verbose'[Enable verbose output]' \ '(--quiet)'--quiet'[Disable verbose output]' \ '(-c --config)'{-c,--config}'[Specify the config file]:config file:_files' \ '(--output)'--output'[Specify output file]:output file:_files' \ '(--model)'--model'[Specify the model to use for the main chat]:model:(${model_options})' \ '(--opus)'--opus'[Use claude-3-opus-20240229 model for the main chat]' \ '(--sonnet)'--sonnet'[Use anthropic/claude-3-7-sonnet-20250219 model for the main chat]' \ '(--haiku)'--haiku'[Use claude-3-5-haiku-20241022 model for the main chat]' \ '(--4)'--4'[Use gpt-4-0613 model for the main chat]' \ '(--4o)'--4o'[Use gpt-4o model for the main chat]' \ '(--mini)'--mini'[Use gpt-4o-mini model for the main chat]' \ '(--4-turbo)'--4-turbo'[Use gpt-4-1106-preview model for the main chat]' \ '(--35turbo)'--35turbo'[Use gpt-3.5-turbo model for the main chat]' \ '(--deepseek)'--deepseek'[Use deepseek/deepseek-chat model for the main chat]' \ '(--o1-mini)'--o1-mini'[Use o1-mini model for the main chat]' \ '(--o1-preview)'--o1-preview'[Use o1-preview model for the main chat]' \ '(--openai-api-key)'--openai-api-key'[Specify the OpenAI API key]:openai api key:' \ '(--anthropic-api-key)'--anthropic-api-key'[Specify the Anthropic API key]:anthropic api key:' \ '(--openai-api-base)'--openai-api-base'[Specify the api base url]:api base url:' \ '(--openai-api-type)'--openai-api-type'[Specify the api type]:api type:' \ '(--openai-api-version)'--openai-api-version'[Specify the api version]:api version:' \ '(--openai-api-deployment-id)'--openai-api-deployment-id'[Specify the api deployment id]:api deployment id:' \ '(--openai-organization-id)'--openai-organization-id'[Specify the organization id]:organization id:' \ '(--set-env)'--set-env'[Set an environment variable]:env var name=value:' \ '(--api-key)'--api-key'[Set an API key for a provider]:provider=key:' \ '(--list-models)'--list-models'[List known models which match the (partial) MODEL name]:model name:' \ '(--model-settings-file)'--model-settings-file'[Specify a file with aider model settings for unknown models]:model settings file:_files' \ '(--model-metadata-file)'--model-metadata-file'[Specify a file with context window and costs for unknown models]:model metadata file:_files' \ '(--alias)'--alias'[Add a model alias]:alias:model:' \ '(--verify-ssl)'--verify-ssl'[Verify the SSL cert when connecting to models]' \ '(--no-verify-ssl)'--no-verify-ssl'[Do not verify the SSL cert when connecting to models]' \ '(--timeout)'--timeout'[Timeout in seconds for API calls]:timeout:' \ '(--thinking-tokens)'--thinking-tokens'[Set the thinking token budget for models that support it]:thinking tokens:' \ '(--auto-accept-architect)'--auto-accept-architect'[Enable automatic acceptance of architect changes]' \ '(--no-auto-accept-architect)'--no-auto-accept-architect'[Disable automatic acceptance of architect changes]' \ '(--check-model-accepts-settings)'--check-model-accepts-settings'[Check if model accepts settings like reasoning_effort/thinking_tokens]' \ '(--no-check-model-accepts-settings)'--no-check-model-accepts-settings'[Do not check if model accepts settings like reasoning_effort/thinking_tokens]' \ '(--git-commit-verify)'--git-commit-verify'[Enable git pre-commit hooks with --no-verify]' \ '(--no-git-commit-verify)'--no-git-commit-verify'[Disable git pre-commit hooks with --no-verify]' \ '(--notifications)'--notifications'[Enable terminal bell notifications when LLM responses are ready]' \ '(--no-notifications)'--no-notifications'[Disable terminal bell notifications when LLM responses are ready]' \ '(--notifications-command)'--notifications-command'[Specify a command to run for notifications instead of the terminal bell]:notifications command:' \ '(--edit-format)'--edit-format'[Specify what edit format the LLM should use]:edit format:(diff whole)' \ '(--architect)'--architect'[Use architect edit format for the main chat]' \ '(--weak-model)'--weak-model'[Specify the model to use for commit messages and chat history summarization]:weak model:(${model_options})' \ '(--editor-model)'--editor-model'[Specify the model to use for editor tasks]:editor model:(${model_options})' \ '(--editor-edit-format)'--editor-edit-format'[Specify the edit format for the editor model]:editor edit format:(diff whole)' \ '(--show-model-warnings)'--show-model-warnings'[Only work with models that have meta-data available]' \ '(--no-show-model-warnings)'--no-show-model-warnings'[Work with models even if meta-data is not available]' \ '(--max-chat-history-tokens)'--max-chat-history-tokens'[Soft limit on tokens for chat history, after which summarization begins]:max chat history tokens:' \ '(--cache-prompts)'--cache-prompts'[Enable caching of prompts]' \ '(--no-cache-prompts)'--no-cache-prompts'[Disable caching of prompts]' \ '(--cache-keepalive-pings)'--cache-keepalive-pings'[Number of times to ping at 5min intervals to keep prompt cache warm]:cache keepalive pings:' \ '(--map-tokens)'--map-tokens'[Suggested number of tokens to use for repo map, use 0 to disable]:map tokens:' \ '(--map-refresh)'--map-refresh'[Control how often the repo map is refreshed]:map refresh:(${map_refresh_options})' \ '(--map-multiplier-no-files)'--map-multiplier-no-files'[Multiplier for map tokens when no files are specified]:map multiplier no files:' \ '(--input-history-file)'--input-history-file'[Specify the chat input history file]:input history file:_files' \ '(--chat-history-file)'--chat-history-file'[Specify the chat history file]:chat history file:_files' \ '(--restore-chat-history)'--restore-chat-history'[Restore the previous chat history messages]' \ '(--no-restore-chat-history)'--no-restore-chat-history'[Do not restore the previous chat history messages]' \ '(--llm-history-file)'--llm-history-file'[Log the conversation with the LLM to this file]:llm history file:_files' \ '(--dark-mode)'--dark-mode'[Use colors suitable for a dark terminal background]' \ '(--light-mode)'--light-mode'[Use colors suitable for a light terminal background]' \ '(--pretty)'--pretty'[Enable pretty, colorized output]' \ '(--no-pretty)'--no-pretty'[Disable pretty, colorized output]' \ '(--stream)'--stream'[Enable streaming responses]' \ '(--no-stream)'--no-stream'[Disable streaming responses]' \ '(--user-input-color)'--user-input-color'[Set the color for user input]:user input color:' \ '(--tool-output-color)'--tool-output-color'[Set the color for tool output]:tool output color:' \ '(--tool-error-color)'--tool-error-color'[Set the color for tool error messages]:tool error color:' \ '(--tool-warning-color)'--tool-warning-color'[Set the color for tool warning messages]:tool warning color:' \ '(--assistant-output-color)'--assistant-output-color'[Set the color for assistant output]:assistant output color:' \ '(--completion-menu-color)'--completion-menu-color'[Set the color for the completion menu]:completion menu color:' \ '(--completion-menu-bg-color)'--completion-menu-bg-color'[Set the background color for the completion menu]:completion menu bg color:' \ '(--completion-menu-current-color)'--completion-menu-current-color'[Set the color for the current item in the completion menu]:completion menu current color:' \ '(--completion-menu-current-bg-color)'--completion-menu-current-bg-color'[Set the background color for the current item in the completion menu]:completion menu current bg color:' \ '(--code-theme)'--code-theme'[Set the markdown code theme]:code theme:(${code_themes})' \ '(--show-diffs)'--show-diffs'[Show diffs when committing changes]' \ '(--git)'--git'[Enable looking for a git repo]' \ '(--no-git)'--no-git'[Disable looking for a git repo]' \ '(--gitignore)'--gitignore'[Enable adding .aider* to .gitignore]' \ '(--no-gitignore)'--no-gitignore'[Disable adding .aider* to .gitignore]' \ '(--aiderignore)'--aiderignore'[Specify the aider ignore file]:aider ignore file:_files' \ '(--subtree-only)'--subtree-only'[Only consider files in the current subtree of the git repository]' \ '(--auto-commits)'--auto-commits'[Enable auto commit of LLM changes]' \ '(--no-auto-commits)'--no-auto-commits'[Disable auto commit of LLM changes]' \ '(--dirty-commits)'--dirty-commits'[Enable commits when repo is found dirty]' \ '(--no-dirty-commits)'--no-dirty-commits'[Disable commits when repo is found dirty]' \ '(--attribute-author)'--attribute-author'[Attribute aider code changes in the git author name]' \ '(--no-attribute-author)'--no-attribute-author'[Do not attribute aider code changes in the git author name]' \ '(--attribute-committer)'--attribute-committer'[Attribute aider commits in the git committer name]' \ '(--no-attribute-committer)'--no-attribute-committer'[Do not attribute aider commits in the git committer name]' \ '(--attribute-commit-message-author)'--attribute-commit-message-author'[Prefix commit messages with "aider: " if aider authored the changes]' \ '(--no-attribute-commit-message-author)'--no-attribute-commit-message-author'[Do not prefix commit messages with "aider: " if aider authored the changes]' \ '(--attribute-commit-message-committer)'--attribute-commit-message-committer'[Prefix all commit messages with "aider: "]' \ '(--no-attribute-commit-message-committer)'--no-attribute-commit-message-committer'[Do not prefix all commit messages with "aider: "]' \ '(--commit)'--commit'[Commit all pending changes with a suitable commit message, then exit]' \ '(--commit-prompt)'--commit-prompt'[Specify a custom prompt for generating commit messages]:commit prompt:' \ '(--dry-run)'--dry-run'[Perform a dry run without modifying files]' \ '(--no-dry-run)'--no-dry-run'[Do not perform a dry run]' \ '(--skip-sanity-check-repo)'--skip-sanity-check-repo'[Skip the sanity check for the git repository]' \ '(--watch-files)'--watch-files'[Enable watching files for ai coding comments]' \ '(--no-watch-files)'--no-watch-files'[Disable watching files for ai coding comments]' \ '(--lint)'--lint'[Lint and fix provided files, or dirty files if none provided]' \ '(--lint-cmd)'--lint-cmd'[Specify lint commands to run for different languages]:lint cmd:' \ '(--auto-lint)'--auto-lint'[Enable automatic linting after changes]' \ '(--no-auto-lint)'--no-auto-lint'[Disable automatic linting after changes]' \ '(--test-cmd)'--test-cmd'[Specify command to run tests]:test cmd:' \ '(--auto-test)'--auto-test'[Enable automatic testing after changes]' \ '(--no-auto-test)'--no-auto-test'[Disable automatic testing after changes]' \ '(--test)'--test'[Run tests, fix problems found and then exit]' \ '(--analytics)'--analytics'[Enable analytics for current session]' \ '(--no-analytics)'--no-analytics'[Disable analytics for current session]' \ '(--analytics-log)'--analytics-log'[Specify a file to log analytics events]:analytics log file:_files' \ '(--analytics-disable)'--analytics-disable'[Permanently disable analytics]' \ '(--just-check-update)'--just-check-update'[Check for updates and return status in the exit code]' \ '(--check-update)'--check-update'[Check for new aider versions on launch]' \ '(--no-check-update)'--no-check-update'[Do not check for new aider versions on launch]' \ '(--show-release-notes)'--show-release-notes'[Show release notes on first run of new version]' \ '(--no-show-release-notes)'--no-show-release-notes'[Do not show release notes on first run of new version]' \ '(--install-main-branch)'--install-main-branch'[Install the latest version from the main branch]' \ '(--upgrade)'--upgrade'[Upgrade aider to the latest version from PyPI]' \ '(--message)'--message'[Specify a single message to send the LLM, process reply then exit]:message:' \ '(--message-file)'--message-file'[Specify a file containing the message to send the LLM, process reply, then exit]:message file:_files' \ '(--gui)'--gui'[Run aider in your browser]' \ '(--no-gui)'--no-gui'[Do not run aider in your browser]' \ '(--browser)'--browser'[Run aider in your browser]' \ '(--no-browser)'--no-browser'[Do not run aider in your browser]' \ '(--copy-paste)'--copy-paste'[Enable automatic copy/paste of chat between aider and web UI]' \ '(--no-copy-paste)'--no-copy-paste'[Disable automatic copy/paste of chat between aider and web UI]' \ '(--apply)'--apply'[Apply the changes from the given file instead of running the chat]:apply file:_files' \ '(--apply-clipboard-edits)'--apply-clipboard-edits'[Apply clipboard contents as edits using the main model'\''s editor format]' \ '(--exit)'--exit'[Do all startup activities then exit before accepting user input]' \ '(--show-repo-map)'--show-repo-map'[Print the repo map and exit]' \ '(--show-prompts)'--show-prompts'[Print the system prompts and exit]' \ '(--voice-format)'--voice-format'[Audio format for voice recording]:voice format:(${voice_formats})' \ '(--voice-language)'--voice-language'[Specify the language for voice using ISO 639-1 code]:voice language:(${voice_languages})' \ '(--voice-input-device)'--voice-input-device'[Specify the input device name for voice recording]:voice input device:' \ '(--file)'--file'[Specify a file to edit]:file:_files' \ '(--read)'--read'[Specify a read-only file]:read file:_files' \ '(--vim)'--vim'[Use VI editing mode in the terminal]' \ '(--chat-language)'--chat-language'[Specify the language to use in the chat]:chat language:' \ '(--yes-always)'--yes-always'[Always say yes to every confirmation]' \ '(--load)'--load'[Load and execute /commands from a file on launch]:load file:_files' \ '(--encoding)'--encoding'[Specify the encoding for input and output]:encoding:' \ '(--line-endings)'--line-endings'[Line endings to use when writing files]:line endings:(${line_endings})' \ '(--env-file)'--env-file'[Specify the .env file to load]:env file:_files' \ '(--suggest-shell-commands)'--suggest-shell-commands'[Enable suggesting shell commands]' \ '(--no-suggest-shell-commands)'--no-suggest-shell-commands'[Disable suggesting shell commands]' \ '(--fancy-input)'--fancy-input'[Enable fancy input with history and completion]' \ '(--no-fancy-input)'--no-fancy-input'[Disable fancy input with history and completion]' \ '(--multiline)'--multiline'[Enable multi-line input mode with Meta-Enter to submit]' \ '(--no-multiline)'--no-multiline'[Disable multi-line input mode with Meta-Enter to submit]' \ '(--detect-urls)'--detect-urls'[Enable detection and offering to add URLs to chat]' \ '(--no-detect-urls)'--no-detect-urls'[Disable detection and offering to add URLs to chat]' \ '(--editor)'--editor'[Specify which editor to use for the /editor command]:editor:(${editors})' \ '(--reasoning-effort)'--reasoning-effort'[Specify reasoning effort level]:reasoning effort:(${reasoning_effort})' \ '*:files:_files' return 0