chatmcp-cli 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. aider/__init__.py +20 -0
  2. aider/__main__.py +4 -0
  3. aider/_version.py +21 -0
  4. aider/analytics.py +250 -0
  5. aider/args.py +926 -0
  6. aider/args_formatter.py +228 -0
  7. aider/coders/__init__.py +34 -0
  8. aider/coders/architect_coder.py +48 -0
  9. aider/coders/architect_prompts.py +40 -0
  10. aider/coders/ask_coder.py +9 -0
  11. aider/coders/ask_prompts.py +35 -0
  12. aider/coders/base_coder.py +2483 -0
  13. aider/coders/base_prompts.py +60 -0
  14. aider/coders/chat_chunks.py +64 -0
  15. aider/coders/context_coder.py +53 -0
  16. aider/coders/context_prompts.py +75 -0
  17. aider/coders/editblock_coder.py +657 -0
  18. aider/coders/editblock_fenced_coder.py +10 -0
  19. aider/coders/editblock_fenced_prompts.py +143 -0
  20. aider/coders/editblock_func_coder.py +141 -0
  21. aider/coders/editblock_func_prompts.py +27 -0
  22. aider/coders/editblock_prompts.py +174 -0
  23. aider/coders/editor_diff_fenced_coder.py +9 -0
  24. aider/coders/editor_diff_fenced_prompts.py +11 -0
  25. aider/coders/editor_editblock_coder.py +8 -0
  26. aider/coders/editor_editblock_prompts.py +18 -0
  27. aider/coders/editor_whole_coder.py +8 -0
  28. aider/coders/editor_whole_prompts.py +10 -0
  29. aider/coders/help_coder.py +16 -0
  30. aider/coders/help_prompts.py +46 -0
  31. aider/coders/patch_coder.py +706 -0
  32. aider/coders/patch_prompts.py +161 -0
  33. aider/coders/search_replace.py +757 -0
  34. aider/coders/shell.py +37 -0
  35. aider/coders/single_wholefile_func_coder.py +102 -0
  36. aider/coders/single_wholefile_func_prompts.py +27 -0
  37. aider/coders/udiff_coder.py +429 -0
  38. aider/coders/udiff_prompts.py +115 -0
  39. aider/coders/udiff_simple.py +14 -0
  40. aider/coders/udiff_simple_prompts.py +25 -0
  41. aider/coders/wholefile_coder.py +144 -0
  42. aider/coders/wholefile_func_coder.py +134 -0
  43. aider/coders/wholefile_func_prompts.py +27 -0
  44. aider/coders/wholefile_prompts.py +67 -0
  45. aider/commands.py +1665 -0
  46. aider/copypaste.py +72 -0
  47. aider/deprecated.py +126 -0
  48. aider/diffs.py +128 -0
  49. aider/dump.py +29 -0
  50. aider/editor.py +147 -0
  51. aider/exceptions.py +107 -0
  52. aider/format_settings.py +26 -0
  53. aider/gui.py +545 -0
  54. aider/help.py +163 -0
  55. aider/help_pats.py +19 -0
  56. aider/history.py +143 -0
  57. aider/io.py +1175 -0
  58. aider/linter.py +304 -0
  59. aider/llm.py +47 -0
  60. aider/main.py +1267 -0
  61. aider/mdstream.py +243 -0
  62. aider/models.py +1286 -0
  63. aider/onboarding.py +428 -0
  64. aider/openrouter.py +128 -0
  65. aider/prompts.py +64 -0
  66. aider/queries/tree-sitter-language-pack/README.md +7 -0
  67. aider/queries/tree-sitter-language-pack/arduino-tags.scm +5 -0
  68. aider/queries/tree-sitter-language-pack/c-tags.scm +9 -0
  69. aider/queries/tree-sitter-language-pack/chatito-tags.scm +16 -0
  70. aider/queries/tree-sitter-language-pack/commonlisp-tags.scm +122 -0
  71. aider/queries/tree-sitter-language-pack/cpp-tags.scm +15 -0
  72. aider/queries/tree-sitter-language-pack/csharp-tags.scm +26 -0
  73. aider/queries/tree-sitter-language-pack/d-tags.scm +26 -0
  74. aider/queries/tree-sitter-language-pack/dart-tags.scm +92 -0
  75. aider/queries/tree-sitter-language-pack/elisp-tags.scm +5 -0
  76. aider/queries/tree-sitter-language-pack/elixir-tags.scm +54 -0
  77. aider/queries/tree-sitter-language-pack/elm-tags.scm +19 -0
  78. aider/queries/tree-sitter-language-pack/gleam-tags.scm +41 -0
  79. aider/queries/tree-sitter-language-pack/go-tags.scm +42 -0
  80. aider/queries/tree-sitter-language-pack/java-tags.scm +20 -0
  81. aider/queries/tree-sitter-language-pack/javascript-tags.scm +88 -0
  82. aider/queries/tree-sitter-language-pack/lua-tags.scm +34 -0
  83. aider/queries/tree-sitter-language-pack/ocaml-tags.scm +115 -0
  84. aider/queries/tree-sitter-language-pack/ocaml_interface-tags.scm +98 -0
  85. aider/queries/tree-sitter-language-pack/pony-tags.scm +39 -0
  86. aider/queries/tree-sitter-language-pack/properties-tags.scm +5 -0
  87. aider/queries/tree-sitter-language-pack/python-tags.scm +14 -0
  88. aider/queries/tree-sitter-language-pack/r-tags.scm +21 -0
  89. aider/queries/tree-sitter-language-pack/racket-tags.scm +12 -0
  90. aider/queries/tree-sitter-language-pack/ruby-tags.scm +64 -0
  91. aider/queries/tree-sitter-language-pack/rust-tags.scm +60 -0
  92. aider/queries/tree-sitter-language-pack/solidity-tags.scm +43 -0
  93. aider/queries/tree-sitter-language-pack/swift-tags.scm +51 -0
  94. aider/queries/tree-sitter-language-pack/udev-tags.scm +20 -0
  95. aider/queries/tree-sitter-languages/README.md +23 -0
  96. aider/queries/tree-sitter-languages/c-tags.scm +9 -0
  97. aider/queries/tree-sitter-languages/c_sharp-tags.scm +46 -0
  98. aider/queries/tree-sitter-languages/cpp-tags.scm +15 -0
  99. aider/queries/tree-sitter-languages/dart-tags.scm +91 -0
  100. aider/queries/tree-sitter-languages/elisp-tags.scm +8 -0
  101. aider/queries/tree-sitter-languages/elixir-tags.scm +54 -0
  102. aider/queries/tree-sitter-languages/elm-tags.scm +19 -0
  103. aider/queries/tree-sitter-languages/go-tags.scm +30 -0
  104. aider/queries/tree-sitter-languages/hcl-tags.scm +77 -0
  105. aider/queries/tree-sitter-languages/java-tags.scm +20 -0
  106. aider/queries/tree-sitter-languages/javascript-tags.scm +88 -0
  107. aider/queries/tree-sitter-languages/kotlin-tags.scm +27 -0
  108. aider/queries/tree-sitter-languages/ocaml-tags.scm +115 -0
  109. aider/queries/tree-sitter-languages/ocaml_interface-tags.scm +98 -0
  110. aider/queries/tree-sitter-languages/php-tags.scm +26 -0
  111. aider/queries/tree-sitter-languages/python-tags.scm +12 -0
  112. aider/queries/tree-sitter-languages/ql-tags.scm +26 -0
  113. aider/queries/tree-sitter-languages/ruby-tags.scm +64 -0
  114. aider/queries/tree-sitter-languages/rust-tags.scm +60 -0
  115. aider/queries/tree-sitter-languages/scala-tags.scm +65 -0
  116. aider/queries/tree-sitter-languages/typescript-tags.scm +41 -0
  117. aider/reasoning_tags.py +82 -0
  118. aider/repo.py +623 -0
  119. aider/repomap.py +847 -0
  120. aider/report.py +200 -0
  121. aider/resources/__init__.py +3 -0
  122. aider/resources/model-metadata.json +468 -0
  123. aider/resources/model-settings.yml +1767 -0
  124. aider/run_cmd.py +132 -0
  125. aider/scrape.py +284 -0
  126. aider/sendchat.py +61 -0
  127. aider/special.py +203 -0
  128. aider/urls.py +17 -0
  129. aider/utils.py +338 -0
  130. aider/versioncheck.py +113 -0
  131. aider/voice.py +187 -0
  132. aider/waiting.py +221 -0
  133. aider/watch.py +318 -0
  134. aider/watch_prompts.py +12 -0
  135. aider/website/Gemfile +8 -0
  136. aider/website/_includes/blame.md +162 -0
  137. aider/website/_includes/get-started.md +22 -0
  138. aider/website/_includes/help-tip.md +5 -0
  139. aider/website/_includes/help.md +24 -0
  140. aider/website/_includes/install.md +5 -0
  141. aider/website/_includes/keys.md +4 -0
  142. aider/website/_includes/model-warnings.md +67 -0
  143. aider/website/_includes/multi-line.md +22 -0
  144. aider/website/_includes/python-m-aider.md +5 -0
  145. aider/website/_includes/recording.css +228 -0
  146. aider/website/_includes/recording.md +34 -0
  147. aider/website/_includes/replit-pipx.md +9 -0
  148. aider/website/_includes/works-best.md +1 -0
  149. aider/website/_sass/custom/custom.scss +103 -0
  150. aider/website/docs/config/adv-model-settings.md +1881 -0
  151. aider/website/docs/config/aider_conf.md +527 -0
  152. aider/website/docs/config/api-keys.md +90 -0
  153. aider/website/docs/config/dotenv.md +478 -0
  154. aider/website/docs/config/editor.md +127 -0
  155. aider/website/docs/config/model-aliases.md +103 -0
  156. aider/website/docs/config/options.md +843 -0
  157. aider/website/docs/config/reasoning.md +209 -0
  158. aider/website/docs/config.md +44 -0
  159. aider/website/docs/faq.md +378 -0
  160. aider/website/docs/git.md +76 -0
  161. aider/website/docs/index.md +47 -0
  162. aider/website/docs/install/codespaces.md +39 -0
  163. aider/website/docs/install/docker.md +57 -0
  164. aider/website/docs/install/optional.md +100 -0
  165. aider/website/docs/install/replit.md +8 -0
  166. aider/website/docs/install.md +115 -0
  167. aider/website/docs/languages.md +264 -0
  168. aider/website/docs/legal/contributor-agreement.md +111 -0
  169. aider/website/docs/legal/privacy.md +104 -0
  170. aider/website/docs/llms/anthropic.md +77 -0
  171. aider/website/docs/llms/azure.md +48 -0
  172. aider/website/docs/llms/bedrock.md +132 -0
  173. aider/website/docs/llms/cohere.md +34 -0
  174. aider/website/docs/llms/deepseek.md +32 -0
  175. aider/website/docs/llms/gemini.md +49 -0
  176. aider/website/docs/llms/github.md +105 -0
  177. aider/website/docs/llms/groq.md +36 -0
  178. aider/website/docs/llms/lm-studio.md +39 -0
  179. aider/website/docs/llms/ollama.md +75 -0
  180. aider/website/docs/llms/openai-compat.md +39 -0
  181. aider/website/docs/llms/openai.md +58 -0
  182. aider/website/docs/llms/openrouter.md +78 -0
  183. aider/website/docs/llms/other.md +103 -0
  184. aider/website/docs/llms/vertex.md +50 -0
  185. aider/website/docs/llms/warnings.md +10 -0
  186. aider/website/docs/llms/xai.md +53 -0
  187. aider/website/docs/llms.md +54 -0
  188. aider/website/docs/more/analytics.md +122 -0
  189. aider/website/docs/more/edit-formats.md +116 -0
  190. aider/website/docs/more/infinite-output.md +137 -0
  191. aider/website/docs/more-info.md +8 -0
  192. aider/website/docs/recordings/auto-accept-architect.md +31 -0
  193. aider/website/docs/recordings/dont-drop-original-read-files.md +35 -0
  194. aider/website/docs/recordings/index.md +21 -0
  195. aider/website/docs/recordings/model-accepts-settings.md +69 -0
  196. aider/website/docs/recordings/tree-sitter-language-pack.md +80 -0
  197. aider/website/docs/repomap.md +112 -0
  198. aider/website/docs/scripting.md +100 -0
  199. aider/website/docs/troubleshooting/aider-not-found.md +24 -0
  200. aider/website/docs/troubleshooting/edit-errors.md +76 -0
  201. aider/website/docs/troubleshooting/imports.md +62 -0
  202. aider/website/docs/troubleshooting/models-and-keys.md +54 -0
  203. aider/website/docs/troubleshooting/support.md +79 -0
  204. aider/website/docs/troubleshooting/token-limits.md +96 -0
  205. aider/website/docs/troubleshooting/warnings.md +12 -0
  206. aider/website/docs/troubleshooting.md +11 -0
  207. aider/website/docs/usage/browser.md +57 -0
  208. aider/website/docs/usage/caching.md +49 -0
  209. aider/website/docs/usage/commands.md +132 -0
  210. aider/website/docs/usage/conventions.md +119 -0
  211. aider/website/docs/usage/copypaste.md +121 -0
  212. aider/website/docs/usage/images-urls.md +48 -0
  213. aider/website/docs/usage/lint-test.md +118 -0
  214. aider/website/docs/usage/modes.md +211 -0
  215. aider/website/docs/usage/not-code.md +179 -0
  216. aider/website/docs/usage/notifications.md +87 -0
  217. aider/website/docs/usage/tips.md +79 -0
  218. aider/website/docs/usage/tutorials.md +30 -0
  219. aider/website/docs/usage/voice.md +121 -0
  220. aider/website/docs/usage/watch.md +294 -0
  221. aider/website/docs/usage.md +92 -0
  222. aider/website/share/index.md +101 -0
  223. chatmcp_cli-0.1.0.dist-info/METADATA +502 -0
  224. chatmcp_cli-0.1.0.dist-info/RECORD +228 -0
  225. chatmcp_cli-0.1.0.dist-info/WHEEL +5 -0
  226. chatmcp_cli-0.1.0.dist-info/entry_points.txt +3 -0
  227. chatmcp_cli-0.1.0.dist-info/licenses/LICENSE.txt +202 -0
  228. chatmcp_cli-0.1.0.dist-info/top_level.txt +1 -0
aider/args.py ADDED
@@ -0,0 +1,926 @@
1
+ #!/usr/bin/env python
2
+
3
+ import argparse
4
+ import os
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ import configargparse
9
+ import shtab
10
+
11
+ from aider import __version__
12
+ from aider.args_formatter import (
13
+ DotEnvFormatter,
14
+ MarkdownHelpFormatter,
15
+ YamlHelpFormatter,
16
+ )
17
+ from aider.deprecated import add_deprecated_model_args
18
+
19
+ from .dump import dump # noqa: F401
20
+
21
+
22
+ def resolve_aiderignore_path(path_str, git_root=None):
23
+ path = Path(path_str)
24
+ if path.is_absolute():
25
+ return str(path)
26
+ elif git_root:
27
+ return str(Path(git_root) / path)
28
+ return str(path)
29
+
30
+
31
+ def default_env_file(git_root):
32
+ return os.path.join(git_root, ".env") if git_root else ".env"
33
+
34
+
35
+ def get_parser(default_config_files, git_root):
36
+ parser = configargparse.ArgumentParser(
37
+ description="aider is AI pair programming in your terminal",
38
+ add_config_file_help=True,
39
+ default_config_files=default_config_files,
40
+ config_file_parser_class=configargparse.YAMLConfigFileParser,
41
+ auto_env_var_prefix="AIDER_",
42
+ )
43
+ # List of valid edit formats for argparse validation & shtab completion.
44
+ # Dynamically gather them from the registered coder classes so the list
45
+ # stays in sync if new formats are added.
46
+ from aider import coders as _aider_coders
47
+
48
+ edit_format_choices = sorted(
49
+ {
50
+ c.edit_format
51
+ for c in _aider_coders.__all__
52
+ if hasattr(c, "edit_format") and c.edit_format is not None
53
+ }
54
+ )
55
+ group = parser.add_argument_group("Main model")
56
+ group.add_argument(
57
+ "files", metavar="FILE", nargs="*", help="files to edit with an LLM (optional)"
58
+ ).complete = shtab.FILE
59
+ group.add_argument(
60
+ "--model",
61
+ metavar="MODEL",
62
+ default=None,
63
+ help="Specify the model to use for the main chat",
64
+ )
65
+
66
+ ##########
67
+ group = parser.add_argument_group("API Keys and settings")
68
+ group.add_argument(
69
+ "--openai-api-key",
70
+ help="Specify the OpenAI API key",
71
+ )
72
+ group.add_argument(
73
+ "--anthropic-api-key",
74
+ help="Specify the Anthropic API key",
75
+ )
76
+ group.add_argument(
77
+ "--openai-api-base",
78
+ help="Specify the api base url",
79
+ )
80
+ group.add_argument(
81
+ "--openai-api-type",
82
+ help="(deprecated, use --set-env OPENAI_API_TYPE=<value>)",
83
+ )
84
+ group.add_argument(
85
+ "--openai-api-version",
86
+ help="(deprecated, use --set-env OPENAI_API_VERSION=<value>)",
87
+ )
88
+ group.add_argument(
89
+ "--openai-api-deployment-id",
90
+ help="(deprecated, use --set-env OPENAI_API_DEPLOYMENT_ID=<value>)",
91
+ )
92
+ group.add_argument(
93
+ "--openai-organization-id",
94
+ help="(deprecated, use --set-env OPENAI_ORGANIZATION=<value>)",
95
+ )
96
+ group.add_argument(
97
+ "--set-env",
98
+ action="append",
99
+ metavar="ENV_VAR_NAME=value",
100
+ help="Set an environment variable (to control API settings, can be used multiple times)",
101
+ default=[],
102
+ )
103
+ group.add_argument(
104
+ "--api-key",
105
+ action="append",
106
+ metavar="PROVIDER=KEY",
107
+ help=(
108
+ "Set an API key for a provider (eg: --api-key provider=<key> sets"
109
+ " PROVIDER_API_KEY=<key>)"
110
+ ),
111
+ default=[],
112
+ )
113
+ group = parser.add_argument_group("Model settings")
114
+ group.add_argument(
115
+ "--list-models",
116
+ "--models",
117
+ metavar="MODEL",
118
+ help="List known models which match the (partial) MODEL name",
119
+ )
120
+ group.add_argument(
121
+ "--model-settings-file",
122
+ metavar="MODEL_SETTINGS_FILE",
123
+ default=".aider.model.settings.yml",
124
+ help="Specify a file with aider model settings for unknown models",
125
+ ).complete = shtab.FILE
126
+ group.add_argument(
127
+ "--model-metadata-file",
128
+ metavar="MODEL_METADATA_FILE",
129
+ default=".aider.model.metadata.json",
130
+ help="Specify a file with context window and costs for unknown models",
131
+ ).complete = shtab.FILE
132
+ group.add_argument(
133
+ "--alias",
134
+ action="append",
135
+ metavar="ALIAS:MODEL",
136
+ help="Add a model alias (can be used multiple times)",
137
+ )
138
+ group.add_argument(
139
+ "--reasoning-effort",
140
+ type=str,
141
+ help="Set the reasoning_effort API parameter (default: not set)",
142
+ )
143
+ group.add_argument(
144
+ "--thinking-tokens",
145
+ type=str,
146
+ help="Set the thinking token budget for models that support it (default: not set)",
147
+ )
148
+ group.add_argument(
149
+ "--verify-ssl",
150
+ action=argparse.BooleanOptionalAction,
151
+ default=True,
152
+ help="Verify the SSL cert when connecting to models (default: True)",
153
+ )
154
+ group.add_argument(
155
+ "--timeout",
156
+ type=float,
157
+ default=None,
158
+ help="Timeout in seconds for API calls (default: None)",
159
+ )
160
+ group.add_argument(
161
+ "--edit-format",
162
+ "--chat-mode",
163
+ metavar="EDIT_FORMAT",
164
+ choices=edit_format_choices,
165
+ default=None,
166
+ help="Specify what edit format the LLM should use (default depends on model)",
167
+ )
168
+ group.add_argument(
169
+ "--architect",
170
+ action="store_const",
171
+ dest="edit_format",
172
+ const="architect",
173
+ help="Use architect edit format for the main chat",
174
+ )
175
+ group.add_argument(
176
+ "--auto-accept-architect",
177
+ action=argparse.BooleanOptionalAction,
178
+ default=True,
179
+ help="Enable/disable automatic acceptance of architect changes (default: True)",
180
+ )
181
+ group.add_argument(
182
+ "--weak-model",
183
+ metavar="WEAK_MODEL",
184
+ default=None,
185
+ help=(
186
+ "Specify the model to use for commit messages and chat history summarization (default"
187
+ " depends on --model)"
188
+ ),
189
+ )
190
+ group.add_argument(
191
+ "--editor-model",
192
+ metavar="EDITOR_MODEL",
193
+ default=None,
194
+ help="Specify the model to use for editor tasks (default depends on --model)",
195
+ )
196
+ group.add_argument(
197
+ "--editor-edit-format",
198
+ metavar="EDITOR_EDIT_FORMAT",
199
+ choices=edit_format_choices,
200
+ default=None,
201
+ help="Specify the edit format for the editor model (default: depends on editor model)",
202
+ )
203
+ group.add_argument(
204
+ "--show-model-warnings",
205
+ action=argparse.BooleanOptionalAction,
206
+ default=True,
207
+ help="Only work with models that have meta-data available (default: True)",
208
+ )
209
+ group.add_argument(
210
+ "--check-model-accepts-settings",
211
+ action=argparse.BooleanOptionalAction,
212
+ default=True,
213
+ help=(
214
+ "Check if model accepts settings like reasoning_effort/thinking_tokens (default: True)"
215
+ ),
216
+ )
217
+ group.add_argument(
218
+ "--max-chat-history-tokens",
219
+ type=int,
220
+ default=None,
221
+ help=(
222
+ "Soft limit on tokens for chat history, after which summarization begins."
223
+ " If unspecified, defaults to the model's max_chat_history_tokens."
224
+ ),
225
+ )
226
+
227
+ ##########
228
+ group = parser.add_argument_group("Cache settings")
229
+ group.add_argument(
230
+ "--cache-prompts",
231
+ action=argparse.BooleanOptionalAction,
232
+ default=False,
233
+ help="Enable caching of prompts (default: False)",
234
+ )
235
+ group.add_argument(
236
+ "--cache-keepalive-pings",
237
+ type=int,
238
+ default=0,
239
+ help="Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)",
240
+ )
241
+
242
+ ##########
243
+ group = parser.add_argument_group("Repomap settings")
244
+ group.add_argument(
245
+ "--map-tokens",
246
+ type=int,
247
+ default=None,
248
+ help="Suggested number of tokens to use for repo map, use 0 to disable",
249
+ )
250
+ group.add_argument(
251
+ "--map-refresh",
252
+ choices=["auto", "always", "files", "manual"],
253
+ default="auto",
254
+ help=(
255
+ "Control how often the repo map is refreshed. Options: auto, always, files, manual"
256
+ " (default: auto)"
257
+ ),
258
+ )
259
+ group.add_argument(
260
+ "--map-multiplier-no-files",
261
+ type=float,
262
+ default=2,
263
+ help="Multiplier for map tokens when no files are specified (default: 2)",
264
+ )
265
+
266
+ ##########
267
+ group = parser.add_argument_group("History Files")
268
+ default_input_history_file = (
269
+ os.path.join(git_root, ".aider.input.history") if git_root else ".aider.input.history"
270
+ )
271
+ default_chat_history_file = (
272
+ os.path.join(git_root, ".aider.chat.history.md") if git_root else ".aider.chat.history.md"
273
+ )
274
+ group.add_argument(
275
+ "--input-history-file",
276
+ metavar="INPUT_HISTORY_FILE",
277
+ default=default_input_history_file,
278
+ help=f"Specify the chat input history file (default: {default_input_history_file})",
279
+ ).complete = shtab.FILE
280
+ group.add_argument(
281
+ "--chat-history-file",
282
+ metavar="CHAT_HISTORY_FILE",
283
+ default=default_chat_history_file,
284
+ help=f"Specify the chat history file (default: {default_chat_history_file})",
285
+ ).complete = shtab.FILE
286
+ group.add_argument(
287
+ "--restore-chat-history",
288
+ action=argparse.BooleanOptionalAction,
289
+ default=False,
290
+ help="Restore the previous chat history messages (default: False)",
291
+ )
292
+ group.add_argument(
293
+ "--llm-history-file",
294
+ metavar="LLM_HISTORY_FILE",
295
+ default=None,
296
+ help="Log the conversation with the LLM to this file (for example, .aider.llm.history)",
297
+ ).complete = shtab.FILE
298
+
299
+ ##########
300
+ group = parser.add_argument_group("Output settings")
301
+ group.add_argument(
302
+ "--dark-mode",
303
+ action="store_true",
304
+ help="Use colors suitable for a dark terminal background (default: False)",
305
+ default=False,
306
+ )
307
+ group.add_argument(
308
+ "--light-mode",
309
+ action="store_true",
310
+ help="Use colors suitable for a light terminal background (default: False)",
311
+ default=False,
312
+ )
313
+ group.add_argument(
314
+ "--pretty",
315
+ action=argparse.BooleanOptionalAction,
316
+ default=True,
317
+ help="Enable/disable pretty, colorized output (default: True)",
318
+ )
319
+ group.add_argument(
320
+ "--stream",
321
+ action=argparse.BooleanOptionalAction,
322
+ default=True,
323
+ help="Enable/disable streaming responses (default: True)",
324
+ )
325
+ group.add_argument(
326
+ "--user-input-color",
327
+ default="#00cc00",
328
+ help="Set the color for user input (default: #00cc00)",
329
+ )
330
+ group.add_argument(
331
+ "--tool-output-color",
332
+ default=None,
333
+ help="Set the color for tool output (default: None)",
334
+ )
335
+ group.add_argument(
336
+ "--tool-error-color",
337
+ default="#FF2222",
338
+ help="Set the color for tool error messages (default: #FF2222)",
339
+ )
340
+ group.add_argument(
341
+ "--tool-warning-color",
342
+ default="#FFA500",
343
+ help="Set the color for tool warning messages (default: #FFA500)",
344
+ )
345
+ group.add_argument(
346
+ "--assistant-output-color",
347
+ default="#0088ff",
348
+ help="Set the color for assistant output (default: #0088ff)",
349
+ )
350
+ group.add_argument(
351
+ "--completion-menu-color",
352
+ metavar="COLOR",
353
+ default=None,
354
+ help="Set the color for the completion menu (default: terminal's default text color)",
355
+ )
356
+ group.add_argument(
357
+ "--completion-menu-bg-color",
358
+ metavar="COLOR",
359
+ default=None,
360
+ help=(
361
+ "Set the background color for the completion menu (default: terminal's default"
362
+ " background color)"
363
+ ),
364
+ )
365
+ group.add_argument(
366
+ "--completion-menu-current-color",
367
+ metavar="COLOR",
368
+ default=None,
369
+ help=(
370
+ "Set the color for the current item in the completion menu (default: terminal's default"
371
+ " background color)"
372
+ ),
373
+ )
374
+ group.add_argument(
375
+ "--completion-menu-current-bg-color",
376
+ metavar="COLOR",
377
+ default=None,
378
+ help=(
379
+ "Set the background color for the current item in the completion menu (default:"
380
+ " terminal's default text color)"
381
+ ),
382
+ )
383
+ group.add_argument(
384
+ "--code-theme",
385
+ default="default",
386
+ help=(
387
+ "Set the markdown code theme (default: default, other options include monokai,"
388
+ " solarized-dark, solarized-light, or a Pygments builtin style,"
389
+ " see https://pygments.org/styles for available themes)"
390
+ ),
391
+ )
392
+ group.add_argument(
393
+ "--show-diffs",
394
+ action="store_true",
395
+ help="Show diffs when committing changes (default: False)",
396
+ default=False,
397
+ )
398
+
399
+ ##########
400
+ group = parser.add_argument_group("Git settings")
401
+ group.add_argument(
402
+ "--git",
403
+ action=argparse.BooleanOptionalAction,
404
+ default=True,
405
+ help="Enable/disable looking for a git repo (default: True)",
406
+ )
407
+ group.add_argument(
408
+ "--gitignore",
409
+ action=argparse.BooleanOptionalAction,
410
+ default=True,
411
+ help="Enable/disable adding .aider* to .gitignore (default: True)",
412
+ )
413
+ default_aiderignore_file = (
414
+ os.path.join(git_root, ".aiderignore") if git_root else ".aiderignore"
415
+ )
416
+
417
+ group.add_argument(
418
+ "--aiderignore",
419
+ metavar="AIDERIGNORE",
420
+ type=lambda path_str: resolve_aiderignore_path(path_str, git_root),
421
+ default=default_aiderignore_file,
422
+ help="Specify the aider ignore file (default: .aiderignore in git root)",
423
+ ).complete = shtab.FILE
424
+ group.add_argument(
425
+ "--subtree-only",
426
+ action="store_true",
427
+ help="Only consider files in the current subtree of the git repository",
428
+ default=False,
429
+ )
430
+ group.add_argument(
431
+ "--auto-commits",
432
+ action=argparse.BooleanOptionalAction,
433
+ default=True,
434
+ help="Enable/disable auto commit of LLM changes (default: True)",
435
+ )
436
+ group.add_argument(
437
+ "--dirty-commits",
438
+ action=argparse.BooleanOptionalAction,
439
+ default=True,
440
+ help="Enable/disable commits when repo is found dirty (default: True)",
441
+ )
442
+ group.add_argument(
443
+ "--attribute-author",
444
+ action=argparse.BooleanOptionalAction,
445
+ default=None,
446
+ help=(
447
+ "Attribute aider code changes in the git author name (default: True). If explicitly set"
448
+ " to True, overrides --attribute-co-authored-by precedence."
449
+ ),
450
+ )
451
+ group.add_argument(
452
+ "--attribute-committer",
453
+ action=argparse.BooleanOptionalAction,
454
+ default=None,
455
+ help=(
456
+ "Attribute aider commits in the git committer name (default: True). If explicitly set"
457
+ " to True, overrides --attribute-co-authored-by precedence for aider edits."
458
+ ),
459
+ )
460
+ group.add_argument(
461
+ "--attribute-commit-message-author",
462
+ action=argparse.BooleanOptionalAction,
463
+ default=False,
464
+ help="Prefix commit messages with 'aider: ' if aider authored the changes (default: False)",
465
+ )
466
+ group.add_argument(
467
+ "--attribute-commit-message-committer",
468
+ action=argparse.BooleanOptionalAction,
469
+ default=False,
470
+ help="Prefix all commit messages with 'aider: ' (default: False)",
471
+ )
472
+ group.add_argument(
473
+ "--attribute-co-authored-by",
474
+ action=argparse.BooleanOptionalAction,
475
+ default=False,
476
+ help=(
477
+ "Attribute aider edits using the Co-authored-by trailer in the commit message"
478
+ " (default: False). If True, this takes precedence over default --attribute-author and"
479
+ " --attribute-committer behavior unless they are explicitly set to True."
480
+ ),
481
+ )
482
+ group.add_argument(
483
+ "--git-commit-verify",
484
+ action=argparse.BooleanOptionalAction,
485
+ default=False,
486
+ help="Enable/disable git pre-commit hooks with --no-verify (default: False)",
487
+ )
488
+ group.add_argument(
489
+ "--commit",
490
+ action="store_true",
491
+ help="Commit all pending changes with a suitable commit message, then exit",
492
+ default=False,
493
+ )
494
+ group.add_argument(
495
+ "--commit-prompt",
496
+ metavar="PROMPT",
497
+ help="Specify a custom prompt for generating commit messages",
498
+ )
499
+ group.add_argument(
500
+ "--dry-run",
501
+ action=argparse.BooleanOptionalAction,
502
+ default=False,
503
+ help="Perform a dry run without modifying files (default: False)",
504
+ )
505
+ group.add_argument(
506
+ "--skip-sanity-check-repo",
507
+ action="store_true",
508
+ help="Skip the sanity check for the git repository (default: False)",
509
+ default=False,
510
+ )
511
+ group.add_argument(
512
+ "--watch-files",
513
+ action=argparse.BooleanOptionalAction,
514
+ default=False,
515
+ help="Enable/disable watching files for ai coding comments (default: False)",
516
+ )
517
+ group = parser.add_argument_group("Fixing and committing")
518
+ group.add_argument(
519
+ "--lint",
520
+ action="store_true",
521
+ help="Lint and fix provided files, or dirty files if none provided",
522
+ default=False,
523
+ )
524
+ group.add_argument(
525
+ "--lint-cmd",
526
+ action="append",
527
+ help=(
528
+ 'Specify lint commands to run for different languages, eg: "python: flake8'
529
+ ' --select=..." (can be used multiple times)'
530
+ ),
531
+ default=[],
532
+ )
533
+ group.add_argument(
534
+ "--auto-lint",
535
+ action=argparse.BooleanOptionalAction,
536
+ default=True,
537
+ help="Enable/disable automatic linting after changes (default: True)",
538
+ )
539
+ group.add_argument(
540
+ "--test-cmd",
541
+ help="Specify command to run tests",
542
+ default=[],
543
+ )
544
+ group.add_argument(
545
+ "--auto-test",
546
+ action=argparse.BooleanOptionalAction,
547
+ default=False,
548
+ help="Enable/disable automatic testing after changes (default: False)",
549
+ )
550
+ group.add_argument(
551
+ "--test",
552
+ action="store_true",
553
+ help="Run tests, fix problems found and then exit",
554
+ default=False,
555
+ )
556
+
557
+ ##########
558
+ group = parser.add_argument_group("Analytics")
559
+ group.add_argument(
560
+ "--analytics",
561
+ action=argparse.BooleanOptionalAction,
562
+ default=None,
563
+ help="Enable/disable analytics for current session (default: random)",
564
+ )
565
+ group.add_argument(
566
+ "--analytics-log",
567
+ metavar="ANALYTICS_LOG_FILE",
568
+ help="Specify a file to log analytics events",
569
+ ).complete = shtab.FILE
570
+ group.add_argument(
571
+ "--analytics-disable",
572
+ action="store_true",
573
+ help="Permanently disable analytics",
574
+ default=False,
575
+ )
576
+
577
+ #########
578
+ group = parser.add_argument_group("Upgrading")
579
+ group.add_argument(
580
+ "--just-check-update",
581
+ action="store_true",
582
+ help="Check for updates and return status in the exit code",
583
+ default=False,
584
+ )
585
+ group.add_argument(
586
+ "--check-update",
587
+ action=argparse.BooleanOptionalAction,
588
+ help="Check for new aider versions on launch",
589
+ default=True,
590
+ )
591
+ group.add_argument(
592
+ "--show-release-notes",
593
+ action=argparse.BooleanOptionalAction,
594
+ help="Show release notes on first run of new version (default: None, ask user)",
595
+ default=None,
596
+ )
597
+ group.add_argument(
598
+ "--install-main-branch",
599
+ action="store_true",
600
+ help="Install the latest version from the main branch",
601
+ default=False,
602
+ )
603
+ group.add_argument(
604
+ "--upgrade",
605
+ "--update",
606
+ action="store_true",
607
+ help="Upgrade aider to the latest version from PyPI",
608
+ default=False,
609
+ )
610
+ group.add_argument(
611
+ "--version",
612
+ action="version",
613
+ version=f"%(prog)s {__version__}",
614
+ help="Show the version number and exit",
615
+ )
616
+
617
+ ##########
618
+ group = parser.add_argument_group("Modes")
619
+ group.add_argument(
620
+ "--message",
621
+ "--msg",
622
+ "-m",
623
+ metavar="COMMAND",
624
+ help=(
625
+ "Specify a single message to send the LLM, process reply then exit (disables chat mode)"
626
+ ),
627
+ )
628
+ group.add_argument(
629
+ "--message-file",
630
+ "-f",
631
+ metavar="MESSAGE_FILE",
632
+ help=(
633
+ "Specify a file containing the message to send the LLM, process reply, then exit"
634
+ " (disables chat mode)"
635
+ ),
636
+ ).complete = shtab.FILE
637
+ group.add_argument(
638
+ "--gui",
639
+ "--browser",
640
+ action=argparse.BooleanOptionalAction,
641
+ help="Run aider in your browser (default: False)",
642
+ default=False,
643
+ )
644
+ group.add_argument(
645
+ "--copy-paste",
646
+ action=argparse.BooleanOptionalAction,
647
+ default=False,
648
+ help="Enable automatic copy/paste of chat between aider and web UI (default: False)",
649
+ )
650
+ group.add_argument(
651
+ "--apply",
652
+ metavar="FILE",
653
+ help="Apply the changes from the given file instead of running the chat (debug)",
654
+ ).complete = shtab.FILE
655
+ group.add_argument(
656
+ "--apply-clipboard-edits",
657
+ action="store_true",
658
+ help="Apply clipboard contents as edits using the main model's editor format",
659
+ default=False,
660
+ )
661
+ group.add_argument(
662
+ "--exit",
663
+ action="store_true",
664
+ help="Do all startup activities then exit before accepting user input (debug)",
665
+ default=False,
666
+ )
667
+ group.add_argument(
668
+ "--show-repo-map",
669
+ action="store_true",
670
+ help="Print the repo map and exit (debug)",
671
+ default=False,
672
+ )
673
+ group.add_argument(
674
+ "--show-prompts",
675
+ action="store_true",
676
+ help="Print the system prompts and exit (debug)",
677
+ default=False,
678
+ )
679
+
680
+ ##########
681
+ group = parser.add_argument_group("Voice settings")
682
+ group.add_argument(
683
+ "--voice-format",
684
+ metavar="VOICE_FORMAT",
685
+ default="wav",
686
+ choices=["wav", "mp3", "webm"],
687
+ help="Audio format for voice recording (default: wav). webm and mp3 require ffmpeg",
688
+ )
689
+ group.add_argument(
690
+ "--voice-language",
691
+ metavar="VOICE_LANGUAGE",
692
+ default="en",
693
+ help="Specify the language for voice using ISO 639-1 code (default: auto)",
694
+ )
695
+ group.add_argument(
696
+ "--voice-input-device",
697
+ metavar="VOICE_INPUT_DEVICE",
698
+ default=None,
699
+ help="Specify the input device name for voice recording",
700
+ )
701
+
702
+ ######
703
+ group = parser.add_argument_group("Other settings")
704
+ group.add_argument(
705
+ "--disable-playwright",
706
+ action="store_true",
707
+ help="Never prompt for or attempt to install Playwright for web scraping (default: False).",
708
+ default=False,
709
+ )
710
+ group.add_argument(
711
+ "--file",
712
+ action="append",
713
+ metavar="FILE",
714
+ help="specify a file to edit (can be used multiple times)",
715
+ ).complete = shtab.FILE
716
+ group.add_argument(
717
+ "--read",
718
+ action="append",
719
+ metavar="FILE",
720
+ help="specify a read-only file (can be used multiple times)",
721
+ ).complete = shtab.FILE
722
+ group.add_argument(
723
+ "--vim",
724
+ action="store_true",
725
+ help="Use VI editing mode in the terminal (default: False)",
726
+ default=False,
727
+ )
728
+ group.add_argument(
729
+ "--chat-language",
730
+ metavar="CHAT_LANGUAGE",
731
+ default=None,
732
+ help="Specify the language to use in the chat (default: None, uses system settings)",
733
+ )
734
+ group.add_argument(
735
+ "--commit-language",
736
+ metavar="COMMIT_LANGUAGE",
737
+ default=None,
738
+ help="Specify the language to use in the commit message (default: None, user language)",
739
+ )
740
+ group.add_argument(
741
+ "--yes-always",
742
+ action="store_true",
743
+ help="Always say yes to every confirmation",
744
+ default=None,
745
+ )
746
+ group.add_argument(
747
+ "-v",
748
+ "--verbose",
749
+ action="store_true",
750
+ help="Enable verbose output",
751
+ default=False,
752
+ )
753
+ group.add_argument(
754
+ "--load",
755
+ metavar="LOAD_FILE",
756
+ help="Load and execute /commands from a file on launch",
757
+ ).complete = shtab.FILE
758
+ group.add_argument(
759
+ "--encoding",
760
+ default="utf-8",
761
+ help="Specify the encoding for input and output (default: utf-8)",
762
+ )
763
+ group.add_argument(
764
+ "--line-endings",
765
+ choices=["platform", "lf", "crlf"],
766
+ default="platform",
767
+ help="Line endings to use when writing files (default: platform)",
768
+ )
769
+ group.add_argument(
770
+ "-c",
771
+ "--config",
772
+ is_config_file=True,
773
+ metavar="CONFIG_FILE",
774
+ help=(
775
+ "Specify the config file (default: search for .aider.conf.yml in git root, cwd"
776
+ " or home directory)"
777
+ ),
778
+ ).complete = shtab.FILE
779
+ # This is a duplicate of the argument in the preparser and is a no-op by this time of
780
+ # argument parsing, but it's here so that the help is displayed as expected.
781
+ group.add_argument(
782
+ "--env-file",
783
+ metavar="ENV_FILE",
784
+ default=default_env_file(git_root),
785
+ help="Specify the .env file to load (default: .env in git root)",
786
+ ).complete = shtab.FILE
787
+ group.add_argument(
788
+ "--suggest-shell-commands",
789
+ action=argparse.BooleanOptionalAction,
790
+ default=True,
791
+ help="Enable/disable suggesting shell commands (default: True)",
792
+ )
793
+ group.add_argument(
794
+ "--fancy-input",
795
+ action=argparse.BooleanOptionalAction,
796
+ default=True,
797
+ help="Enable/disable fancy input with history and completion (default: True)",
798
+ )
799
+ group.add_argument(
800
+ "--multiline",
801
+ action=argparse.BooleanOptionalAction,
802
+ default=False,
803
+ help="Enable/disable multi-line input mode with Meta-Enter to submit (default: False)",
804
+ )
805
+ group.add_argument(
806
+ "--notifications",
807
+ action=argparse.BooleanOptionalAction,
808
+ default=False,
809
+ help=(
810
+ "Enable/disable terminal bell notifications when LLM responses are ready (default:"
811
+ " False)"
812
+ ),
813
+ )
814
+ group.add_argument(
815
+ "--notifications-command",
816
+ metavar="COMMAND",
817
+ default=None,
818
+ help=(
819
+ "Specify a command to run for notifications instead of the terminal bell. If not"
820
+ " specified, a default command for your OS may be used."
821
+ ),
822
+ )
823
+ group.add_argument(
824
+ "--detect-urls",
825
+ action=argparse.BooleanOptionalAction,
826
+ default=True,
827
+ help="Enable/disable detection and offering to add URLs to chat (default: True)",
828
+ )
829
+ group.add_argument(
830
+ "--editor",
831
+ help="Specify which editor to use for the /editor command",
832
+ )
833
+
834
+ supported_shells_list = sorted(list(shtab.SUPPORTED_SHELLS))
835
+ group.add_argument(
836
+ "--shell-completions",
837
+ metavar="SHELL",
838
+ choices=supported_shells_list,
839
+ help=(
840
+ "Print shell completion script for the specified SHELL and exit. Supported shells:"
841
+ f" {', '.join(supported_shells_list)}. Example: aider --shell-completions bash"
842
+ ),
843
+ )
844
+
845
+ ##########
846
+ group = parser.add_argument_group("Deprecated model settings")
847
+ # Add deprecated model shortcut arguments
848
+ add_deprecated_model_args(parser, group)
849
+
850
+ return parser
851
+
852
+
853
+ def get_md_help():
854
+ os.environ["COLUMNS"] = "70"
855
+ sys.argv = ["aider"]
856
+ parser = get_parser([], None)
857
+
858
+ # This instantiates all the action.env_var values
859
+ parser.parse_known_args()
860
+
861
+ parser.formatter_class = MarkdownHelpFormatter
862
+
863
+ return argparse.ArgumentParser.format_help(parser)
864
+
865
+
866
+ def get_sample_yaml():
867
+ os.environ["COLUMNS"] = "100"
868
+ sys.argv = ["aider"]
869
+ parser = get_parser([], None)
870
+
871
+ # This instantiates all the action.env_var values
872
+ parser.parse_known_args()
873
+
874
+ parser.formatter_class = YamlHelpFormatter
875
+
876
+ return argparse.ArgumentParser.format_help(parser)
877
+
878
+
879
+ def get_sample_dotenv():
880
+ os.environ["COLUMNS"] = "120"
881
+ sys.argv = ["aider"]
882
+ parser = get_parser([], None)
883
+
884
+ # This instantiates all the action.env_var values
885
+ parser.parse_known_args()
886
+
887
+ parser.formatter_class = DotEnvFormatter
888
+
889
+ return argparse.ArgumentParser.format_help(parser)
890
+
891
+
892
+ def main():
893
+ if len(sys.argv) > 1:
894
+ command = sys.argv[1]
895
+ else:
896
+ command = "yaml" # Default to yaml if no command is given
897
+
898
+ if command == "md":
899
+ print(get_md_help())
900
+ elif command == "dotenv":
901
+ print(get_sample_dotenv())
902
+ elif command == "yaml":
903
+ print(get_sample_yaml())
904
+ elif command == "completion":
905
+ if len(sys.argv) > 2:
906
+ shell = sys.argv[2]
907
+ if shell not in shtab.SUPPORTED_SHELLS:
908
+ print(f"Error: Unsupported shell '{shell}'.", file=sys.stderr)
909
+ print(f"Supported shells are: {', '.join(shtab.SUPPORTED_SHELLS)}", file=sys.stderr)
910
+ sys.exit(1)
911
+ parser = get_parser([], None)
912
+ parser.prog = "aider" # Set the program name on the parser
913
+ print(shtab.complete(parser, shell=shell))
914
+ else:
915
+ print("Error: Please specify a shell for completion.", file=sys.stderr)
916
+ print(f"Usage: python {sys.argv[0]} completion <shell_name>", file=sys.stderr)
917
+ print(f"Supported shells are: {', '.join(shtab.SUPPORTED_SHELLS)}", file=sys.stderr)
918
+ sys.exit(1)
919
+ else:
920
+ # Default to YAML for any other unrecognized argument, or if 'yaml' was explicitly passed
921
+ print(get_sample_yaml())
922
+
923
+
924
+ if __name__ == "__main__":
925
+ status = main()
926
+ sys.exit(status)