Skip to main content

An interactive terminal tool using GPT, with web search capabilities.

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

  1. Install: From PyPI:

    pip install tux-gpt
    

    From source:

    git clone https://github.com/fberbert/tux-gpt.git
    cd tux-gpt
    pip install -r requirements.txt
    pip install .
    
  2. Get your OpenAI API key:

  3. 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')
      

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

Pressione Ctrl+J para enviar sua mensagem (Enter apenas insere uma nova linha).

Demonstração de uso

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 by readline for 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-5-mini"
}

The default model is gpt-5-mini.

Model Compatibility

Important: The model you choose must support web search capability. Currently, only the following models support the web search tool:

  • gpt-5-mini
  • 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

Official Repository

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tux_gpt-0.2.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tux_gpt-0.2.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file tux_gpt-0.2.1.tar.gz.

File metadata

  • Download URL: tux_gpt-0.2.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tux_gpt-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6223579a0b979073fe68ab05df862b4c69dd754c335a609a62eafffe11f0d387
MD5 1d8b71ce3b4ba704a8e09c55fa4e1e74
BLAKE2b-256 a344540660a11745b6fa7582ccecb772a53898db6cb7a89facdc991e9163fde4

See more details on using hashes here.

File details

Details for the file tux_gpt-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tux_gpt-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tux_gpt-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 827655b28edd954a5f1283f3242bcdfde18cec37cd0c400e44c6bc6694e38b95
MD5 5e4c5a6c885be46d1471b87a47e4582f
BLAKE2b-256 8155dcbd890c268c706afbb0160c0279648ed0a6bb63ca697c6cdc1c52ae1562

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page