HelpMe is a powerful terminal-based CLI tool designed to help you accomplish user-defined Linux tasks by automatically generating and executing step-by-step commands. The tool uses advanced LLMs to intelligently generate, validate, and verify each command, ensuring accuracy, safety, and efficiency in completing tasks on the command line.
- Automatic Plan Generation: Converts user instructions into clear, sequential commands for the Linux terminal, making it easy to accomplish complex tasks.
- Intelligent Plan Verification: Each generated command is verified to ensure it aligns with the user’s instructions and incorporates prior feedback before execution.
- Flexible Execution Modes: Choose between using a local model (Ollama's llama 3.1) or an online API with the Gemini LLM by Google.
- Robust Error Handling: Errors during command execution are caught, and the tool provides feedback without executing subsequent commands.
- Python: 3.8 or higher
- Python Packages: Install dependencies listed in
requirements.txt
- API Access: A Gemini API key for online execution
-
Fork and Clone the Repository
- Fork the HelpMe repository to your GitHub account.
- Clone your forked repository locally:
git clone https://github.com/{YOUR-USERNAME}/helpme cd helpme
-
Install Dependencies
- Install necessary packages by running:
pip install -r requirements.txt
- Install necessary packages by running:
-
Set Up API Key
- Add your
GEMINI_API_KEY
in a.env
file as shown in.env.example
.
- Add your
To use the HelpMe CLI tool, you can either run the Python script directly or create an executable for easier access.
Run the tool with a user instruction. Here’s an example:
python helpme.py "create a folder named 'hello'" --online
For easier access, you can create a standalone executable with PyInstaller.
- Build the executable:
pyinstaller --onefile helpme.py
- Move the executable to your system path (e.g.,
/usr/bin
) for global access:sudo cp dist/helpme /usr/bin/helpme
Now you can run helpme
directly from the terminal.
Use helpme
to generate and execute a plan based on a user-defined instruction:
helpme "create a new directory named 'mydir'" --online
Options:
instruction
(str): The instruction you want to turn into commands.--online
(optional): Use the Gemini LLM if you have internet access. If omitted, the tool defaults to using Ollama's Llama 3.1 model.
For an instruction like "Create a folder named 'hello'", the tool might generate:
Generated Plan:
Step 1: Check if 'hello' exists.
Command: if [ -d hello ]; then echo 'Directory already exists'; else echo 'Directory does not exist'; fi
Step 2: Create 'hello' directory if it doesn't exist.
Command: if [ ! -d hello ]; then mkdir hello; else echo 'Directory already exists'; fi
Feedback:
Step 1: Check if 'hello' exists.
Status: APPROVED
Step 2: Create 'hello' directory if it doesn't exist.
Status: APPROVED
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Submit a pull request.
Please feel free to open issues for any bugs or feature requests.
This project is licensed under the MIT License. See the LICENSE file for details.