feat: ability to select audio input device

This commit is contained in:
Philippe de Reynal 2024-11-30 11:24:34 +01:00
parent e4a1d6fe89
commit e11faadf39
6 changed files with 317 additions and 281 deletions

View file

@ -22,7 +22,7 @@ def default_env_file(git_root):
def get_parser(default_config_files, git_root): def get_parser(default_config_files, git_root):
parser = configargparse.ArgumentParser( parser = configargparse.ArgumentParser(
description="aider is AI pair programming in your terminal", description="Aider is AI pair programming in your terminal",
add_config_file_help=True, add_config_file_help=True,
default_config_files=default_config_files, default_config_files=default_config_files,
config_file_parser_class=configargparse.YAMLConfigFileParser, config_file_parser_class=configargparse.YAMLConfigFileParser,
@ -770,6 +770,12 @@ def get_parser(default_config_files, git_root):
default="en", default="en",
help="Specify the language for voice using ISO 639-1 code (default: auto)", help="Specify the language for voice using ISO 639-1 code (default: auto)",
) )
group.add_argument(
"--voice-input-device",
metavar="VOICE_INPUT_DEVICE",
default=None,
help="Specify the input device name for voice recording",
)
return parser return parser

View file

@ -1085,7 +1085,7 @@ class Commands:
self.io.tool_error("To use /voice you must provide an OpenAI API key.") self.io.tool_error("To use /voice you must provide an OpenAI API key.")
return return
try: try:
self.voice = voice.Voice(audio_format=self.args.voice_format) self.voice = voice.Voice(audio_format=self.args.voice_format, device_name=self.args.voice_input_device)
except voice.SoundDeviceError: except voice.SoundDeviceError:
self.io.tool_error( self.io.tool_error(
"Unable to import `sounddevice` and/or `soundfile`, is portaudio installed?" "Unable to import `sounddevice` and/or `soundfile`, is portaudio installed?"

View file

@ -34,7 +34,7 @@ class Voice:
threshold = 0.15 threshold = 0.15
def __init__(self, audio_format="wav"): def __init__(self, audio_format="wav", device_name=None):
if sf is None: if sf is None:
raise SoundDeviceError raise SoundDeviceError
try: try:
@ -42,6 +42,27 @@ class Voice:
import sounddevice as sd import sounddevice as sd
self.sd = sd self.sd = sd
devices = sd.query_devices()
if device_name:
# Find the device with matching name
device_id = None
for i, device in enumerate(devices):
if device_name in device["name"]:
device_id = i
break
if device_id is None:
available_inputs = [d["name"] for d in devices if d["max_input_channels"] > 0]
raise ValueError(f"Device '{device_name}' not found. Available input devices: {available_inputs}")
print(f"Using input device: {device_name} (ID: {device_id})")
self.device_id = device_id
else:
self.device_id = None
except (OSError, ModuleNotFoundError): except (OSError, ModuleNotFoundError):
raise SoundDeviceError raise SoundDeviceError
if audio_format not in ["wav", "mp3", "webm"]: if audio_format not in ["wav", "mp3", "webm"]:
@ -93,7 +114,7 @@ class Voice:
temp_wav = tempfile.mktemp(suffix=".wav") temp_wav = tempfile.mktemp(suffix=".wav")
try: try:
sample_rate = int(self.sd.query_devices(None, "input")["default_samplerate"]) sample_rate = int(self.sd.query_devices(self.device_id, "input")["default_samplerate"])
except (TypeError, ValueError): except (TypeError, ValueError):
sample_rate = 16000 # fallback to 16kHz if unable to query device sample_rate = 16000 # fallback to 16kHz if unable to query device
except self.sd.PortAudioError: except self.sd.PortAudioError:
@ -104,7 +125,7 @@ class Voice:
self.start_time = time.time() self.start_time = time.time()
try: try:
with self.sd.InputStream(samplerate=sample_rate, channels=1, callback=self.callback): with self.sd.InputStream(samplerate=sample_rate, channels=1, callback=self.callback, device=self.device_id):
prompt(self.get_prompt, refresh_interval=0.1) prompt(self.get_prompt, refresh_interval=0.1)
except self.sd.PortAudioError as err: except self.sd.PortAudioError as err:
raise SoundDeviceError(f"Error accessing audio input device: {err}") raise SoundDeviceError(f"Error accessing audio input device: {err}")

View file

@ -368,3 +368,6 @@
## Specify the language for voice using ISO 639-1 code (default: auto) ## Specify the language for voice using ISO 639-1 code (default: auto)
#AIDER_VOICE_LANGUAGE=en #AIDER_VOICE_LANGUAGE=en
## Specify the voice input device name (default: system default)
#AIDER_VOICE_INPUT_DEVICE="MacBook Pro Microphone"

View file

@ -410,7 +410,8 @@ cog.outl("```")
## Specify the language for voice using ISO 639-1 code (default: auto) ## Specify the language for voice using ISO 639-1 code (default: auto)
#AIDER_VOICE_LANGUAGE=en #AIDER_VOICE_LANGUAGE=en
## Specify the voice input device name (default: system default)
#AIDER_VOICE_INPUT_DEVICE="MacBook Pro Microphone"
``` ```
<!--[[[end]]]--> <!--[[[end]]]-->

View file

@ -82,7 +82,7 @@ usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model]
## options: ## options:
### `--help` ### `--help`
show this help message and exit show this help message and exit
Aliases: Aliases:
- `-h` - `-h`
- `--help` - `--help`
@ -90,51 +90,51 @@ Aliases:
## Main: ## Main:
### `--openai-api-key OPENAI_API_KEY` ### `--openai-api-key OPENAI_API_KEY`
Specify the OpenAI API key Specify the OpenAI API key
Environment variable: `OPENAI_API_KEY` Environment variable: `OPENAI_API_KEY`
### `--anthropic-api-key ANTHROPIC_API_KEY` ### `--anthropic-api-key ANTHROPIC_API_KEY`
Specify the Anthropic API key Specify the Anthropic API key
Environment variable: `ANTHROPIC_API_KEY` Environment variable: `ANTHROPIC_API_KEY`
### `--model MODEL` ### `--model MODEL`
Specify the model to use for the main chat Specify the model to use for the main chat
Environment variable: `AIDER_MODEL` Environment variable: `AIDER_MODEL`
### `--opus` ### `--opus`
Use claude-3-opus-20240229 model for the main chat Use claude-3-opus-20240229 model for the main chat
Environment variable: `AIDER_OPUS` Environment variable: `AIDER_OPUS`
### `--sonnet` ### `--sonnet`
Use claude-3-5-sonnet-20241022 model for the main chat Use claude-3-5-sonnet-20241022 model for the main chat
Environment variable: `AIDER_SONNET` Environment variable: `AIDER_SONNET`
### `--haiku` ### `--haiku`
Use claude-3-5-haiku-20241022 model for the main chat Use claude-3-5-haiku-20241022 model for the main chat
Environment variable: `AIDER_HAIKU` Environment variable: `AIDER_HAIKU`
### `--4` ### `--4`
Use gpt-4-0613 model for the main chat Use gpt-4-0613 model for the main chat
Environment variable: `AIDER_4` Environment variable: `AIDER_4`
Aliases: Aliases:
- `--4` - `--4`
- `-4` - `-4`
### `--4o` ### `--4o`
Use gpt-4o-2024-08-06 model for the main chat Use gpt-4o-2024-08-06 model for the main chat
Environment variable: `AIDER_4O` Environment variable: `AIDER_4O`
### `--mini` ### `--mini`
Use gpt-4o-mini model for the main chat Use gpt-4o-mini model for the main chat
Environment variable: `AIDER_MINI` Environment variable: `AIDER_MINI`
### `--4-turbo` ### `--4-turbo`
Use gpt-4-1106-preview model for the main chat Use gpt-4-1106-preview model for the main chat
Environment variable: `AIDER_4_TURBO` Environment variable: `AIDER_4_TURBO`
### `--35turbo` ### `--35turbo`
Use gpt-3.5-turbo model for the main chat Use gpt-3.5-turbo model for the main chat
Environment variable: `AIDER_35TURBO` Environment variable: `AIDER_35TURBO`
Aliases: Aliases:
- `--35turbo` - `--35turbo`
- `--35-turbo` - `--35-turbo`
@ -142,520 +142,520 @@ Aliases:
- `-3` - `-3`
### `--deepseek` ### `--deepseek`
Use deepseek/deepseek-coder model for the main chat Use deepseek/deepseek-coder model for the main chat
Environment variable: `AIDER_DEEPSEEK` Environment variable: `AIDER_DEEPSEEK`
### `--o1-mini` ### `--o1-mini`
Use o1-mini model for the main chat Use o1-mini model for the main chat
Environment variable: `AIDER_O1_MINI` Environment variable: `AIDER_O1_MINI`
### `--o1-preview` ### `--o1-preview`
Use o1-preview model for the main chat Use o1-preview model for the main chat
Environment variable: `AIDER_O1_PREVIEW` Environment variable: `AIDER_O1_PREVIEW`
## Model Settings: ## Model Settings:
### `--list-models MODEL` ### `--list-models MODEL`
List known models which match the (partial) MODEL name List known models which match the (partial) MODEL name
Environment variable: `AIDER_LIST_MODELS` Environment variable: `AIDER_LIST_MODELS`
Aliases: Aliases:
- `--list-models MODEL` - `--list-models MODEL`
- `--models MODEL` - `--models MODEL`
### `--openai-api-base OPENAI_API_BASE` ### `--openai-api-base OPENAI_API_BASE`
Specify the api base url Specify the api base url
Environment variable: `OPENAI_API_BASE` Environment variable: `OPENAI_API_BASE`
### `--openai-api-type OPENAI_API_TYPE` ### `--openai-api-type OPENAI_API_TYPE`
Specify the api_type Specify the api_type
Environment variable: `OPENAI_API_TYPE` Environment variable: `OPENAI_API_TYPE`
### `--openai-api-version OPENAI_API_VERSION` ### `--openai-api-version OPENAI_API_VERSION`
Specify the api_version Specify the api_version
Environment variable: `OPENAI_API_VERSION` Environment variable: `OPENAI_API_VERSION`
### `--openai-api-deployment-id OPENAI_API_DEPLOYMENT_ID` ### `--openai-api-deployment-id OPENAI_API_DEPLOYMENT_ID`
Specify the deployment_id Specify the deployment_id
Environment variable: `OPENAI_API_DEPLOYMENT_ID` Environment variable: `OPENAI_API_DEPLOYMENT_ID`
### `--openai-organization-id OPENAI_ORGANIZATION_ID` ### `--openai-organization-id OPENAI_ORGANIZATION_ID`
Specify the OpenAI organization ID Specify the OpenAI organization ID
Environment variable: `OPENAI_ORGANIZATION_ID` Environment variable: `OPENAI_ORGANIZATION_ID`
### `--model-settings-file MODEL_SETTINGS_FILE` ### `--model-settings-file MODEL_SETTINGS_FILE`
Specify a file with aider model settings for unknown models Specify a file with aider model settings for unknown models
Default: .aider.model.settings.yml Default: .aider.model.settings.yml
Environment variable: `AIDER_MODEL_SETTINGS_FILE` Environment variable: `AIDER_MODEL_SETTINGS_FILE`
### `--model-metadata-file MODEL_METADATA_FILE` ### `--model-metadata-file MODEL_METADATA_FILE`
Specify a file with context window and costs for unknown models Specify a file with context window and costs for unknown models
Default: .aider.model.metadata.json Default: .aider.model.metadata.json
Environment variable: `AIDER_MODEL_METADATA_FILE` Environment variable: `AIDER_MODEL_METADATA_FILE`
### `--alias ALIAS:MODEL` ### `--alias ALIAS:MODEL`
Add a model alias (can be used multiple times) Add a model alias (can be used multiple times)
Environment variable: `AIDER_ALIAS` Environment variable: `AIDER_ALIAS`
### `--verify-ssl` ### `--verify-ssl`
Verify the SSL cert when connecting to models (default: True) Verify the SSL cert when connecting to models (default: True)
Default: True Default: True
Environment variable: `AIDER_VERIFY_SSL` Environment variable: `AIDER_VERIFY_SSL`
Aliases: Aliases:
- `--verify-ssl` - `--verify-ssl`
- `--no-verify-ssl` - `--no-verify-ssl`
### `--edit-format EDIT_FORMAT` ### `--edit-format EDIT_FORMAT`
Specify what edit format the LLM should use (default depends on model) Specify what edit format the LLM should use (default depends on model)
Environment variable: `AIDER_EDIT_FORMAT` Environment variable: `AIDER_EDIT_FORMAT`
Aliases: Aliases:
- `--edit-format EDIT_FORMAT` - `--edit-format EDIT_FORMAT`
- `--chat-mode EDIT_FORMAT` - `--chat-mode EDIT_FORMAT`
### `--architect` ### `--architect`
Use architect edit format for the main chat Use architect edit format for the main chat
Environment variable: `AIDER_ARCHITECT` Environment variable: `AIDER_ARCHITECT`
### `--weak-model WEAK_MODEL` ### `--weak-model WEAK_MODEL`
Specify the model to use for commit messages and chat history summarization (default depends on --model) Specify the model to use for commit messages and chat history summarization (default depends on --model)
Environment variable: `AIDER_WEAK_MODEL` Environment variable: `AIDER_WEAK_MODEL`
### `--editor-model EDITOR_MODEL` ### `--editor-model EDITOR_MODEL`
Specify the model to use for editor tasks (default depends on --model) Specify the model to use for editor tasks (default depends on --model)
Environment variable: `AIDER_EDITOR_MODEL` Environment variable: `AIDER_EDITOR_MODEL`
### `--editor-edit-format EDITOR_EDIT_FORMAT` ### `--editor-edit-format EDITOR_EDIT_FORMAT`
Specify the edit format for the editor model (default: depends on editor model) Specify the edit format for the editor model (default: depends on editor model)
Environment variable: `AIDER_EDITOR_EDIT_FORMAT` Environment variable: `AIDER_EDITOR_EDIT_FORMAT`
### `--show-model-warnings` ### `--show-model-warnings`
Only work with models that have meta-data available (default: True) Only work with models that have meta-data available (default: True)
Default: True Default: True
Environment variable: `AIDER_SHOW_MODEL_WARNINGS` Environment variable: `AIDER_SHOW_MODEL_WARNINGS`
Aliases: Aliases:
- `--show-model-warnings` - `--show-model-warnings`
- `--no-show-model-warnings` - `--no-show-model-warnings`
### `--max-chat-history-tokens VALUE` ### `--max-chat-history-tokens VALUE`
Soft limit on tokens for chat history, after which summarization begins. If unspecified, defaults to the model's 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.
Environment variable: `AIDER_MAX_CHAT_HISTORY_TOKENS` Environment variable: `AIDER_MAX_CHAT_HISTORY_TOKENS`
### `--env-file ENV_FILE` ### `--env-file ENV_FILE`
Specify the .env file to load (default: .env in git root) Specify the .env file to load (default: .env in git root)
Default: .env Default: .env
Environment variable: `AIDER_ENV_FILE` Environment variable: `AIDER_ENV_FILE`
## Cache Settings: ## Cache Settings:
### `--cache-prompts` ### `--cache-prompts`
Enable caching of prompts (default: False) Enable caching of prompts (default: False)
Default: False Default: False
Environment variable: `AIDER_CACHE_PROMPTS` Environment variable: `AIDER_CACHE_PROMPTS`
Aliases: Aliases:
- `--cache-prompts` - `--cache-prompts`
- `--no-cache-prompts` - `--no-cache-prompts`
### `--cache-keepalive-pings VALUE` ### `--cache-keepalive-pings VALUE`
Number of times to ping at 5min intervals to keep prompt cache warm (default: 0) Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)
Default: 0 Default: 0
Environment variable: `AIDER_CACHE_KEEPALIVE_PINGS` Environment variable: `AIDER_CACHE_KEEPALIVE_PINGS`
## Repomap Settings: ## Repomap Settings:
### `--map-tokens VALUE` ### `--map-tokens VALUE`
Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
Environment variable: `AIDER_MAP_TOKENS` Environment variable: `AIDER_MAP_TOKENS`
### `--map-refresh VALUE` ### `--map-refresh VALUE`
Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto)
Default: auto Default: auto
Environment variable: `AIDER_MAP_REFRESH` Environment variable: `AIDER_MAP_REFRESH`
### `--map-multiplier-no-files VALUE` ### `--map-multiplier-no-files VALUE`
Multiplier for map tokens when no files are specified (default: 2) Multiplier for map tokens when no files are specified (default: 2)
Default: 2 Default: 2
Environment variable: `AIDER_MAP_MULTIPLIER_NO_FILES` Environment variable: `AIDER_MAP_MULTIPLIER_NO_FILES`
## History Files: ## History Files:
### `--input-history-file INPUT_HISTORY_FILE` ### `--input-history-file INPUT_HISTORY_FILE`
Specify the chat input history file (default: .aider.input.history) Specify the chat input history file (default: .aider.input.history)
Default: .aider.input.history Default: .aider.input.history
Environment variable: `AIDER_INPUT_HISTORY_FILE` Environment variable: `AIDER_INPUT_HISTORY_FILE`
### `--chat-history-file CHAT_HISTORY_FILE` ### `--chat-history-file CHAT_HISTORY_FILE`
Specify the chat history file (default: .aider.chat.history.md) Specify the chat history file (default: .aider.chat.history.md)
Default: .aider.chat.history.md Default: .aider.chat.history.md
Environment variable: `AIDER_CHAT_HISTORY_FILE` Environment variable: `AIDER_CHAT_HISTORY_FILE`
### `--restore-chat-history` ### `--restore-chat-history`
Restore the previous chat history messages (default: False) Restore the previous chat history messages (default: False)
Default: False Default: False
Environment variable: `AIDER_RESTORE_CHAT_HISTORY` Environment variable: `AIDER_RESTORE_CHAT_HISTORY`
Aliases: Aliases:
- `--restore-chat-history` - `--restore-chat-history`
- `--no-restore-chat-history` - `--no-restore-chat-history`
### `--llm-history-file LLM_HISTORY_FILE` ### `--llm-history-file LLM_HISTORY_FILE`
Log the conversation with the LLM to this file (for example, .aider.llm.history) Log the conversation with the LLM to this file (for example, .aider.llm.history)
Environment variable: `AIDER_LLM_HISTORY_FILE` Environment variable: `AIDER_LLM_HISTORY_FILE`
## Output Settings: ## Output Settings:
### `--dark-mode` ### `--dark-mode`
Use colors suitable for a dark terminal background (default: False) Use colors suitable for a dark terminal background (default: False)
Default: False Default: False
Environment variable: `AIDER_DARK_MODE` Environment variable: `AIDER_DARK_MODE`
### `--light-mode` ### `--light-mode`
Use colors suitable for a light terminal background (default: False) Use colors suitable for a light terminal background (default: False)
Default: False Default: False
Environment variable: `AIDER_LIGHT_MODE` Environment variable: `AIDER_LIGHT_MODE`
### `--pretty` ### `--pretty`
Enable/disable pretty, colorized output (default: True) Enable/disable pretty, colorized output (default: True)
Default: True Default: True
Environment variable: `AIDER_PRETTY` Environment variable: `AIDER_PRETTY`
Aliases: Aliases:
- `--pretty` - `--pretty`
- `--no-pretty` - `--no-pretty`
### `--stream` ### `--stream`
Enable/disable streaming responses (default: True) Enable/disable streaming responses (default: True)
Default: True Default: True
Environment variable: `AIDER_STREAM` Environment variable: `AIDER_STREAM`
Aliases: Aliases:
- `--stream` - `--stream`
- `--no-stream` - `--no-stream`
### `--user-input-color VALUE` ### `--user-input-color VALUE`
Set the color for user input (default: #00cc00) Set the color for user input (default: #00cc00)
Default: #00cc00 Default: #00cc00
Environment variable: `AIDER_USER_INPUT_COLOR` Environment variable: `AIDER_USER_INPUT_COLOR`
### `--tool-output-color VALUE` ### `--tool-output-color VALUE`
Set the color for tool output (default: None) Set the color for tool output (default: None)
Environment variable: `AIDER_TOOL_OUTPUT_COLOR` Environment variable: `AIDER_TOOL_OUTPUT_COLOR`
### `--tool-error-color VALUE` ### `--tool-error-color VALUE`
Set the color for tool error messages (default: #FF2222) Set the color for tool error messages (default: #FF2222)
Default: #FF2222 Default: #FF2222
Environment variable: `AIDER_TOOL_ERROR_COLOR` Environment variable: `AIDER_TOOL_ERROR_COLOR`
### `--tool-warning-color VALUE` ### `--tool-warning-color VALUE`
Set the color for tool warning messages (default: #FFA500) Set the color for tool warning messages (default: #FFA500)
Default: #FFA500 Default: #FFA500
Environment variable: `AIDER_TOOL_WARNING_COLOR` Environment variable: `AIDER_TOOL_WARNING_COLOR`
### `--assistant-output-color VALUE` ### `--assistant-output-color VALUE`
Set the color for assistant output (default: #0088ff) Set the color for assistant output (default: #0088ff)
Default: #0088ff Default: #0088ff
Environment variable: `AIDER_ASSISTANT_OUTPUT_COLOR` Environment variable: `AIDER_ASSISTANT_OUTPUT_COLOR`
### `--completion-menu-color COLOR` ### `--completion-menu-color COLOR`
Set the color for the completion menu (default: terminal's default text color) Set the color for the completion menu (default: terminal's default text color)
Environment variable: `AIDER_COMPLETION_MENU_COLOR` Environment variable: `AIDER_COMPLETION_MENU_COLOR`
### `--completion-menu-bg-color COLOR` ### `--completion-menu-bg-color COLOR`
Set the background color for the completion menu (default: terminal's default background color) Set the background color for the completion menu (default: terminal's default background color)
Environment variable: `AIDER_COMPLETION_MENU_BG_COLOR` Environment variable: `AIDER_COMPLETION_MENU_BG_COLOR`
### `--completion-menu-current-color COLOR` ### `--completion-menu-current-color COLOR`
Set the color for the current item in the completion menu (default: terminal's default background color) Set the color for the current item in the completion menu (default: terminal's default background color)
Environment variable: `AIDER_COMPLETION_MENU_CURRENT_COLOR` Environment variable: `AIDER_COMPLETION_MENU_CURRENT_COLOR`
### `--completion-menu-current-bg-color COLOR` ### `--completion-menu-current-bg-color COLOR`
Set the background color for the current item in the completion menu (default: terminal's default text color) Set the background color for the current item in the completion menu (default: terminal's default text color)
Environment variable: `AIDER_COMPLETION_MENU_CURRENT_BG_COLOR` Environment variable: `AIDER_COMPLETION_MENU_CURRENT_BG_COLOR`
### `--code-theme VALUE` ### `--code-theme VALUE`
Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
Default: default Default: default
Environment variable: `AIDER_CODE_THEME` Environment variable: `AIDER_CODE_THEME`
### `--show-diffs` ### `--show-diffs`
Show diffs when committing changes (default: False) Show diffs when committing changes (default: False)
Default: False Default: False
Environment variable: `AIDER_SHOW_DIFFS` Environment variable: `AIDER_SHOW_DIFFS`
## Git Settings: ## Git Settings:
### `--git` ### `--git`
Enable/disable looking for a git repo (default: True) Enable/disable looking for a git repo (default: True)
Default: True Default: True
Environment variable: `AIDER_GIT` Environment variable: `AIDER_GIT`
Aliases: Aliases:
- `--git` - `--git`
- `--no-git` - `--no-git`
### `--gitignore` ### `--gitignore`
Enable/disable adding .aider* to .gitignore (default: True) Enable/disable adding .aider* to .gitignore (default: True)
Default: True Default: True
Environment variable: `AIDER_GITIGNORE` Environment variable: `AIDER_GITIGNORE`
Aliases: Aliases:
- `--gitignore` - `--gitignore`
- `--no-gitignore` - `--no-gitignore`
### `--aiderignore AIDERIGNORE` ### `--aiderignore AIDERIGNORE`
Specify the aider ignore file (default: .aiderignore in git root) Specify the aider ignore file (default: .aiderignore in git root)
Default: .aiderignore Default: .aiderignore
Environment variable: `AIDER_AIDERIGNORE` Environment variable: `AIDER_AIDERIGNORE`
### `--subtree-only` ### `--subtree-only`
Only consider files in the current subtree of the git repository Only consider files in the current subtree of the git repository
Default: False Default: False
Environment variable: `AIDER_SUBTREE_ONLY` Environment variable: `AIDER_SUBTREE_ONLY`
### `--auto-commits` ### `--auto-commits`
Enable/disable auto commit of LLM changes (default: True) Enable/disable auto commit of LLM changes (default: True)
Default: True Default: True
Environment variable: `AIDER_AUTO_COMMITS` Environment variable: `AIDER_AUTO_COMMITS`
Aliases: Aliases:
- `--auto-commits` - `--auto-commits`
- `--no-auto-commits` - `--no-auto-commits`
### `--dirty-commits` ### `--dirty-commits`
Enable/disable commits when repo is found dirty (default: True) Enable/disable commits when repo is found dirty (default: True)
Default: True Default: True
Environment variable: `AIDER_DIRTY_COMMITS` Environment variable: `AIDER_DIRTY_COMMITS`
Aliases: Aliases:
- `--dirty-commits` - `--dirty-commits`
- `--no-dirty-commits` - `--no-dirty-commits`
### `--attribute-author` ### `--attribute-author`
Attribute aider code changes in the git author name (default: True) Attribute aider code changes in the git author name (default: True)
Default: True Default: True
Environment variable: `AIDER_ATTRIBUTE_AUTHOR` Environment variable: `AIDER_ATTRIBUTE_AUTHOR`
Aliases: Aliases:
- `--attribute-author` - `--attribute-author`
- `--no-attribute-author` - `--no-attribute-author`
### `--attribute-committer` ### `--attribute-committer`
Attribute aider commits in the git committer name (default: True) Attribute aider commits in the git committer name (default: True)
Default: True Default: True
Environment variable: `AIDER_ATTRIBUTE_COMMITTER` Environment variable: `AIDER_ATTRIBUTE_COMMITTER`
Aliases: Aliases:
- `--attribute-committer` - `--attribute-committer`
- `--no-attribute-committer` - `--no-attribute-committer`
### `--attribute-commit-message-author` ### `--attribute-commit-message-author`
Prefix commit messages with 'aider: ' if aider authored the changes (default: False) Prefix commit messages with 'aider: ' if aider authored the changes (default: False)
Default: False Default: False
Environment variable: `AIDER_ATTRIBUTE_COMMIT_MESSAGE_AUTHOR` Environment variable: `AIDER_ATTRIBUTE_COMMIT_MESSAGE_AUTHOR`
Aliases: Aliases:
- `--attribute-commit-message-author` - `--attribute-commit-message-author`
- `--no-attribute-commit-message-author` - `--no-attribute-commit-message-author`
### `--attribute-commit-message-committer` ### `--attribute-commit-message-committer`
Prefix all commit messages with 'aider: ' (default: False) Prefix all commit messages with 'aider: ' (default: False)
Default: False Default: False
Environment variable: `AIDER_ATTRIBUTE_COMMIT_MESSAGE_COMMITTER` Environment variable: `AIDER_ATTRIBUTE_COMMIT_MESSAGE_COMMITTER`
Aliases: Aliases:
- `--attribute-commit-message-committer` - `--attribute-commit-message-committer`
- `--no-attribute-commit-message-committer` - `--no-attribute-commit-message-committer`
### `--commit` ### `--commit`
Commit all pending changes with a suitable commit message, then exit Commit all pending changes with a suitable commit message, then exit
Default: False Default: False
Environment variable: `AIDER_COMMIT` Environment variable: `AIDER_COMMIT`
### `--commit-prompt PROMPT` ### `--commit-prompt PROMPT`
Specify a custom prompt for generating commit messages Specify a custom prompt for generating commit messages
Environment variable: `AIDER_COMMIT_PROMPT` Environment variable: `AIDER_COMMIT_PROMPT`
### `--dry-run` ### `--dry-run`
Perform a dry run without modifying files (default: False) Perform a dry run without modifying files (default: False)
Default: False Default: False
Environment variable: `AIDER_DRY_RUN` Environment variable: `AIDER_DRY_RUN`
Aliases: Aliases:
- `--dry-run` - `--dry-run`
- `--no-dry-run` - `--no-dry-run`
### `--skip-sanity-check-repo` ### `--skip-sanity-check-repo`
Skip the sanity check for the git repository (default: False) Skip the sanity check for the git repository (default: False)
Default: False Default: False
Environment variable: `AIDER_SKIP_SANITY_CHECK_REPO` Environment variable: `AIDER_SKIP_SANITY_CHECK_REPO`
## Fixing and committing: ## Fixing and committing:
### `--lint` ### `--lint`
Lint and fix provided files, or dirty files if none provided Lint and fix provided files, or dirty files if none provided
Default: False Default: False
Environment variable: `AIDER_LINT` Environment variable: `AIDER_LINT`
### `--lint-cmd` ### `--lint-cmd`
Specify lint commands to run for different languages, eg: "python: flake8 --select=..." (can be used multiple times) Specify lint commands to run for different languages, eg: "python: flake8 --select=..." (can be used multiple times)
Default: [] Default: []
Environment variable: `AIDER_LINT_CMD` Environment variable: `AIDER_LINT_CMD`
### `--auto-lint` ### `--auto-lint`
Enable/disable automatic linting after changes (default: True) Enable/disable automatic linting after changes (default: True)
Default: True Default: True
Environment variable: `AIDER_AUTO_LINT` Environment variable: `AIDER_AUTO_LINT`
Aliases: Aliases:
- `--auto-lint` - `--auto-lint`
- `--no-auto-lint` - `--no-auto-lint`
### `--test-cmd VALUE` ### `--test-cmd VALUE`
Specify command to run tests Specify command to run tests
Default: [] Default: []
Environment variable: `AIDER_TEST_CMD` Environment variable: `AIDER_TEST_CMD`
### `--auto-test` ### `--auto-test`
Enable/disable automatic testing after changes (default: False) Enable/disable automatic testing after changes (default: False)
Default: False Default: False
Environment variable: `AIDER_AUTO_TEST` Environment variable: `AIDER_AUTO_TEST`
Aliases: Aliases:
- `--auto-test` - `--auto-test`
- `--no-auto-test` - `--no-auto-test`
### `--test` ### `--test`
Run tests and fix problems found Run tests and fix problems found
Default: False Default: False
Environment variable: `AIDER_TEST` Environment variable: `AIDER_TEST`
## Analytics: ## Analytics:
### `--analytics` ### `--analytics`
Enable/disable analytics for current session (default: random) Enable/disable analytics for current session (default: random)
Environment variable: `AIDER_ANALYTICS` Environment variable: `AIDER_ANALYTICS`
Aliases: Aliases:
- `--analytics` - `--analytics`
- `--no-analytics` - `--no-analytics`
### `--analytics-log ANALYTICS_LOG_FILE` ### `--analytics-log ANALYTICS_LOG_FILE`
Specify a file to log analytics events Specify a file to log analytics events
Environment variable: `AIDER_ANALYTICS_LOG` Environment variable: `AIDER_ANALYTICS_LOG`
### `--analytics-disable` ### `--analytics-disable`
Permanently disable analytics Permanently disable analytics
Default: False Default: False
Environment variable: `AIDER_ANALYTICS_DISABLE` Environment variable: `AIDER_ANALYTICS_DISABLE`
## Other Settings: ## Other Settings:
### `--file FILE` ### `--file FILE`
specify a file to edit (can be used multiple times) specify a file to edit (can be used multiple times)
Environment variable: `AIDER_FILE` Environment variable: `AIDER_FILE`
### `--read FILE` ### `--read FILE`
specify a read-only file (can be used multiple times) specify a read-only file (can be used multiple times)
Environment variable: `AIDER_READ` Environment variable: `AIDER_READ`
### `--vim` ### `--vim`
Use VI editing mode in the terminal (default: False) Use VI editing mode in the terminal (default: False)
Default: False Default: False
Environment variable: `AIDER_VIM` Environment variable: `AIDER_VIM`
### `--chat-language CHAT_LANGUAGE` ### `--chat-language CHAT_LANGUAGE`
Specify the language to use in the chat (default: None, uses system settings) Specify the language to use in the chat (default: None, uses system settings)
Environment variable: `AIDER_CHAT_LANGUAGE` Environment variable: `AIDER_CHAT_LANGUAGE`
### `--version` ### `--version`
Show the version number and exit Show the version number and exit
### `--just-check-update` ### `--just-check-update`
Check for updates and return status in the exit code Check for updates and return status in the exit code
Default: False Default: False
Environment variable: `AIDER_JUST_CHECK_UPDATE` Environment variable: `AIDER_JUST_CHECK_UPDATE`
### `--check-update` ### `--check-update`
Check for new aider versions on launch Check for new aider versions on launch
Default: True Default: True
Environment variable: `AIDER_CHECK_UPDATE` Environment variable: `AIDER_CHECK_UPDATE`
Aliases: Aliases:
- `--check-update` - `--check-update`
- `--no-check-update` - `--no-check-update`
### `--show-release-notes` ### `--show-release-notes`
Show release notes on first run of new version (default: None, ask user) Show release notes on first run of new version (default: None, ask user)
Environment variable: `AIDER_SHOW_RELEASE_NOTES` Environment variable: `AIDER_SHOW_RELEASE_NOTES`
Aliases: Aliases:
- `--show-release-notes` - `--show-release-notes`
- `--no-show-release-notes` - `--no-show-release-notes`
### `--install-main-branch` ### `--install-main-branch`
Install the latest version from the main branch Install the latest version from the main branch
Default: False Default: False
Environment variable: `AIDER_INSTALL_MAIN_BRANCH` Environment variable: `AIDER_INSTALL_MAIN_BRANCH`
### `--upgrade` ### `--upgrade`
Upgrade aider to the latest version from PyPI Upgrade aider to the latest version from PyPI
Default: False Default: False
Environment variable: `AIDER_UPGRADE` Environment variable: `AIDER_UPGRADE`
Aliases: Aliases:
- `--upgrade` - `--upgrade`
- `--update` - `--update`
### `--apply FILE` ### `--apply FILE`
Apply the changes from the given file instead of running the chat (debug) Apply the changes from the given file instead of running the chat (debug)
Environment variable: `AIDER_APPLY` Environment variable: `AIDER_APPLY`
### `--apply-clipboard-edits` ### `--apply-clipboard-edits`
Apply clipboard contents as edits using the main model's editor format Apply clipboard contents as edits using the main model's editor format
Default: False Default: False
Environment variable: `AIDER_APPLY_CLIPBOARD_EDITS` Environment variable: `AIDER_APPLY_CLIPBOARD_EDITS`
### `--yes-always` ### `--yes-always`
Always say yes to every confirmation Always say yes to every confirmation
Environment variable: `AIDER_YES_ALWAYS` Environment variable: `AIDER_YES_ALWAYS`
### `--verbose` ### `--verbose`
Enable verbose output Enable verbose output
Default: False Default: False
Environment variable: `AIDER_VERBOSE` Environment variable: `AIDER_VERBOSE`
Aliases: Aliases:
- `-v` - `-v`
- `--verbose` - `--verbose`
### `--show-repo-map` ### `--show-repo-map`
Print the repo map and exit (debug) Print the repo map and exit (debug)
Default: False Default: False
Environment variable: `AIDER_SHOW_REPO_MAP` Environment variable: `AIDER_SHOW_REPO_MAP`
### `--show-prompts` ### `--show-prompts`
Print the system prompts and exit (debug) Print the system prompts and exit (debug)
Default: False Default: False
Environment variable: `AIDER_SHOW_PROMPTS` Environment variable: `AIDER_SHOW_PROMPTS`
### `--exit` ### `--exit`
Do all startup activities then exit before accepting user input (debug) Do all startup activities then exit before accepting user input (debug)
Default: False Default: False
Environment variable: `AIDER_EXIT` Environment variable: `AIDER_EXIT`
### `--message COMMAND` ### `--message COMMAND`
Specify a single message to send the LLM, process reply then exit (disables chat mode) Specify a single message to send the LLM, process reply then exit (disables chat mode)
Environment variable: `AIDER_MESSAGE` Environment variable: `AIDER_MESSAGE`
Aliases: Aliases:
- `--message COMMAND` - `--message COMMAND`
- `--msg COMMAND` - `--msg COMMAND`
- `-m COMMAND` - `-m COMMAND`
### `--message-file MESSAGE_FILE` ### `--message-file MESSAGE_FILE`
Specify a file containing the message to send the LLM, process reply, then exit (disables chat mode) Specify a file containing the message to send the LLM, process reply, then exit (disables chat mode)
Environment variable: `AIDER_MESSAGE_FILE` Environment variable: `AIDER_MESSAGE_FILE`
Aliases: Aliases:
- `--message-file MESSAGE_FILE` - `--message-file MESSAGE_FILE`
- `-f MESSAGE_FILE` - `-f MESSAGE_FILE`
### `--load LOAD_FILE` ### `--load LOAD_FILE`
Load and execute /commands from a file on launch Load and execute /commands from a file on launch
Environment variable: `AIDER_LOAD` Environment variable: `AIDER_LOAD`
### `--encoding VALUE` ### `--encoding VALUE`
Specify the encoding for input and output (default: utf-8) Specify the encoding for input and output (default: utf-8)
Default: utf-8 Default: utf-8
Environment variable: `AIDER_ENCODING` Environment variable: `AIDER_ENCODING`
### `--config CONFIG_FILE` ### `--config CONFIG_FILE`
Specify the config file (default: search for .aider.conf.yml in git root, cwd or home directory) Specify the config file (default: search for .aider.conf.yml in git root, cwd or home directory)
Aliases: Aliases:
- `-c CONFIG_FILE` - `-c CONFIG_FILE`
- `--config CONFIG_FILE` - `--config CONFIG_FILE`
### `--gui` ### `--gui`
Run aider in your browser (default: False) Run aider in your browser (default: False)
Default: False Default: False
Environment variable: `AIDER_GUI` Environment variable: `AIDER_GUI`
Aliases: Aliases:
- `--gui` - `--gui`
- `--no-gui` - `--no-gui`
@ -663,42 +663,47 @@ Aliases:
- `--no-browser` - `--no-browser`
### `--suggest-shell-commands` ### `--suggest-shell-commands`
Enable/disable suggesting shell commands (default: True) Enable/disable suggesting shell commands (default: True)
Default: True Default: True
Environment variable: `AIDER_SUGGEST_SHELL_COMMANDS` Environment variable: `AIDER_SUGGEST_SHELL_COMMANDS`
Aliases: Aliases:
- `--suggest-shell-commands` - `--suggest-shell-commands`
- `--no-suggest-shell-commands` - `--no-suggest-shell-commands`
### `--fancy-input` ### `--fancy-input`
Enable/disable fancy input with history and completion (default: True) Enable/disable fancy input with history and completion (default: True)
Default: True Default: True
Environment variable: `AIDER_FANCY_INPUT` Environment variable: `AIDER_FANCY_INPUT`
Aliases: Aliases:
- `--fancy-input` - `--fancy-input`
- `--no-fancy-input` - `--no-fancy-input`
### `--detect-urls` ### `--detect-urls`
Enable/disable detection and offering to add URLs to chat (default: True) Enable/disable detection and offering to add URLs to chat (default: True)
Default: True Default: True
Environment variable: `AIDER_DETECT_URLS` Environment variable: `AIDER_DETECT_URLS`
Aliases: Aliases:
- `--detect-urls` - `--detect-urls`
- `--no-detect-urls` - `--no-detect-urls`
### `--editor VALUE` ### `--editor VALUE`
Specify which editor to use for the /editor command Specify which editor to use for the /editor command
Environment variable: `AIDER_EDITOR` Environment variable: `AIDER_EDITOR`
## Voice Settings: ## Voice Settings:
### `--voice-format VOICE_FORMAT` ### `--voice-format VOICE_FORMAT`
Audio format for voice recording (default: wav). webm and mp3 require ffmpeg Audio format for voice recording (default: wav). webm and mp3 require ffmpeg
Default: wav Default: wav
Environment variable: `AIDER_VOICE_FORMAT` Environment variable: `AIDER_VOICE_FORMAT`
### `--voice-language VOICE_LANGUAGE` ### `--voice-language VOICE_LANGUAGE`
Specify the language for voice using ISO 639-1 code (default: auto) Specify the language for voice using ISO 639-1 code (default: auto)
Default: en Default: en
Environment variable: `AIDER_VOICE_LANGUAGE` Environment variable: `AIDER_VOICE_LANGUAGE`
### `--voice-input-device VOICE_INPUT_DEVICE`
Specify the voice input device name used for recording (default: system default)
Default: system default
Environment variable: `VOICE_INPUT_DEVICE`
<!--[[[end]]]--> <!--[[[end]]]-->