mahdikooshkbaghi / llm-term

Chat with OpenAI's GPT models directly from the command line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

llm-term

Chat with OpenAI's GPT models directly from the command line.

image

PyPI PyPI - Python Version GitHub License Black Codestyle pre-commit semantic-release Gitmoji

Installation

pipx install llm-term

Usage

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."
Screen Recording
Untitled.2.mov

About

Chat with OpenAI's GPT models directly from the command line

License:MIT License


Languages

Language:Python 85.7%Language:JavaScript 14.3%