An interactive terminal tool using GPT
Project description
tux-gpt
tux-gpt is an interactive command-line tool that leverages GPT-based language models to provide intelligent, conversational assistance directly within your terminal. It enables on-the-fly code generation, debugging help, technical explanations, and more—all without leaving the command-line environment.
Designed for developers and tech enthusiasts, tux-gpt streamlines workflows by integrating AI assistance seamlessly into terminal sessions, making complex tasks easier and faster to accomplish via intuitive, context-aware command-line interactions.
Prerequisites
- Python 3.7+
- Pip (Python package manager)
- An OpenAI API key (see next section)
Setup and Configuration
-
Install:
git clone https://github.com/fberbert/tux-gpt.git cd tux-gpt pip install .
-
Get your OpenAI API key:
- Sign up or log in at https://platform.openai.com.
- Navigate to API Keys and create a new key.
- Copy the generated key.
-
Configure your environment variable:
- Linux/macOS (bash/zsh):
echo 'export OPENAI_API_KEY="<your_api_key>"' >> ~/.bashrc source ~/.bashrc
- Windows (PowerShell):
[Environment]::SetEnvironmentVariable('OPENAI_API_KEY', '<your_api_key>', 'User')
- Linux/macOS (bash/zsh):
Note: On first run, tux-gpt will create the directory ~/.tux-gpt/ containing:
config.json: CLI configuration (e.g., default model);history.json: persistence of the last 20 messages (user + assistant);input_history: command history for navigation with ↑/↓ arrow keys.
Usage
Start the interactive session:
tux-gpt
Example commands
-
Search the web for current news:
> Find the latest headlines about OpenAI -
Look up technical documentation:
> What is the syntax for Python's list comprehensions? -
Fetch real-time data (e.g., stock price):
> What's the current stock price of AAPL? -
Summarize a web article:
> Summarize the top result for "machine learning trends 2025"
Memory & Command History
tux-gpt now persists your conversation and command history locally in the ~/.tux-gpt/ directory. The files created are:
config.json: CLI configuration, such as the default model.history.json: stores the last 20 messages (user + assistant) to maintain context between sessions and limit token usage.input_history: command history used byreadlinefor navigation with ↑/↓ arrow keys.
Features:
- On startup, the conversation history is automatically reloaded from
history.json, limited to the last 20 messages to prevent token overload. - You can navigate previous commands using the ↑ and ↓ arrow keys at the prompt.
- To reset the conversation or command history, simply remove the corresponding files in
~/.tux-gpt/.
Customization
You can configure the default model or terminal spinner settings by editing the configuration file at ~/.tux-gpt/config.json. Example:
{
"model": "gpt-4o-mini"
}
Troubleshooting
- "OPENAI_API_KEY not set": Ensure you exported the variable correctly and restarted your shell.
- Slow responses: Check your internet connection or change to a faster model in the config.
License
MIT © 2025 tux-gpt contributors
Configuration File (~/.tux-gpt/config.json)
In the first run, tux-gpt will create a configuration file at ~/.tux-gpt/config.json. This file contains settings for the default model. You can customize the behavior of tux-gpt by editing the configuration file located at ~/.tux-gpt/config.json. This file allows you to set the default model and other preferences.
Example config file to set the model:
{
"model": "gpt-4.1-mini"
}
The default model is gpt-4.1-mini.
Model Compatibility
Important: The model you choose must support web search capability. Currently, only the following models support the web search tool:
- gpt-4.1
- gpt-4.1-mini
For more details, see the official OpenAI documentation on web search tools and limitations:
https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses#limitations
Author
Fábio Berbert de Paula
- Email: fberbert@gmail.com
- Website: https://fabio.automatizando.dev
- Founder of www.vivaolinux.com.br
- Over 25 years of experience as a developer
Official Repository
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tux-gpt-0.1.3.tar.gz.
File metadata
- Download URL: tux-gpt-0.1.3.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d72a76e9d2ca59db4b8dbbd7bf6699468673c3ce469967e5c326bec42914289
|
|
| MD5 |
896d1e6cc14e74e33bf7412c46972826
|
|
| BLAKE2b-256 |
010faed3b08413f5c8560995a4a962f4af3a161133bf8ca64119da6e6452c9e8
|
File details
Details for the file tux_gpt-0.1.3-py3-none-any.whl.
File metadata
- Download URL: tux_gpt-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d2104a8c7e6d78dad4a22b6ae4ef1526805dd72552ca4a3a2bf94286d4f26e0
|
|
| MD5 |
6ede1e46ad2389536bf25816b4dc9304
|
|
| BLAKE2b-256 |
aea66f495699629aa34aefbcc35e86503b52bd5f373279b0ccc5292cbee421f2
|