[emacs] Add agent-shell config for work

This commit is contained in:
2026-02-11 16:12:54 -05:00
parent 1daa17d302
commit 7c1c38bf6f
6 changed files with 46 additions and 2 deletions

View File

@ -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)))))

View File

@ -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.

View File

@ -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