I needed a simple yet handy tool to save and retrieve prompts, and since I love fzf
, I decided to use it for this purpose.
- Clone the repo or get the scripts and install them somewhere in your path.
- Create a folder for your prompts (e.g.,
~/ai/prompts
). - Create a subfolder called "inbox" (e.g.,
~/ai/prompts/_inbox
). - Set the following environment variables:
PROMPT_INBOX_PATH
: e.g.,export PROMPT_INBOX_PATH=~/ai/prompts/_inbox
PROMPT_PATH
: e.g.,export PROMPT_PATH=~/ai/prompts
- Write a new prompt and copy it to the clipboard.
- Run the
pinbox.sh
script.- The script will take the clipboard content, create a YAML file in the
PROMPT_INBOX_PATH
folder, and save it with a filename likeprompt-inbox-YYYY-MM-DD-HH-MM-SS.yaml
.
- The script will take the clipboard content, create a YAML file in the
- Copy the prompt "Magic mirror on the wall, who is the most beautiful of all?" to the clipboard.
- Run
pinbox.sh
. - The script will create a YAML file like
prompt-inbox-2024-05-10-06-21-31.yaml
in the_inbox
folder with the following content:
---
prompt:
uuid: 862be853-8f45-4f9d-91fa-ffd6f3db1634
text: |-
Magic mirror on the wall, who is the most beautiful of all?
search_by:
description:
tags:
created_by: me
created_at: 2024-05-10-06-21-49
- You can now edit, rename, move, or organize the prompt file within the
PROMPT_PATH
folder. - Don't forget to fill in the
search_by
field (e.g., "Snow White mirror") and keep the.yaml
extension.
- Run the
pget.sh
script, which finds all YAML files insidePROMPT_PATH
and displays them infzf
with the content ofsearch_by
and the filename. - Select a prompt, and its text will be copied to the clipboard.
- Create a keyboard shortcut for the scripts, such as in Wezterm:
{
-- Get prompt
key = "p",
mods = "ALT",
action = wezterm.action {
SpawnCommandInNewTab = {
args = { "zsh", "pget.sh" }, -- Replace with your script's path
}
}
}
- Scripts use
xclip
,yq
,fzf
, so install them first.
prompt organizer
, organizing AI prompts
, cli tool