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
@@ -0,0 +1,79 @@
1
+ ---
2
+ parent: Troubleshooting
3
+ excerpt: Use "/help <question>" to ask for help about using aider, customizing settings, troubleshooting, using LLMs, etc.
4
+ nav_order: 30
5
+ ---
6
+
7
+ # Using /help
8
+
9
+ Type `/help <question>` and
10
+ aider will respond with helpful information.
11
+ You can ask questions about using aider,
12
+ customizing settings, troubleshooting, using LLMs, etc.
13
+
14
+ Behind the scenes, aider has indexed all of its
15
+ [documentation](https://aider.chat/).
16
+ It uses the question to find relevant docs
17
+ and share them with the LLM to do
18
+ retrieval augmented generation (RAG)
19
+ The LLM also has the full context of your ongoing
20
+ aider chat,
21
+ so it can help with the exact issue you might be facing.
22
+
23
+
24
+ <div class="chat-transcript" markdown="1">
25
+
26
+ > Aider v0.42.1-dev
27
+ > Models: claude-3-5-sonnet with diff edit format
28
+ > Repo-map: using 1024 tokens
29
+ > Use /help \<question\> to ask for help, run with --help to see cmd line args
30
+
31
+ #### /help is the .env file global or for a git repo?
32
+
33
+ Based on the provided documentation, here's the answer to your question about the .env file in aider:
34
+
35
+ The .env file in aider can be both global and specific to a git repository. Aider looks for .env files in multiple locations, with the following priority order:
36
+
37
+ 1. Your home directory (global)
38
+ 2. The root of your git repo (repo-specific)
39
+ 3. The current directory
40
+ 4. A file specified with the `--env-file <filename>` parameter
41
+
42
+ If multiple .env files exist in these locations, they are loaded in the order listed above, with files loaded last taking priority. This means you can have a global .env file in your home directory with general settings, and then override or add to those settings with a repo-specific .env file in your git repository root.
43
+
44
+ Here are some relevant documentation links that you might find helpful:
45
+
46
+ - https://aider.chat/docs/config.html
47
+ - https://aider.chat/docs/config/dotenv.html
48
+
49
+ The ability to use both global and repo-specific .env files allows for flexible configuration, where you can set default values globally and override them on a per-project basis as needed.
50
+
51
+ </div>
52
+ <div class="chat-transcript" markdown="1">
53
+
54
+ #### /help can i use local LLMs?
55
+
56
+ Yes, you can use local LLMs with Aider. Here's a summary of the options:
57
+
58
+ 1. Ollama: Aider supports using local models through Ollama.
59
+
60
+ 2. OpenAI-compatible API: Aider can access local models that provide an OpenAI-compatible API.
61
+
62
+ 3. Other local models: Aider uses the LiteLLM package to connect to various LLM providers, which may include options for running models locally.
63
+
64
+ However, it's important to note that Aider works best with more capable models. Less capable models may have difficulty properly returning "code edits," which could result in Aider not being able to edit your files and commit changes effectively.
65
+
66
+ For more detailed information on using local LLMs and connecting to various models, you might want to check out these relevant documentation pages:
67
+
68
+ - https://aider.chat/docs/llms.html
69
+ - https://aider.chat/docs/llms/ollama.html
70
+ - https://aider.chat/docs/llms/openai-compat.html
71
+
72
+ Keep in mind that the performance and capabilities of local LLMs may vary depending on the specific model and your hardware resources.
73
+
74
+ </div>
75
+
76
+
77
+ ## Getting more help
78
+
79
+ {% include help.md %}
@@ -0,0 +1,96 @@
1
+ ---
2
+ parent: Troubleshooting
3
+ nav_order: 25
4
+ ---
5
+
6
+ # Token limits
7
+
8
+ Every LLM has limits on how many tokens it can process for each request:
9
+
10
+ - The model's **context window** limits how many total tokens of
11
+ *input and output* it can process.
12
+ - Each model has limit on how many **output tokens** it can
13
+ produce.
14
+
15
+ Aider will report an error **if a model responds** indicating that
16
+ it has exceeded a token limit.
17
+ The error will include suggested actions to try and
18
+ avoid hitting token limits.
19
+
20
+ Here's an example error:
21
+
22
+ ```
23
+ Model gpt-3.5-turbo has hit a token limit!
24
+
25
+ Input tokens: 768 of 16385
26
+ Output tokens: 4096 of 4096 -- exceeded output limit!
27
+ Total tokens: 4864 of 16385
28
+
29
+ To reduce output tokens:
30
+ - Ask for smaller changes in each request.
31
+ - Break your code into smaller source files.
32
+ - Try using a stronger model like DeepSeek V3 or Sonnet that can return diffs.
33
+
34
+ For more info: https://aider.chat/docs/token-limits.html
35
+ ```
36
+
37
+ {: .note }
38
+ Aider never *enforces* token limits, it only *reports* token limit errors
39
+ from the API provider.
40
+ The token counts that aider reports are *estimates*.
41
+
42
+ ## Input tokens & context window size
43
+
44
+ The most common problem is trying to send too much data to a
45
+ model,
46
+ overflowing its context window.
47
+ Technically you can exhaust the context window if the input is
48
+ too large or if the input plus output are too large.
49
+
50
+ Strong models like GPT-4o and Sonnet have quite
51
+ large context windows, so this sort of error is
52
+ typically only an issue when working with weaker models.
53
+
54
+ The easiest solution is to try and reduce the input tokens
55
+ by removing files from the chat.
56
+ It's best to only add the files that aider will need to *edit*
57
+ to complete your request.
58
+
59
+ - Use `/tokens` to see token usage.
60
+ - Use `/drop` to remove unneeded files from the chat session.
61
+ - Use `/clear` to clear the chat history.
62
+ - Break your code into smaller source files.
63
+
64
+ ## Output token limits
65
+
66
+ Most models have quite small output limits, often as low
67
+ as 4k tokens.
68
+ If you ask aider to make a large change that affects a lot
69
+ of code, the LLM may hit output token limits
70
+ as it tries to send back all the changes.
71
+
72
+ To avoid hitting output token limits:
73
+
74
+ - Ask for smaller changes in each request.
75
+ - Break your code into smaller source files.
76
+ - Use a strong model like gpt-4o, sonnet or DeepSeek V3 that can return diffs.
77
+ - Use a model that supports [infinite output](/docs/more/infinite-output.html).
78
+
79
+ ## Other causes
80
+
81
+ Sometimes token limit errors are caused by
82
+ non-compliant API proxy servers
83
+ or bugs in the API server you are using to host a local model.
84
+ Aider has been well tested when directly connecting to
85
+ major
86
+ [LLM provider cloud APIs](https://aider.chat/docs/llms.html).
87
+ For serving local models,
88
+ [Ollama](https://aider.chat/docs/llms/ollama.html) is known to work well with aider.
89
+
90
+ Try using aider without an API proxy server
91
+ or directly with one of the recommended cloud APIs
92
+ and see if your token limit problems resolve.
93
+
94
+ ## More help
95
+
96
+ {% include help.md %}
@@ -0,0 +1,12 @@
1
+ ---
2
+ parent: Troubleshooting
3
+ nav_order: 20
4
+ ---
5
+
6
+ # Model warnings
7
+
8
+ {% include model-warnings.md %}
9
+
10
+ ## More help
11
+
12
+ {% include help.md %}
@@ -0,0 +1,11 @@
1
+ ---
2
+ nav_order: 60
3
+ has_children: true
4
+ description: How to troubleshoot problems with aider and get help.
5
+ ---
6
+
7
+ # Troubleshooting
8
+
9
+ Below are some approaches for troubleshooting problems with aider.
10
+
11
+ {% include help.md %}
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: Aider in your browser
3
+ highlight_image: /assets/browser.jpg
4
+ parent: Usage
5
+ nav_order: 800
6
+ description: Aider can run in your browser, not just on the command line.
7
+ ---
8
+ {% if page.date %}
9
+ <p class="post-date">{{ page.date | date: "%B %d, %Y" }}</p>
10
+ {% endif %}
11
+
12
+ # Aider in your browser
13
+
14
+ <div class="video-container">
15
+ <video controls loop poster="/assets/browser.jpg">
16
+ <source src="/assets/aider-browser-social.mp4" type="video/mp4">
17
+ <a href="/assets/aider-browser-social.mp4">Aider browser UI demo video</a>
18
+ </video>
19
+ </div>
20
+
21
+ <style>
22
+ .video-container {
23
+ position: relative;
24
+ padding-bottom: 101.89%; /* 1080 / 1060 = 1.0189 */
25
+ height: 0;
26
+ overflow: hidden;
27
+ }
28
+
29
+ .video-container video {
30
+ position: absolute;
31
+ top: 0;
32
+ left: 0;
33
+ width: 100%;
34
+ height: 100%;
35
+ }
36
+ </style>
37
+
38
+ Use aider's new experimental browser UI to collaborate with LLMs
39
+ to edit code in your local git repo.
40
+ Aider will directly edit the code in your local source files,
41
+ and [git commit the changes](https://aider.chat/docs/git.html)
42
+ with sensible commit messages.
43
+ You can start a new project or work with an existing git repo.
44
+ Aider works well with
45
+ GPT-4o, Sonnet 3.7, and DeepSeek Chat V3 & R1.
46
+ It also supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
47
+
48
+ Use the `--browser` switch to launch the browser version of aider:
49
+
50
+ ```
51
+ python -m pip install -U aider-chat
52
+
53
+ export OPENAI_API_KEY=<key> # Mac/Linux
54
+ setx OPENAI_API_KEY <key> # Windows, restart shell after setx
55
+
56
+ aider --browser
57
+ ```
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: Prompt caching
3
+ highlight_image: /assets/prompt-caching.jpg
4
+ parent: Usage
5
+ nav_order: 750
6
+ description: Aider supports prompt caching for cost savings and faster coding.
7
+ ---
8
+
9
+ # Prompt caching
10
+
11
+ Aider supports prompt caching for cost savings and faster coding.
12
+ Currently Anthropic provides caching for Sonnet and Haiku,
13
+ and DeepSeek provides caching for Chat.
14
+
15
+ Aider organizes the chat history to try and cache:
16
+
17
+ - The system prompt.
18
+ - Read only files added with `--read` or `/read-only`.
19
+ - The repository map.
20
+ - The editable files that have been added to the chat.
21
+
22
+ ![Prompt caching](/assets/prompt-caching.jpg)
23
+
24
+
25
+ ## Usage
26
+
27
+ Run aider with `--cache-prompts` or add that setting to your
28
+ [configuration files](/docs/config.html).
29
+
30
+ Due to limitations in the provider APIs, caching statistics and costs
31
+ are not available when streaming responses.
32
+ To turn off streaming, use `--no-stream`.
33
+
34
+ When caching is enabled, it will be noted for the main model when aider launches:
35
+
36
+ ```
37
+ Main model: claude-3-5-sonnet-20240620 with diff edit format, prompt cache, infinite output
38
+ ```
39
+
40
+ ## Preventing cache expiration
41
+
42
+ Aider can ping the provider to keep your prompt cache warm and prevent
43
+ it from expiring.
44
+ By default, Anthropic keeps your cache for 5 minutes.
45
+ Use `--cache-keepalive-pings N` to tell aider to ping
46
+ every 5 minutes to keep the cache warm.
47
+ Aider will ping up to `N` times over a period of `N*5` minutes
48
+ after each message you send.
49
+
@@ -0,0 +1,132 @@
1
+ ---
2
+ parent: Usage
3
+ nav_order: 50
4
+ description: Control aider with in-chat commands like /add, /model, etc.
5
+ ---
6
+
7
+ # In-chat commands
8
+ {: .no_toc }
9
+
10
+ - TOC
11
+ {:toc}
12
+
13
+ ## Slash commands
14
+
15
+ Aider supports commands from within the chat, which all start with `/`.
16
+
17
+ <!--[[[cog
18
+ from aider.commands import get_help_md
19
+ cog.out(get_help_md())
20
+ ]]]-->
21
+
22
+ |Command|Description|
23
+ |:------|:----------|
24
+ | **/add** | Add files to the chat so aider can edit them or review them in detail |
25
+ | **/architect** | Enter architect/editor mode using 2 different models. If no prompt provided, switches to architect/editor mode. |
26
+ | **/ask** | Ask questions about the code base without editing any files. If no prompt provided, switches to ask mode. |
27
+ | **/chat-mode** | Switch to a new chat mode |
28
+ | **/clear** | Clear the chat history |
29
+ | **/code** | Ask for changes to your code. If no prompt provided, switches to code mode. |
30
+ | **/commit** | Commit edits to the repo made outside the chat (commit message optional) |
31
+ | **/context** | Enter context mode to see surrounding code context. If no prompt provided, switches to context mode. |
32
+ | **/copy** | Copy the last assistant message to the clipboard |
33
+ | **/copy-context** | Copy the current chat context as markdown, suitable to paste into a web UI |
34
+ | **/diff** | Display the diff of changes since the last message |
35
+ | **/drop** | Remove files from the chat session to free up context space |
36
+ | **/edit** | Alias for /editor: Open an editor to write a prompt |
37
+ | **/editor** | Open an editor to write a prompt |
38
+ | **/editor-model** | Switch the Editor Model to a new LLM |
39
+ | **/exit** | Exit the application |
40
+ | **/git** | Run a git command (output excluded from chat) |
41
+ | **/help** | Ask questions about aider |
42
+ | **/lint** | Lint and fix in-chat files or all dirty files if none in chat |
43
+ | **/load** | Load and execute commands from a file |
44
+ | **/ls** | List all known files and indicate which are included in the chat session |
45
+ | **/map** | Print out the current repository map |
46
+ | **/map-refresh** | Force a refresh of the repository map |
47
+ | **/model** | Switch the Main Model to a new LLM |
48
+ | **/models** | Search the list of available models |
49
+ | **/multiline-mode** | Toggle multiline mode (swaps behavior of Enter and Meta+Enter) |
50
+ | **/paste** | Paste image/text from the clipboard into the chat. Optionally provide a name for the image. |
51
+ | **/quit** | Exit the application |
52
+ | **/read-only** | Add files to the chat that are for reference only, or turn added files to read-only |
53
+ | **/reasoning-effort** | Set the reasoning effort level (values: number or low/medium/high depending on model) |
54
+ | **/report** | Report a problem by opening a GitHub Issue |
55
+ | **/reset** | Drop all files and clear the chat history |
56
+ | **/run** | Run a shell command and optionally add the output to the chat (alias: !) |
57
+ | **/save** | Save commands to a file that can reconstruct the current chat session's files |
58
+ | **/settings** | Print out the current settings |
59
+ | **/test** | Run a shell command and add the output to the chat on non-zero exit code |
60
+ | **/think-tokens** | Set the thinking token budget (supports formats like 8096, 8k, 10.5k, 0.5M) |
61
+ | **/tokens** | Report on the number of tokens used by the current chat context |
62
+ | **/undo** | Undo the last git commit if it was done by aider |
63
+ | **/voice** | Record and transcribe voice input |
64
+ | **/weak-model** | Switch the Weak Model to a new LLM |
65
+ | **/web** | Scrape a webpage, convert to markdown and send in a message |
66
+
67
+ <!--[[[end]]]-->
68
+
69
+ {: .tip }
70
+ You can easily re-send commands or messages.
71
+ Use the up arrow ⬆ to scroll back
72
+ or CONTROL-R to search your message history.
73
+
74
+ ## Entering multi-line chat messages
75
+
76
+ {% include multi-line.md %}
77
+
78
+ ## Interrupting with CONTROL-C
79
+
80
+ It's always safe to use Control-C to interrupt aider if it isn't providing a useful response. The partial response remains in the conversation, so you can refer to it when you reply to the LLM with more information or direction.
81
+
82
+ ## Keybindings
83
+
84
+ The interactive prompt is built with [prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) which provides emacs and vi keybindings.
85
+
86
+ ### Emacs
87
+
88
+ - `Up Arrow` : Move up one line in the current message.
89
+ - `Down Arrow` : Move down one line in the current message.
90
+ - `Ctrl-Up` : Scroll back through previously sent messages.
91
+ - `Ctrl-Down` : Scroll forward through previously sent messages.
92
+ - `Ctrl-A` : Move cursor to the start of the line.
93
+ - `Ctrl-B` : Move cursor back one character.
94
+ - `Ctrl-D` : Delete the character under the cursor.
95
+ - `Ctrl-E` : Move cursor to the end of the line.
96
+ - `Ctrl-F` : Move cursor forward one character.
97
+ - `Ctrl-K` : Delete from the cursor to the end of the line.
98
+ - `Ctrl-L` : Clear the screen.
99
+ - `Ctrl-N` : Move down to the next history entry.
100
+ - `Ctrl-P` : Move up to the previous history entry.
101
+ - `Ctrl-R` : Reverse search in command history.
102
+ - `Ctrl-X Ctrl-E` : Open the current input in an external editor
103
+ - `Ctrl-Y` : Paste (yank) text that was previously cut.
104
+
105
+
106
+ ### Vi
107
+
108
+ To use vi/vim keybindings, run aider with the `--vim` switch.
109
+
110
+ - `Up Arrow` : Move up one line in the current message.
111
+ - `Down Arrow` : Move down one line in the current message.
112
+ - `Ctrl-Up` : Scroll back through previously sent messages.
113
+ - `Ctrl-Down` : Scroll forward through previously sent messages.
114
+ - `Esc` : Switch to command mode.
115
+ - `i` : Switch to insert mode.
116
+ - `a` : Move cursor one character to the right and switch to insert mode.
117
+ - `A` : Move cursor to the end of the line and switch to insert mode.
118
+ - `I` : Move cursor to the beginning of the line and switch to insert mode.
119
+ - `h` : Move cursor one character to the left.
120
+ - `j` : Move cursor down one line.
121
+ - `k` : Move cursor up one line.
122
+ - `l` : Move cursor one character to the right.
123
+ - `w` : Move cursor forward one word.
124
+ - `b` : Move cursor backward one word.
125
+ - `0` : Move cursor to the beginning of the line.
126
+ - `$` : Move cursor to the end of the line.
127
+ - `x` : Delete the character under the cursor.
128
+ - `dd` : Delete the current line.
129
+ - `u` : Undo the last change.
130
+ - `Ctrl-R` : Redo the last undone change.
131
+
132
+
@@ -0,0 +1,119 @@
1
+ ---
2
+ parent: Usage
3
+ nav_order: 800
4
+ description: Tell aider to follow your coding conventions when it works on your code.
5
+ ---
6
+ # Specifying coding conventions
7
+
8
+ Sometimes you want GPT to be aware of certain coding guidelines,
9
+ like whether to provide type hints, which libraries or packages
10
+ to prefer, etc.
11
+
12
+ The easiest way to do that with aider is to simply create
13
+ a small markdown file and include it in the chat.
14
+
15
+ For example, say we want our python code to:
16
+
17
+ ```
18
+ - Prefer httpx over requests for making http requests.
19
+ - Use types everywhere possible.
20
+ ```
21
+
22
+ We would simply create a file like `CONVENTIONS.md` with those lines
23
+ and then we can add it to the aider chat, along with the file(s)
24
+ that we want to edit.
25
+
26
+ It's best to load the conventions file with `/read CONVENTIONS.md`
27
+ or `aider --read CONVENTIONS.md`.
28
+ This way it is marked as read-only, and cached if prompt caching
29
+ is enabled.
30
+
31
+ ## Community contributed conventions
32
+
33
+ You can check the [aider conventions repository](https://github.com/Aider-AI/conventions)
34
+ to find or contribute conventions files.
35
+
36
+ ## Always load conventions
37
+
38
+ You can also configure aider to always load your conventions file
39
+ in the [`.aider.conf.yml` config file](https://aider.chat/docs/config/aider_conf.html):
40
+
41
+
42
+ ```yaml
43
+ # alone
44
+ read: CONVENTIONS.md
45
+
46
+ # multiple files
47
+ read: [CONVENTIONS.md, anotherfile.txt]
48
+ ```
49
+
50
+
51
+ ## Example
52
+
53
+ See below for an example of how the conventions can affect the code
54
+ that aider writes.
55
+
56
+ <div class="chat-transcript" markdown="1">
57
+ > $ aider --read CONVENTIONS.md useragent.py
58
+ >
59
+ > Aider v0.24.2-dev
60
+ > Added CONVENTIONS.md to the chat.
61
+ > Added useragent.py to the chat.
62
+
63
+ #### write a function that uses httpbin to check the user agent on the request. return the ua.
64
+
65
+ To fulfill your request, I will:
66
+
67
+ 1. Add an import for `httpx`.
68
+ 2. Write a function named `check_user_agent` that makes a GET request to `httpbin.org/user-agent` and returns the user agent string.
69
+
70
+ Here is the diff for the `useragent.py` file:
71
+
72
+ ```diff
73
+ --- useragent.py
74
+ +++ useragent.py
75
+ @@ ... @@
76
+ +import httpx
77
+ +
78
+ +def check_user_agent() -> str:
79
+ + response = httpx.get('https://httpbin.org/user-agent')
80
+ + return response.json()['user-agent']
81
+ ```
82
+
83
+ This function uses `httpx` to make a GET request to `httpbin.org/user-agent`, which returns a JSON response containing the user agent of the HTTP client. The function then extracts the user agent string from the JSON response and returns it.
84
+
85
+ > Applied edit to useragent.py
86
+ </div>
87
+
88
+ GPT correctly used `httpx` and provided type hints.
89
+ See below for the transcript of this same
90
+ coding task conducted *without*
91
+ using `CONVENTIONS.md`.
92
+ In this case, GPT used `requests` and skipped types,
93
+ which is perhaps more typical in small python scripts.
94
+
95
+ <div class="chat-transcript" markdown="1">
96
+ > $ aider useragent.py
97
+ >
98
+ > Aider v0.24.2-dev
99
+ > Added useragent.py to the chat.
100
+
101
+
102
+ #### write a function that uses httpbin to check the user agent on the request. return the ua.
103
+
104
+ ```diff
105
+ --- /dev/null
106
+ +++ useragent.py
107
+ @@ ... @@
108
+ +import requests
109
+ +
110
+ +def check_user_agent():
111
+ + response = requests.get('https://httpbin.org/user-agent')
112
+ + user_agent = response.json().get('user-agent')
113
+ + return user_agent
114
+ ```
115
+
116
+ > Applied edit to useragent.py
117
+ </div>
118
+
119
+
@@ -0,0 +1,121 @@
1
+ ---
2
+ title: Copy/paste with web chat
3
+ #highlight_image: /assets/browser.jpg
4
+ parent: Usage
5
+ nav_order: 850
6
+ description: Aider works with LLM web chat UIs
7
+ ---
8
+
9
+ # Copy/paste with web chat
10
+
11
+ <div class="video-container">
12
+ <video controls loop poster="/assets/copypaste.jpg">
13
+ <source src="/assets/copypaste.mp4" type="video/mp4">
14
+ <a href="/assets/copypaste.mp4">Aider browser UI demo video</a>
15
+ </video>
16
+ </div>
17
+
18
+ <style>
19
+ .video-container {
20
+ position: relative;
21
+ padding-bottom: 66.34%; /* 2160 / 3256 = 0.6634 */
22
+ height: 0;
23
+ overflow: hidden;
24
+ }
25
+
26
+ .video-container video {
27
+ position: absolute;
28
+ top: 0;
29
+ left: 0;
30
+ width: 100%;
31
+ height: 100%;
32
+ }
33
+ </style>
34
+
35
+ ## Working with an LLM web chat
36
+
37
+ [Aider can connect to most LLMs via API](https://aider.chat/docs/llms.html) and works best that way.
38
+ But there are times when you may want to work with an LLM via its web chat interface:
39
+
40
+ - Workplace policies may limit your LLM usage to a proprietary web chat system.
41
+ - The web chat LLM may have access to unique context or may have been specially fine tuned for your task.
42
+ - It may be cost prohibitive to use some models via API.
43
+ - There may not be an API available.
44
+
45
+ Aider has features for working with an LLM via its web chat interface.
46
+ This allows you to use the web chat LLM as the "big brain code architect"
47
+ while running aider with a smaller, cheaper LLM to actually make changes
48
+ to your local files.
49
+
50
+ For this "file editor" part of the process
51
+ you can run aider with many open source, free or very inexpensive LLMs.
52
+ For example, the demo video above shows aider using DeepSeek to apply the changes
53
+ that o1-preview is suggesting in the web chat.
54
+
55
+ ### Copy aider's code context to your clipboard, paste into the web UI
56
+
57
+ The `/copy-context <instructions>` command can be used in chat to copy aider's code context to your clipboard.
58
+ It will include:
59
+
60
+ - All the files which have been added to the chat via `/add`.
61
+ - Any read only files which have been added via `/read`.
62
+ - Aider's [repository map](https://aider.chat/docs/repomap.html) that brings in code context related to the above files from elsewhere in your git repo.
63
+ - Some instructions to the LLM that ask it to output change instructions concisely.
64
+ - If you include `<instructions>`, they will be copied too.
65
+
66
+ You can paste the context into your browser, and start interacting with the LLM web chat to
67
+ ask for code changes.
68
+
69
+ ### Paste the LLM's reply back into aider to edit your files
70
+
71
+ Once the LLM has replied, you can use the "copy response" button in the web UI to copy
72
+ the LLM's response.
73
+ Back in aider, you can run `/paste` and aider will edit your files
74
+ to implement the changes suggested by the LLM.
75
+
76
+ You can use a cheap, efficient model like GPT-4o Mini, DeepSeek or Qwen to do these edits.
77
+ This works best if you run aider with `--edit-format editor-diff` or `--edit-format editor-whole`.
78
+
79
+ ### Copy/paste mode
80
+
81
+ Aider has a `--copy-paste` mode that streamlines this entire process:
82
+
83
+ - Whenever you `/add` or `/read` files, aider will automatically copy the entire, updated
84
+ code context to your clipboard.
85
+ You'll see "Copied code context to clipboard" whenever this happens.
86
+ - When you copy the LLM reply to your clipboard outside aider, aider will automatically notice
87
+ and load it into the aider chat.
88
+ Just press ENTER to send the message
89
+ and aider will apply the LLMs changes to your local files.
90
+ - Aider will automatically select the best edit format for this copy/paste functionality.
91
+ Depending on the LLM you have aider use, it will be either `editor-whole` or `editor-diff`.
92
+
93
+ ## Terms of service
94
+
95
+ Be sure to review the Terms Of Service of any LLM web chat service you use with
96
+ these features.
97
+ These features are not intended to be used in violation of any service's Terms Of Service (TOS).
98
+
99
+ Aider's web chat features have been designed to be compliant with the
100
+ terms of service of most LLM web chats.
101
+
102
+ There are 4 copy/paste steps involved when coding with an LLM web chat:
103
+
104
+ 1. Copy code and context from aider.
105
+ 2. Paste the code and context into the LLM web chat.
106
+ 3. Copy the reply from the LLM web chat.
107
+ 4. Paste the LLM reply into aider.
108
+
109
+ Most LLM web chat TOS prohibit automating steps (2) and (3) where code
110
+ is copied from and pasted into the web chat.
111
+ Aider's `--copy-paste` mode leaves those as 100% manual steps for the user to complete.
112
+ It simply streamlines steps (1) and (4) that are interactions with aider,
113
+ and which should not be under the scope of an LLM web chat TOS.
114
+
115
+ If you are concerned that
116
+ the automatic interactions with aider in steps (1) and (4) may be problematic with respect to
117
+ your LLM web chat provider's TOS, you can forego `--copy-paste` mode.
118
+ Instead, manually use the `/copy-context` and `/paste` commands if that
119
+ will keep you in compliance.
120
+
121
+ Again, do not use these features in violation of any service's Terms Of Service.