help_me_cli.py is a Python script that uses OpenAI's API to generate UNIX shell commands based on human-written descriptions. It provides users with a brief comment and a suggested shell command to complete the specified task.
- Uses OpenAI's GPT model to generate shell commands.
- Provides a concise comment explaining the command.
- Ensures commands are efficient, idiomatic, and safe for UNIX environments.
Ensure you have Python 3 installed along with the required dependencies:
pip install openai asyncioRun the script with a description of the UNIX task you need help with:
python help_me_cli.py "find all files in the current directory and sort by date modified"# find and sort by date modified
find . -printf "%T@ %Tc %p\n" | sort -nThe script includes an editable prompt (UNIX_HELP_PROMPT) to fine-tune OpenAI's response format. You can modify this prompt inside the script to adjust how responses are generated.
This project is licensed under the MIT License.
For any issues or contributions, feel free to submit a pull request or open an issue!