Skip to main content

A CLI tool that extends TLDR with GPT-generated examples

Project description

tldrr – Enhanced TLDR with GPT-Powered Examples

tldrr is a command-line tool that extends the functionality of the popular tldr command by providing enhanced, GPT-generated examples for command-line tools. It queries tldr to get concise command examples and supplements them with additional, more detailed scenarios powered by OpenAI’s GPT models.

🚀 Features • Concise tldr-Style Output – GPT responses are formatted to match the tldr style for easy readability. • Interactive Mode – Users can request additional examples (y/n prompt) until satisfied. • Caching – Results are cached for 30 days to reduce redundant API calls and improve performance. • Seamless Integration – Works like the tldr command but with added AI-driven insights. • Configurable – Users can clear the cache or disable GPT-enhanced examples for offline use.

🛠️ Installation

  1. Clone the Repository

git clone https://github.com/yourusername/tldrr.git cd tldrr

  1. Install the Tool Locally

pip install .

  1. Ensure tldr is Installed

sudo apt install tldr # Ubuntu/Debian brew install tldr # macOS scoop install tldr # Windows

🔑 API Key Setup

tldrr uses the OpenAI API to generate enhanced examples. 1. Get your API key from https://platform.openai.com/. 2. Export the API key as an environment variable:

export OPENAI_API_KEY="your_api_key_here"

3.    Add the export line to your .bashrc or .zshrc to make it persistent:

echo 'export OPENAI_API_KEY="your_api_key_here"' >> ~/.bashrc source ~/.bashrc

📦 Usage

Basic Command

tldrr

Example:

tldrr tcpdump

•    This queries tldr for tcpdump and enhances the output with additional GPT-generated examples.

Prompt for More Examples

Would you like more examples? (y/n):

•    Press y to fetch more examples.
•    Press n to exit the loop.

Clear Cache

tldrr --clear-cache

•    This clears cached tldr and GPT results.

🧑‍💻 Example Output

tldrr ls

--- TLDR Output ---

  • List files in the current directory: ls

  • List all files, including hidden ones: ls -a

--- Enhanced Examples from GPT ---

  • List files sorted by size: ls -lS

  • List files by modification time: ls -lt

Would you like more examples? (y/n): y

--- Additional Examples from GPT ---

  • List directories only: ls -d */

  • List files recursively in subdirectories: ls -R

⚙️ Configuration Options • Cache Expiry – Cached results expire after 30 days by default. • Offline Mode – If GPT is unavailable, the script falls back to tldr results. • Interactive Prompt – Users can continuously query GPT for more examples or stop when satisfied.

🐛 Troubleshooting • Command Not Found: Ensure tldr is installed and in your system’s PATH. • Invalid API Key: Double-check your OpenAI API key and re-export it. • Repeating GPT Results: The script dynamically prompts GPT for new examples to avoid redundancy.

🌟 Why Use tldrr? • Advanced Learning – Get more comprehensive command-line examples beyond standard tldr outputs. • Saves Time – Quickly grasp complex command-line options with curated, GPT-driven insights. • Interactive and Scalable – Request as much or as little detail as you need.

📜 License

This project is licensed under the MIT License.

🤝 Contributing

Contributions are welcome! Please submit issues or pull requests to enhance the tool further.

🗂️ Future Improvements • Batch Mode – Support querying multiple commands at once. • Command History – Track previously queried commands. • Offline GPT Cache – Save GPT results for offline access.

📧 Contact

For questions or collaboration, feel free to reach out at your.email@example.com or open an issue on GitHub.

Would you like to add GitHub Action workflows to automate releases or testing for this project?

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

tldrr-1.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

tldrr-1.0.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file tldrr-1.0.2.tar.gz.

File metadata

  • Download URL: tldrr-1.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for tldrr-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d0ac3dde3836a7eccdae6ca372ab93b3ca52a037bfdd1e13046a10a3d5aa387c
MD5 3e0e4bd8ee7fa3e639500aba5c459461
BLAKE2b-256 0977dca4eda09ae9a15edb4f769d382c435e34d249ea46926481803757b59290

See more details on using hashes here.

File details

Details for the file tldrr-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: tldrr-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for tldrr-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0eceb344d99fdd6e99c1c402fb157a088b9514a19e9ca13297a12d090b8c1c1f
MD5 e43a49a11859b8133e509895522eee4e
BLAKE2b-256 80f49ddfa40c0e68658ea70ffc99d6c6cb5960db37f04cda8222ab1231537a02

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