diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-05-14 19:02:05 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-05-14 19:02:05 -0700 |
| commit | 647684432defbf40c7770e132c0c4da3053cc3f8 (patch) | |
| tree | 68a247b426c751f7c955a77bc59fd6b0f0844c98 | |
| parent | update gitignore (diff) | |
| download | infra-647684432defbf40c7770e132c0c4da3053cc3f8.tar.gz | |
initial configuration for gptel and aidermacs
| -rw-r--r-- | nix/users/fcuny/configs/emacs/init.el | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/nix/users/fcuny/configs/emacs/init.el b/nix/users/fcuny/configs/emacs/init.el index a474bd5..dd9869c 100644 --- a/nix/users/fcuny/configs/emacs/init.el +++ b/nix/users/fcuny/configs/emacs/init.el @@ -267,6 +267,37 @@ (load-theme 'modus-operandi-tinted :no-confirm) +;;; 1Password Integration +(defvar fcuny/op-item-cache nil) + +(defun fcuny/read-op-item (op-item-path) + "Read and cache OP-ITEM-PATH item." + (or (cdr (assoc op-item-path fcuny/op-item-cache)) + (let ((key (string-trim-right + (shell-command-to-string (format "op read '%s'" op-item-path))))) + (unless (string-match-p "\\[ERROR\\]" key) + (push (cons op-item-path key) fcuny/op-item-cache) + key)))) + +;;; gptel +(require 'gptel) + +(with-eval-after-load 'gptel + (setq gptel-default-mode 'org-mode) + (gptel-make-anthropic "Claude" + :stream t + :key (lambda () (fcuny/read-op-item "op://Private/anthropic llm/credential")))) + +;;; aider +(require 'aidermacs) + +(global-set-key (kbd "C-c a") 'aidermacs-transient-menu) + +(with-eval-after-load 'aidermacs + (setq aider-args '("--no-check-update" "--no-show-model-warnings")) + (setq aidermacs-default-model "claude-3-7-sonnet-latest") + (setenv "ANTHROPIC_API_KEY" (fcuny/read-op-item "op://Private/anthropic llm/credential"))) + ;;; server (require 'server) (unless (server-running-p) |
