Chat with OpenAI's GPT models directly from the command line.
Screen Recording
pipx install llm-term
Then, you can chat with the model directly from the command line:
llm-term
Make sure you have an OpenAI API key set as an environment variable
(this can also set via the --api-key
/ -k
flag in the CLI):
export OPENAI_API_KEY="xxxxxxxxxxxxxx"
Optionally, you can set a custom model. llm-term defaults
to gpt-3.5-turbo
(this can also set via the
--model
/ -m
flag in the CLI):
export OPENAI_MODEL="gpt-4"
Want to start the conversion directly from the command line? No problem,
just pass your prompt to llm-term
:
llm-term show me python code to detect a palindrome
You can also set a custom system prompt. llm-term defaults to a reasonable
prompt for chatting with the model, but you can set your own prompt (this
can also set via the --system
/ -s
flag in the CLI):
export OPENAI_SYSTEM_MESSAGE="You are a helpful assistant who talks like a pirate."