Skip to content

Latest commit

 

History

History
87 lines (65 loc) · 2.15 KB

File metadata and controls

87 lines (65 loc) · 2.15 KB

Natural Language to CLI Agent

AI-powered tool that converts natural language instructions in Hebrew to Linux/Unix Bash commands.

Features

  • 🤖 Natural language to Bash command conversion
  • ⚠️ Dangerous command detection and warnings
  • ✓ Command validation in Docker container
  • 🌐 Hebrew language support
  • 🎯 Built with Gradio for easy web interface

Prerequisites

  • Python 3.11+
  • OpenAI API key
  • Docker (optional, for command validation)

Installation

  1. Clone the repository
  2. Install dependencies:
uv sync
  1. Create .env file with your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
  1. (Optional) Pull Ubuntu Docker image for command validation:
docker pull ubuntu:latest

Usage

Run the application:

uv run python app.py

The Gradio interface will open in your browser. Enter natural language instructions in Hebrew and get Bash commands.

Examples

Hebrew Input Bash Output
תציג לי את רשימת כל הקבצים ls
מה כתובת ה-IP של המחשב שלי? hostname -I
תמחק את כל קבצי ה-log בתיקיית temp ⚠️ rm temp/*.log
צור תיקייה חדשה בשם 'backup' mkdir backup

Safety Features

  • Dangerous commands (rm -rf, shutdown, format, etc.) are prefixed with ⚠️
  • Commands are validated before execution
  • Docker sandbox testing (if available)
  • Non-command requests are rejected

Project Structure

PromptEngineering/
├── app.py              # Main application
├── iterations/         # Prompt iteration history
├── .env               # API keys (not in git)
├── pyproject.toml     # Dependencies
└── README.md          # This file

Iterations

The project includes documented prompt engineering iterations in the iterations/ folder:

  • iteration_1: Windows commands
  • iteration_2: Bash commands
  • iteration_3: Dangerous command warnings
  • iteration_4: Off-topic request rejection
  • iteration_5: Fixed validation logic
  • iteration_6: Command validation
  • iteration_7: Docker execution
  • iteration_8: Optional Docker support

License

MIT