Created
April 18, 2023 20:51
Revisions
-
hookdump created this gist
Apr 18, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # Paste your OpenAI API Key here export OPENAI_API_KEY="sk-..." # Display colors RED='\033[0;31m' NC='\033[0m' # No Color # GPT function function gpt { set +o nomatch # disable nomatch option nvm use gpt --silent # node should be >= 18.13.0, you can use an alias for that version local input="$*" # concat args into single string echo -e "${RED}Prompt:${NC} $input" echo -e "${RED}ChatGPT:${NC}" chatgpt "$input" # call chatgpt cli }