gptel
tags :
Emacs Apps #
https://github.com/karthink/gptel GPTel is a simple, no-frills ChatGPT client for Emacs.
From any buffer: gptel-send #
With prefix command in an existing buffer #
Code #
select the code and call gptel-send with options
In a new or dedicated buffer #
`c-u` change selections before sending the query

In dedicated buffer: gptel #
With prefix command #
with `c-u` opens new session
#
Tutorial by the author, Karthink #






Read and redirect #
- it can be controlled where to read the instructions from any buffer, mini buffer and to redirect the output to any buffer
Save and restore your chat sessions #
Saving the file, save-buffer, will save the state of the conversation as well. To resume the chat, open the file and turn on gptel-mode before editing the buffer.
Workflows #
Prefix: SPC d
Adding/removing context #
- toggle selection of current buffer
- SPC d t
- add file to context
- SPC d a
- removing context
- When in gptel-context mode,
- Exit evil mode :: C - z evil-mode bindings won’t work
- d d :: mark the selected file to delete
- C-c C-c :: execute the delete
Calling anywhere in the buffer #
- SPC d d
- call llm from buffer
Refactoring #
- SPC d r
- gptel-rewrite-menu