Skip to content

Rictus/flem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7a17476 · Sep 13, 2024

History

6 Commits
Sep 13, 2024
Sep 12, 2024

Repository files navigation

FLEM - Fix Last Executed Mistake

FLEM is a command-line tool that helps fix bash commands. It retrieves the last executed bash command from your history, sends it to GPT for correction, and then allows you to execute the corrected command.

Features

  • Ultra simple
  • No external dependencies

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/flem.git
    cd flem
    
  2. Set up your OpenAI API key as an environment variable:

    export FLEM_OPENAI_API_KEY='your-api-key-here'
    

Usage

Run the script with:

python flem.py [options]

It's recommended to define an alias instead:

alias flem='history -w;python3 /path/to/flem.py'

Options:

  • -v, --verbose: Enable verbose output
  • -h, --help: Show the help message and exit

Safety Features

  • The script checks for potentially dangerous commands (e.g., rm, dd, mkfs) and asks for confirmation before executing them.
  • The OpenAI API call is configured with a low temperature setting to reduce randomness in the output.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages