Inspired by The Fuck, WTF enhances functionality by offering detailed error explanations, making it a more streamlined and user-friendly alternative
Support me
·
Report Bug
·
Request Feature
Table of Contents
WTF is a terminal utility that leverages Langchain and OpenAI to read and interpret terminal errors, providing explanations that are more human-readable.
Purpose:
- Most programming languages and frameworks generate complex exception messages, making it difficult to understand the root cause.
- Existing tools typically support only English.
- Translates error outputs directly from the terminal.
Follow these steps to set up and run the project locally. This guide provides clear instructions to help you get started quickly.
- poetry
pip install poetry
- Get a your OpenAI API Key at https://platform.openai.com
Follow the steps below to install and set up WTF locally.
-
Clone the repo
git clone https://github.com/joaroque/wtf.git
-
In the project directory, install the Python packages.
poetry install
-
Create and enter your API KEY in
.env
OPENAI_API_KEY = "ENTER YOUR API KEY HERE";
-
Configure the function to export terminal error output to a file.
zsh_error_log.txt
Add this function to the end of your
.zshrc
or your shell file.# WTF Setting log_errors() { exec 2> >(tee "$HOME/zsh_error_log.txt" >&2) } log_errors
There are two commands in WTF: wtf
and fuck
or f
.
wtf (default): Used to explain the error in the terminal. fuck or f: Used to correct the last command entered in the terminal.
- In the project directory, activate the Poetry shell:
poetry shell
- Build the WTF application:
poetry build
- Verify the installation and display WTF help:
which wtf && wtf --help
For more information on how to use Poetry, refer to the Poetry Documentation.
- Add support for additional shells and OS
- Refactor error extraction logic
- Add multi-language support for static texts
- Implement a CLI-based initialization system to allow users to configure
OPEN_API_KEY
during program startup
For a comprehensive list of proposed features and known issues, see the open issues
We welcome contributions from the community! Your involvement is vital in making WTF even better. Whether you're fixing bugs, improving documentation, adding new features, or enhancing existing ones, your help is greatly appreciated.
- Fork the Repository: Create a personal copy of the repository by forking it.
- Create a Feature Branch: Develop your feature or fix in a new branch.
git checkout -b feature/YourFeatureName
- Commit Your Changes: Clearly and concisely describe your changes in your commit messages.
git commit -m 'Add a brief description of your feature or fix'
- Push to Your Branch: Push your changes to your forked repository.
git commit -m 'Add a brief description of your feature or fix'
- Open a Pull Request: Submit your changes for review by opening a pull request in the main repository.
Distributed under the MIT License. See LICENSE.txt
for more information.
LinkedIn - Joaquim Roque Project Link: https://github.com/joaroque/wtf