Interact with ChatGPT directly from the command line
npm i -g @cozminu/gpt-cli
export OPENAI_API_KEY=<your_openai_api_key>
-
Open your terminal or command prompt.
-
Set the
OPENAI_API_KEY
environment variable using the command line:export OPENAI_API_KEY=<your_openai_api_key>
Replace
<your_openai_api_key>
with your actual OpenAI API key. You can generate a new one here: https://platform.openai.com/account/api-keys -
Run the application using the following command:
gpt ask "who wrote The Witcher?"
or
gpt chat
-
gpt ask "what is the highest mountain?"
-
REPL style prompt, ask follow-up questions, gpt uses short-term memory
gpt chat
-
Saves conversation to file
gpt <ask/chat> -s [filename]
⬜ Easier OpenAI API Key (gpt set-key)
⬜ GPT-4 support
⬜ Configuration file (temperature, top_p, model, etc)
⬜ Ask questions from document (pdf, txt)
⬜ Generate document summary