From fbfa5e04a8ef945ff86d83c82ab9167d6b3f5049 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Thu, 23 Mar 2023 17:49:28 +0000 Subject: [PATCH] Add chatgpt-shell config --- .gitmodules | 3 +++ chatgpt-shell | 1 + config.org | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 .gitmodules create mode 160000 chatgpt-shell diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..781d627 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "chatgpt-shell"] + path = chatgpt-shell + url = https://github.com/xenodium/chatgpt-shell diff --git a/chatgpt-shell b/chatgpt-shell new file mode 160000 index 0000000..f7a5390 --- /dev/null +++ b/chatgpt-shell @@ -0,0 +1 @@ +Subproject commit f7a53903ebedb1bd67dc9dea6ae9893fb70d4d49 diff --git a/config.org b/config.org index e89b8b4..d44b000 100644 --- a/config.org +++ b/config.org @@ -1306,6 +1306,28 @@ 'clang-format-region-or-buffer))) #+end_src +** ChatGPT + The =chatpt-shell= package is in a git submodule, so this has to be + added to the [[help:load-path][load-path]] and ~require~'d: + + #+begin_src emacs-lisp + (let ((path (concat (getenv "HOME") + "/.emacs.d/chatgpt-shell"))) + (add-to-list 'load-path path)) + (require 'chatgpt-shell) + #+end_src + + [[help:chatgpt-shell-openai-key][chatgpt-shell-openai-key]] must also be set to a function that + returns an OpenAI API key. I have a key (made on [[https://platform.openai.com/account/api-keys][this page]]) stored + in =pass(1)= under =openai/api-key=, so this can be retrieved via + [[help:process-lines][process-lines]]: + + #+begin_src emacs-lisp + (setq chatgpt-shell-openai-key + (lambda () + (car (process-lines "pass" "openai/api-key")))) + #+end_src + * Backup and Autosave ** Keep $PWD Tidy Emacs' default behaviour of dumping temporary files in the current