From 7c1c38bf6fc4b0474c8ce05c40e65ee2d90876e6 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Wed, 11 Feb 2026 16:12:54 -0500 Subject: [PATCH] [emacs] Add agent-shell config for work --- emacs/.config/doom/config.el | 41 ++++++++++++++++++ emacs/.config/doom/custom.el | 3 +- emacs/.config/doom/packages.el | 4 ++ .../work/hungryroot/apikeys/anthropic.gpg | Bin 0 -> 724 bytes .../work/hungryroot/apikeys/chatgpt.gpg | Bin 0 -> 786 bytes .../work/hungryroot/apikeys/gemini.gpg | Bin 0 -> 659 bytes 6 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 password-store/.password-store/work/hungryroot/apikeys/anthropic.gpg create mode 100644 password-store/.password-store/work/hungryroot/apikeys/chatgpt.gpg create mode 100644 password-store/.password-store/work/hungryroot/apikeys/gemini.gpg diff --git a/emacs/.config/doom/config.el b/emacs/.config/doom/config.el index 1a851a0..9837501 100644 --- a/emacs/.config/doom/config.el +++ b/emacs/.config/doom/config.el @@ -484,3 +484,44 @@ Always open the result in `eww`." (apheleia-mode -1)))) (add-hook 'find-file-hook #'my/disable-apheleia-in-certain-projects) + +(require 'acp) +(require 'agent-shell) +;; --- pass integration --- +(after! auth-source-pass + ;; Ensure pass is used as an auth-source backend + (auth-source-pass-enable)) + +(defun +pass-line1 (entry) + "Return first line from `pass show ENTRY` (trimmed)." + (string-trim + (shell-command-to-string (format "pass show %s 2>/dev/null | head -n 1" entry)))) + +(after! agent-shell + ;; OpenAI (ChatGPT API) + (setq agent-shell-openai-authentication + (agent-shell-openai-make-authentication + :api-key (lambda () (+pass-line1 "work/hungryroot/apikeys/chatgpt")))) + + ;; Anthropic (Claude) + (setq agent-shell-anthropic-authentication + (agent-shell-anthropic-make-authentication + :api-key (lambda () (+pass-line1 "work/hungryroot/apikeys/anthropic")))) + + ;; Google (Gemini) + (setq agent-shell-google-authentication + (agent-shell-google-make-authentication + :api-key (lambda () (+pass-line1 "work/hungryroot/apikeys/gemini"))))) + +;;(use-package agent-shell +;; :config +;; ;; Evil state-specific RET behavior: insert mode = newline, normal mode = send +;; (evil-define-key 'insert agent-shell-mode-map (kbd "RET") #'newline) +;; (evil-define-key 'normal agent-shell-mode-map (kbd "RET") #'comint-send-input) +;; +;; ;; Configure *agent-shell-diff* buffers to start in Emacs state +;; (add-hook 'diff-mode-hook +;; (lambda () +;; (when (string-match-p "\\*agent-shell-diff\\*" (buffer-name)) +;; (evil-emacs-state))))) + diff --git a/emacs/.config/doom/custom.el b/emacs/.config/doom/custom.el index a541570..896ee51 100644 --- a/emacs/.config/doom/custom.el +++ b/emacs/.config/doom/custom.el @@ -5,8 +5,7 @@ ;; If there is more than one, they won't work right. '(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'") '(package-selected-packages - '(agent-shell csv-mode direnv ef-themes helix-theme just-mode justl magit-todos - nov pinentry vulpea w3m)) + '(csv-mode direnv ef-themes helix-theme just-mode justl magit-todos nov pinentry vulpea w3m)) '(safe-local-variable-values '((pytest-global-name . "docker-compose run --rm test --")))) (custom-set-faces ;; custom-set-faces was added by Custom. diff --git a/emacs/.config/doom/packages.el b/emacs/.config/doom/packages.el index e633357..2cbe085 100644 --- a/emacs/.config/doom/packages.el +++ b/emacs/.config/doom/packages.el @@ -18,6 +18,10 @@ (package! git-link) (package! blacken) (package! org-modern) +(package! shell-maker) +(package! acp) +(package! agent-shell) +(package! auth-source-pass) (package! org-todoist :recipe (:host github diff --git a/password-store/.password-store/work/hungryroot/apikeys/anthropic.gpg b/password-store/.password-store/work/hungryroot/apikeys/anthropic.gpg new file mode 100644 index 0000000000000000000000000000000000000000..686d77edfc4609f75fd9a64672ad9ffd1c7a4c6c GIT binary patch literal 724 zcmV;_0xSK60t^FCms>i{cG18A5CEun@*p|Cx>QOqvzo>;iAr?QMXgt^YJ&{3uznNAG%)LDql5QFy9A)zLoFk$V68-IrgL3eY zYsuK?9b}X@0yqDhGi2Cv_$704F<8Ybr9(@e51is26={JBP<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VtEtHO2viLI3~& literal 0 HcmV?d00001 diff --git a/password-store/.password-store/work/hungryroot/apikeys/gemini.gpg b/password-store/.password-store/work/hungryroot/apikeys/gemini.gpg new file mode 100644 index 0000000000000000000000000000000000000000..ced509d416eb5c29303d7bd905916c9d78c3ea26 GIT binary patch literal 659 zcmV;E0&M+-0t^FCms>i{cG18A5CELml0b$+U3-DvkhjI_YT!!00&kU|2xA@$i$--G zMf+n}#S@R`*42!f9=)l&916fs;PUQ11ZfSjg~QIB8&Rn8cPZ-rqf*ab&2|t7&yy7` zy}QsnM;KsD$^hp?fX6QycyZ*79{2N+{~8(X`hc06ejXNKa9BE9#}N;gxps_U52iqx~H8!+Iu zkx|}=nvG$7Qi$2e*OpC^#)sf~L;P?L$=l*k@XZaLZwH@UghS7>;5tQ-gNHitzE>U2 zR!wbs;V-d?Hx4?%j?K?v$jZWqU~qc+6M+I{_E6hVw@2w)_TGk|Tr#JL8rs({!qaz6 zo0DfOx8At;8f{r#D39u@_lMOj1ZRMm?;7tg^r;$J0mzhG=!WLT^VTzB|pS zR^b%8!{6IL;#@OYlDs>p`9(U?X}^5}l+^g`CVd4$BJUVGp8u05;YZFu0JjsEc~Ig9 z4OeKOzT?IU06wxX1N72@0iA{`vF6<$oqrFRds3r~9qCYG1L8zb)t!`XM%CcUh)wfX z&!@D!(cFu~jN04#W2qWIxFL&<0O52DE;&k?Sfp;2#E^>St=$O)3(DW4+FOwOj|Q7< t)~F)5AeV;^_*HmH^x-Y2T71duZAw7Q=F9cRd%y8@zaBzBQYAsIqjBm-Q5FCI literal 0 HcmV?d00001