tgpt is a general Terminal AI Agent, that can search the web and execute commands from natural language instructions. It is powered by the OpenAI API, and also functions as a generic ChatGPT interface from the terminal.
- Convert natural language into Bash commands.
- Search the web, and incorporate those details into relevant bash commands, or just ask for the weather.
- Execute commands interactively in chat mode.
- Python 3.8 or later
- A valid OpenAI API key
- A valid Tavily API key
-
Clone the Repository:
git clone https://github.com/svineet/termgpt.git tgpt/ cd tgpt -
Install the Package:
Using pip:
python3 -m pip install .Or, using pipx for isolation:
pipx install . -
Set Up API Keys:
Export your OpenAI API key as an environment variable:
export OPENAI_API_KEY="your-openai-api-key"
Export your Tavily search API key as an environment variable:
export TAVILY_API_KEY="your-tavily-api-key"
-
Run the Tool:
Agent chat mode:
tgpt
Prompt mode:
tgpt -p "List all Python files in the current directory"To exit agent mode, type
exit.