Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.32 KB

File metadata and controls

43 lines (32 loc) · 1.32 KB

Setup

Set the openai API key using emacs’ custom

M-x customize-group

pen-openai-key

Setting this variable will save your key to the file specified by pen-openai-key-location.

If pen-openai-key-location is not set then it wil<l ask you to name that path first.

The pen-openai-key is stored in plain text, but that’s better than storing directly within an emacs variable as we can’t guarantee you keep your emacs repository private.

Make it a secure location.

pen-openai-key-location

This variable is automatically set when setting pen-openai-key, but if you choose to set pen-openai-key-location instead, pen-openai-key will be loaded from this file.

Alternatively, create a wrapper script around openai and export the key

#!/bin/bash

export OPENAI_API_KEY="$(cat $HOME/.myrc.yaml | yq -r '.openai_api_key')"

/usr/local/bin/openai "$@"

Usage

Enable pen-mode globally (on all buffers)

Default Key Bindings

key bindingdescription
<kbd>SPC</kbd>pen-run-prompt-function

Free prompts to use

https://github.com/semiosis/prompts/