[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/aidermacs 93340e76f9 306/466: Add aidermacs-default-model
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/aidermacs 93340e76f9 306/466: Add aidermacs-default-model and aidermacs-args options |
Date: |
Sat, 15 Mar 2025 19:16:51 -0400 (EDT) |
branch: elpa/aidermacs
commit 93340e76f97d342e0d12673e4d7122e318d6cab0
Author: Mingde (Matthew) Zeng <matthewzmd@posteo.net>
Commit: Mingde (Matthew) Zeng <matthewzmd@posteo.net>
Add aidermacs-default-model and aidermacs-args options
---
README.md | 24 +++++++++++++++++++++++-
aidermacs-backend-comint.el | 2 +-
aidermacs-models.el | 15 ++++++++++-----
aidermacs.el | 38 ++++++++++++++++++++------------------
4 files changed, 54 insertions(+), 25 deletions(-)
diff --git a/README.md b/README.md
index 57ffbf0358..fbf1f62300 100644
--- a/README.md
+++ b/README.md
@@ -86,11 +86,33 @@ With `Aidermacs`, you get:
(use-package aidermacs
:straight (:host github :repo "MatthewZMD/aidermacs" :files ("*.el"))
:config
- (setq aidermacs-args '("--model" "anthropic/claude-3-5-sonnet-20241022"))
+ (setq aidermacs-default-model "anthropic/claude-3-5-sonnet-20241022")
(setenv "ANTHROPIC_API_KEY" anthropic-api-key)
(global-set-key (kbd "C-c a") 'aidermacs-transient-menu))
```
+### Default Model Selection
+
+You can customize the default AI model used by Aidermacs by setting the
`aidermacs-default-model` variable:
+
+```emacs-lisp
+(setq aidermacs-default-model "anthropic/claude-3-5-sonnet-20241022")
+```
+
+This allows you to easily switch between different AI models without modifying
the `aidermacs-args` variable.
+
+### Customizing Aider Options with `aidermacs-args`
+
+The `aidermacs-args` variable allows you to pass any command-line options
supported by Aider. See the [Aider configuration
documentation](https://aider.chat/docs/config/options.html) for a full list of
available options.
+
+For example, to set the verbosity:
+
+```emacs-lisp
+(setq aidermacs-args '("--verbose"))
+```
+
+These arguments will be appended to the Aider command when it is run. Note
that the `--model` argument is automatically handled by
`aidermacs-default-model` and should not be included in `aidermacs-args`.
+
### Sample Config With Doom Emacs
```emacs-lisp
(package! aidermacs :recipe (:host github :repo "MatthewZMD/aidermacs" :files
("*.el")))
diff --git a/aidermacs-backend-comint.el b/aidermacs-backend-comint.el
index f489eb56ac..5d05bce041 100644
--- a/aidermacs-backend-comint.el
+++ b/aidermacs-backend-comint.el
@@ -229,7 +229,7 @@ This allows for multi-line input without sending the
command."
(defun aidermacs-run-comint (program args buffer-name)
"Create a comint-based buffer and run aidermacs PROGRAM with ARGS in
BUFFER-NAME."
(let ((comint-terminfo-terminal "eterm-color")
- (args (append (list "--no-pretty" "--no-fancy-input") args)))
+ (args (append args (list "--no-pretty" "--no-fancy-input"))))
(unless (comint-check-proc buffer-name)
(apply 'make-comint-in-buffer "aidermacs" buffer-name program nil args)
(with-current-buffer buffer-name
diff --git a/aidermacs-models.el b/aidermacs-models.el
index a011952aad..fbd0052fee 100644
--- a/aidermacs-models.el
+++ b/aidermacs-models.el
@@ -15,12 +15,17 @@
"Model selection customization for aidermacs."
:group 'aidermacs)
+(defcustom aidermacs-default-model "anthropic/claude-3-5-sonnet-20241022"
+ "Default AI model to use for aidermacs sessions."
+ :type 'string
+ :group 'aidermacs-models)
+
(defcustom aidermacs-popular-models
- '("anthropic/claude-3-5-sonnet-20241022" ;; really good in practical
- "o3-mini" ;; very powerful
- "gemini/gemini-2.0-flash" ;; free
- "r1" ;; performance match o1, price << claude sonnet. weakness: small
context
- "deepseek/deepseek-chat" ;; chatgpt-4o level performance, price is 1/100.
weakness: small context
+ '("anthropic/claude-3-5-sonnet-20241022"
+ "o3-mini"
+ "gemini/gemini-2.0-flash"
+ "r1"
+ "deepseek/deepseek-chat"
)
"List of available AI models for selection.
Each model should be in the format expected by the aidermacs command line
interface.
diff --git a/aidermacs.el b/aidermacs.el
index eecef7aa8c..1ef6167311 100644
--- a/aidermacs.el
+++ b/aidermacs.el
@@ -34,8 +34,9 @@
:type 'string
:group 'aidermacs)
-(defcustom aidermacs-args '("--model" "anthropic/claude-3-5-sonnet-20241022")
- "Arguments to pass to the aidermacs command."
+(defcustom aidermacs-args nil
+ "Additional arguments to pass to the aidermacs command.
+The model argument will be added automatically based on
`aidermacs-default-model'."
:type '(repeat string)
:group 'aidermacs)
@@ -205,7 +206,7 @@ Prefers existing sessions closer to current directory."
(mapcar
(lambda (buf)
(when (string-match "^\\*aidermacs:\\(.*?\\)\\*$"
- (buffer-name buf))
+ (buffer-name buf))
(cons (match-string 1 (buffer-name buf))
(match-string 2 (buffer-name buf)))))
aidermacs-buffers))
@@ -224,12 +225,12 @@ Prefers existing sessions closer to current directory."
;; Sort by path length (deeper paths first)
(> (length (car a)) (length (car b))))))))
(display-root (cond
- ;; Use current directory for new subtree session
- (aidermacs-subtree-only current-dir)
- ;; Use closest parent if it exists
- (closest-parent closest-parent)
- ;; Fall back to project root for new non-subtree session
- (t root))))
+ ;; Use current directory for new subtree session
+ (aidermacs-subtree-only current-dir)
+ ;; Use closest parent if it exists
+ (closest-parent closest-parent)
+ ;; Fall back to project root for new non-subtree
session
+ (t root))))
(format "*aidermacs:%s*"
(file-truename display-root))))
@@ -240,14 +241,15 @@ With the universal argument EDIT-ARGS, prompt to edit
aidermacs-args before runn
(interactive "P")
(let* ((buffer-name (aidermacs-buffer-name))
(current-args (if edit-args
- (split-string (read-string "Edit aidermacs
arguments: "
- (mapconcat 'identity
aidermacs-args " ")))
- aidermacs-args))
- (final-args (append current-args
- (unless aidermacs-auto-commits
- '("--no-auto-commits"))
- (when aidermacs-subtree-only
- '("--subtree-only")))))
+ (split-string (read-string "Edit aidermacs
arguments: "
+ (mapconcat 'identity
aidermacs-args " ")))
+ aidermacs-args))
+ (final-args (append (list "--model" aidermacs-default-model)
+ current-args
+ (unless aidermacs-auto-commits
+ '("--no-auto-commits"))
+ (when aidermacs-subtree-only
+ '("--subtree-only")))))
;; Check if a matching buffer exists (handled by aidermacs-buffer-name)
(if (get-buffer buffer-name)
(aidermacs-switch-to-buffer)
@@ -262,7 +264,7 @@ This is useful for working in monorepos where you want to
limit aider's scope."
(interactive)
(let ((aidermacs-subtree-only t)
(default-directory (file-truename default-directory)))
- (aidermacs-run nil)))
+ (aidermacs-run)))
(defun aidermacs--send-command (command &optional switch-to-buffer)
"Send COMMAND to the corresponding aidermacs process.
- [nongnu] elpa/aidermacs f54aa4088c 275/466: Update README, (continued)
- [nongnu] elpa/aidermacs f54aa4088c 275/466: Update README, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 002a47e89e 285/466: Use aider command to get supported models, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs c3ec966f0a 286/466: Refactor to use aidermacs--send-command callback effectively, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 142a154b5f 295/466: Prepend aidermacs-- to fetch-openai-compatible-models, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 791cb45315 292/466: Refactor aidermacs--get-context-command, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 34fecf9703 284/466: fix: use aidermacs-read-string instead of aidermacs-plain-read-string in aidermacs-debug, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs d5ccb2d10c 291/466: Disable auto-commits by default in aidermacs, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs d230cd5f95 297/466: Merge pull request #19 from CeleritasCelery/dumb-text, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs c3a9520da7 301/466: Use redirection for sending commands to aider, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 4fad406c4d 302/466: Rename to aidermacs--send-command-redirect-comint, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 93340e76f9 306/466: Add aidermacs-default-model and aidermacs-args options,
ELPA Syncer <=
- [nongnu] elpa/aidermacs 4e14215119 310/466: Fix #16 handle read-only files in ls, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs e06f47cea7 331/466: Merge pull request #29 from jfeser/main, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 090eebdbf5 334/466: Fix more lintings, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs fb59e9bc87 338/466: Update README, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 5e167323b8 352/466: Fix README, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs ea47980ed7 361/466: fix: Fix string formatting in message function, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 6ae6becbfb 374/466: Simplify UI to ask question and explain this code, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 3a7e313ce0 317/466: Fix comint-prompt-regexp, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 811305ac77 316/466: Slight adjustment with the minor mode, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 581c74dad3 318/466: Add Separate Reasoner/Editing mode!, ELPA Syncer, 2025/03/15