This project integrates OpenAI’s GPT capabilities with AWS CLI, enabling users to interact with AWS services using natural language prompts. The tool translates user-friendly prompts into actionable AWS CLI commands and executes them seamlessly.
Use this tool at your own risk. Automating AWS CLI commands through natural language processing can lead to unintended or unpredictable results. We are not responsible for any data loss, resource misconfiguration, or unexpected costs incurred while using this tool.
- Natural Language Processing: Leverage OpenAI’s GPT model to interpret user commands.
- AWS CLI Integration: Automatically execute AWS CLI commands based on generated outputs.
- Error Handling: Includes checks to ensure environment variables and dependencies are properly configured.
- Blocklist: Prevent disruptive commands to be run automatically
Before running the script, ensure the following dependencies and environment variables are set up:
- Python 3.8 or newer
openai
Python package- AWS CLI configured with valid credentials
pyenv
for managing Python versions (optional but recommended)
- OPENAI_API_KEY: Your OpenAI API key.
- AWS credentials: Ensure
~/.aws/credentials
is configured correctly.
-
Clone the repository:
git clone https://github.com/<your-username>/<repo-name>.git cd <repo-name>
-
Set up a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate
-
Install required dependencies:
pip install -r requirements.txt
-
Set the necessary environment variables:
export OPENAI_API_KEY="your-openai-api-key"
-
Run the script:
python aaws.py
-
Enter natural language prompts to interact with AWS services. For example:
Create an S3 bucket named "my-bucket"
-
The tool will:
- Interpret your prompt using OpenAI’s GPT model.
- Translate it into an AWS CLI command.
- Execute the command and display the results.
Input:
List all EC2 instances in the us-east-1 region.
Output:
aws ec2 describe-instances --region us-east-1
Result: Displays the list of EC2 instances.
-
Missing API Key: Ensure the
OPENAI_API_KEY
environment variable is set correctly. -
AWS CLI Errors: Verify AWS credentials and CLI configuration using:
aws configure
-
Dependency Issues: Reinstall dependencies using:
pip install -r requirements.txt
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch-name
- Make your changes and test them thoroughly.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE
file for details.