/chatgpt-shell

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

👉 Support this work via GitHub Sponsors

chatgpt-shell

A minimal ChatGPT Emacs shell.

Note

This is very much an experimental proof of concept, possibly incomplete, or maybe with some rough edges. Pull requests with improvements or fixes totally welcome.

Install

Load (require 'chatgpt-shell)

Set OpenAI key

As function

(setq chatgpt-shell-openai-key
      (lambda ()
        (nth 0 (process-lines "pass" "show" "openai-key"))))

Manually

M-x set-variable chatgpt-shell-openai-key

As variable

(setq chatgpt-shell-openai-key "my key")

Launch

Launch with M-x chatgpt-shell.

Clear buffer

Type clear as a prompt.

ChatGPT> clear

Alternatively, use either M-x chatgpt-shell-clear-buffer or M-x comint-clear-buffer.