- create free account with OpenAI to grab an API Key
export OPEN_AI_KEY=<your API KEY>
dotnet publish
sudo ln -s ~/<path to playground>/bin/Release/net6.0/publish/openai-playground /usr/local/bin/openai-playground
- read through docs to change these lines for using different models
openai-playground limerick a boy named sue
openai-playground code C# parallel process multiple CSV files
openai-playground pic a unicorn riding a motorcycle
openai-playground write me a 300 word essay on the economic stability of Greece
function limerick() {
local LIMERICK=$(openai-playground limerick "$@")
echo $LIMERICK | pbcopy
echo $LIMERICK
}
function dirty-limerick() {
local LIMERICK=$(openai-playground dirty-limerick "$@")
echo $LIMERICK | pbcopy
echo $LIMERICK
}
function how-do-i-code() {
local HOW_DO_I=$(openai-playground code "$@")
echo $HOW_DO_I | pbcopy
echo $HOW_DO_I
}
function oai() {
local RESULT=$(openai-playground "$@")
echo $RESULT | pbcopy
echo $RESULT
}
function oai-pic() {
RESULT=$(openai-playground pic "$@")
echo $RESULT | pbcopy
if [[ $RESULT == *"ERROR"* ]]; then
echo $RESULT
return
fi
open $(echo $RESULT)
}