Skip to content
/ wtf Public

A powerful app that uses AI to provide human-readable explanations for your terminal errors.

License

Notifications You must be signed in to change notification settings

joaroque/wtf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

WTF: What is The Fault?

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
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

WTF Demo

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.

Getting Started

Follow these steps to set up and run the project locally. This guide provides clear instructions to help you get started quickly.

Prerequisites

Installation

Follow the steps below to install and set up WTF locally.

  1. Clone the repo

    git clone https://github.com/joaroque/wtf.git
  2. In the project directory, install the Python packages.

    poetry install
  3. Create and enter your API KEY in .env

    OPENAI_API_KEY = "ENTER YOUR API KEY HERE";
  4. 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

Usage

WTF screenshot

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.

Usage Instructions

  1. In the project directory, activate the Poetry shell:
poetry shell
  1. Build the WTF application:
poetry build
  1. Verify the installation and display WTF help:
which wtf && wtf --help

For more information on how to use Poetry, refer to the Poetry Documentation.

Roadmap

  • 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

Contributing

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.

How to Contribute

  1. Fork the Repository: Create a personal copy of the repository by forking it.
  2. Create a Feature Branch: Develop your feature or fix in a new branch.
   git checkout -b feature/YourFeatureName
  1. 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'
  1. Push to Your Branch: Push your changes to your forked repository.
    git commit -m 'Add a brief description of your feature or fix'
  1. Open a Pull Request: Submit your changes for review by opening a pull request in the main repository.

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

LinkedIn - Joaquim Roque Project Link: https://github.com/joaroque/wtf

(back to top)

About

A powerful app that uses AI to provide human-readable explanations for your terminal errors.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages