chatgpt/README.md

85 lines
2.1 KiB
Markdown
Raw Normal View History

2023-02-13 01:16:15 +00:00
# chatgpt
2023-02-13 02:01:59 +00:00
CLI application for working with ChatGPT.
2023-02-13 02:06:01 +00:00
Interactive or file based session with context and moods.
2023-02-13 02:01:59 +00:00
```
go install github.com/verdverm/chatgpt@latest
chatgpt -h
```
2023-02-13 02:04:12 +00:00
Authentication:
Set `CHATGPT_API_KEY`, which you can get here: https://platform.openai.com/account/api-keys
2023-02-13 02:01:59 +00:00
Examples:
```
Chat with ChatGPT in console.
Examples:
# start an interactive session
chatgpt -i
# ask chatgpt for a one-time response
chatgpt -q "answer me this ChatGPT..."
# provide context to a question or conversation
chatgpt context.txt -i
chatgpt context.txt -q "answer me this ChatGPT..."
2023-02-13 03:04:45 +00:00
# read prompt from file and --write response back
2023-02-13 02:01:59 +00:00
chatgpt convo.txt
2023-02-13 03:04:45 +00:00
chatgpt convo.txt --write
2023-02-13 02:01:59 +00:00
# pipe content from another program, useful for ! in vim visual mode
cat convo.txt | chatgpt
# inspect the predifined pretexts, which set ChatGPT's mood
chatgpt -p list
chatgpt -p view:<name>
# use a pretext with any of the previous modes
chatgpt -p optimistic -i
chatgpt -p cynic -q "Is the world going to be ok?"
chatgpt -p teacher convo.txt
2023-02-13 03:04:45 +00:00
# extra options
chatgpt -t 4096 # set max tokens in reponse
chatgpt -c # clean whitespace before sending
2023-02-13 02:44:25 +00:00
2023-02-13 02:01:59 +00:00
Usage:
chatgpt [file] [flags]
Flags:
2023-02-13 02:44:25 +00:00
-c, --clean remove excess whitespace from prompt before sending
2023-02-13 02:01:59 +00:00
-h, --help help for chatgpt
-i, --interactive start an interactive session with ChatGPT
-p, --pretext string pretext to add to ChatGPT input, use 'list' or 'view:<name>' to inspect predefined, '<name>' to use a pretext, or otherwise supply any custom text
-q, --question string ask a single question and print the response back
-t, --tokens int set the MaxTokens to generate per response (default 420)
2023-02-13 03:04:45 +00:00
-w, --write write response to end of context file
2023-02-13 02:01:59 +00:00
```
2023-02-13 03:04:45 +00:00
Pretexts:
```
$ chatgpt -p list
coding
cynic
liar
optimistic
sam
teacher
thoughtful
```
Jailbreaking ChatGPT:
https://old.reddit.com/r/ChatGPT/comments/10tevu1/new_jailbreak_proudly_unveiling_the_tried_and/
Contributions:
Feel free to offer interesting pretexts or anything else