NL2BASH is a web-based tool that converts natural language instructions into corresponding Bash commands. The application leverages a machine learning model (using T5ForConditionalGeneration and RobertaTokenizer) from Transformers to generate and execute Bash commands dynamically.
- Natural Language Processing: Convert user instructions into Bash commands.
- Dynamic Working Directory: Select the desired working directory for command execution.
- Command Execution History: View a log of previously executed commands and outputs.
- Integrated Interface: Built with Flask, jQuery, and Bootstrap for a responsive experience.
- app.py: Main Flask application that handles routing, model inference, and command execution.
- templates/index.html: HTML template for the web interface.
- static/style.css: Custom CSS styling for the application.
- LICENSE: Apache License 2.0.
-
Clone the Repository
git clone <repository-url>
-
Navigate to the Project Directory
cd NL2BASH-main -
Set Up the Environment
- Ensure you have Python 3.8 or later installed.
- (Optional) Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Run the Application
python app.py
-
Access the Web Interface
- Open your browser and visit: http://127.0.0.1:5000
-
Generate and Execute Commands
- Enter your natural language instruction.
- Select the desired directory from the dropdown.
- Click Generate Command to view the Bash command.
- Click Execute Command to run the command and view the output.
- The command and output will be added to the execution history.
Contributions are welcome! Please submit issues or pull requests for improvements and bug fixes.
This project is licensed under the terms of the Apache License 2.0.
- Thanks to the developers of Flask, PyTorch, and Transformers for the foundational libraries.
- Special mention to the original JayProngs/NL2BASH model.
Authors:
Jayesh Thakur |
Sai Vikas |
Aryan Sharma |