Add chatgpt-shell config
This commit is contained in:
parent
cda6beed34
commit
fbfa5e04a8
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "chatgpt-shell"]
|
||||
path = chatgpt-shell
|
||||
url = https://github.com/xenodium/chatgpt-shell
|
1
chatgpt-shell
Submodule
1
chatgpt-shell
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit f7a53903ebedb1bd67dc9dea6ae9893fb70d4d49
|
22
config.org
22
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user