Introduction | VS Code Extension Workflow | Branches | Roadmap | Packages | Complications | Simplifications | Missed Considerations | TODO | MVP Scope | Features
We can use the claude link below. It will allow us to spin up some variations, then we can convert them to work with vs code design. It's just a rough sketch of a simplitic UI concept.
https://claude.site/artifacts/7f819e0f-2ec9-41e9-aa3c-219fa7231ffd
%%{init: {'theme':'dark'}}%%
graph LR
A[User in VS Code] --> B(AI-Powered Command);
B --> C(Code Analysis);
C --> D(Terraform Generation);
D --> E(AWS Deployment);
This project is a VS Code extension designed to streamline the process of deploying applications to AWS using AI-powered Terraform script generation. It leverages large language models (LLMs) and other AI techniques to automate the creation of infrastructure as code, making it easier and faster to deploy applications to AWS.
The core of this project is a VS Code extension that provides a seamless workflow for deploying to AWS using AI-generated Terraform scripts. Here's how it works:
- User Initiates Command: The user triggers the AI-powered deployment command within VS Code.
- Code Analysis: The extension analyzes the user's project, summarizing the purpose of each file and identifying key components.
- Terraform Generation: The extension uses an LLM to generate a Terraform template based on the code analysis.
- AWS Deployment: The extension deploys the generated Terraform template to AWS, creating the necessary infrastructure.
This workflow automates the entire process of creating infrastructure as code and deploying it to AWS, all within the VS Code environment.
-
Clone the repository:
git clone https://github.com/oquirrh/ai-hackathon-25.git cd ai-hackathon-25 -
Install dependencies:
- For the VS Code extension, navigate to the
deployagentdirectory and run:cd deployagent npm install - For other Python-based components, run:
cd .. pip install -r requirements.txt
- For the VS Code extension, navigate to the
-
Set up environment variables:
- Create a
.envfile in the root directory and add the necessary API keys and credentials. - Example:
OPENROUTER_API_KEY=your_openrouter_api_key AWS_ACCESS_KEY_ID=your_aws_access_key_id AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key PINECONE_API_KEY=your_pinecone_api_key
- Create a
-
Install Ollama:
- If you plan to use Ollama, follow the installation instructions on the Ollama website.
-
VS Code Extension:
- Open the
deployagentdirectory in VS Code. - Press
F5to launch the extension in a new VS Code window. - Open a project folder and run the
AI Deploycommand from the command palette (Ctrl+Shift+PorCmd+Shift+P).
- Open the
-
Terraform Deployment:
- The VS Code extension will generate a Terraform template.
- You can then use the Terraform CLI to deploy the infrastructure to AWS.
- Ensure you have the Terraform CLI installed and configured with your AWS credentials.
- Example:
terraform init terraform apply
If you'd like to build and run the extension yourself, please follow these instructions.
cd deployagent
npm run compileF5 / Run and Debug
The extension development host will open. Please select the project you want to deploy, and choose Run Deploy Agent.
- Base branch with no specific code changes.
- Introduces a
CodeAnalysisAgentclass for summarizing code files and identifying interactions between files. - Uses a Hugging Face language model for summarization.
- Identical to
code-expert-llmand doesn't contain any code changes.
- Integrates the
CodeAnalysisAgentwith aTerraformTemplateGeneratorin anAIPipeline. - Includes a hardcoded path to a project directory and API keys.
- Minor fix to the
integrationbranch, adding an__init__.pyfile to thepipelinedirectory.
- Introduces a
DocsCrawlerclass for scraping documentation from URLs, generating embeddings, and storing them in a Pinecone index. - Uses
Crawl4aiToolsfor web scraping,SentenceTransformerfor generating embeddings, andPineconefor storing embeddings.
- Includes a
TerraformTemplateGeneratorclass that generates Terraform templates based on code file summaries. - Includes an
extract-files.pyscript that uses an LLM to identify necessary files for infrastructure deployment.
- Introduces a VS Code extension that lists all files in the currently opened workspace folder.
- Uses the VS Code API for interacting with the editor.
Goal: To achieve a functional MVP of the VS Code extension that can analyze code, generate Terraform scripts, and deploy to AWS.
Assumptions:
- We have a basic understanding of the code in each branch.
- We have access to necessary API keys and credentials.
- We are working with a team of developers.
Phases:
-
Morning (9:00 AM - 12:00 PM): Core Functionality Integration
- Code Analysis (
code-expert-llm):- Task: Integrate the
CodeAnalysisAgentinto the VS Code extension. - Simplification: Focus on summarizing code files and skip the interaction analysis for now.
- Packages: Use
langchainfor text splitting andtransformersfor the LLM. - Considerations: Ensure the model is loaded correctly and the summarization is working within the VS Code extension.
- Task: Integrate the
- Terraform Template Generation (
terrform-gen-expert):- Task: Integrate the
TerraformTemplateGeneratorinto the VS Code extension. - Simplification: Skip the AWS S3 push and focus on generating a basic template.
- Packages: Use
ollamafor the LLM. - Considerations: Ensure the LLM is working and the template is generated correctly within the VS Code extension.
- Task: Integrate the
- Combine: Create a single VS Code command that analyzes the code and generates a Terraform template.
- Code Analysis (
-
Afternoon (1:00 PM - 4:00 PM): Deployment and Basic UI
- AWS Deployment:
- Task: Integrate the Terraform deployment process into the VS Code extension.
- Simplification: Focus on a basic deployment process without advanced configurations.
- Packages: Use the AWS SDK for Python (boto3) or the Terraform CLI.
- Considerations: Ensure the deployment process is working correctly within the VS Code extension.
- Basic UI:
- Task: Add basic UI elements to the VS Code extension for user interaction.
- Simplification: Focus on basic input prompts and output messages.
- Packages: Use the VS Code API.
- Considerations: Ensure the UI elements are working correctly and are user-friendly.
- AWS Deployment:
-
Late Afternoon (4:00 PM - 6:00 PM): Testing and Refinement
- Testing:
- Test the VS Code extension with a sample project and AWS account.
- Refinement:
- Fix any bugs or issues that arise during testing.
- Make minor improvements to the code and UI.
- Write a basic README.md file.
- Testing:
langchain: For text splitting and LLM integration.transformers: For loading and using LLMs.ollama: For interacting with local LLMs.boto3: For interacting with AWS services.- VS Code API: For creating the VS Code extension.
litellm: Consider usinghttps://github.com/BerriAI/litellmfor easier LLM integration.
- API Keys and Credentials: Ensure all API keys and credentials are set up correctly.
- Model Loading: Ensure the LLMs are loaded correctly and are working as expected within the VS Code extension.
- File Paths: Ensure all file paths are correct and the extension can access the necessary files.
- Error Handling: Implement basic error handling to catch any issues that may arise.
- Integration Issues: Ensure all components are integrated correctly and are working together within the VS Code extension.
- AWS Permissions: Ensure the AWS account has the necessary permissions to deploy resources.
- Skip the interaction analysis in the
CodeAnalysisAgent. - Skip the AWS S3 push in the
TerraformTemplateGenerator. - Focus on a basic deployment process without advanced configurations.
- Focus on basic UI elements for user interaction.
- Error Handling: The current code lacks proper error handling.
- Logging: The current code lacks proper logging.
- Unit Tests: The current code lacks unit tests.
- CI/CD: The current code lacks a CI/CD pipeline.
- Security: The current code hardcodes API keys and credentials.
- Integrate
CodeAnalysisAgentinto the VS Code extension. - Integrate
TerraformTemplateGeneratorinto the VS Code extension. - Implement basic AWS deployment functionality within the VS Code extension.
- Add basic UI elements for user interaction.
- Test the VS Code extension with a sample project and AWS account.
- Write a basic README.md file.
The MVP scope includes the following:
- A VS Code extension that can analyze code, generate Terraform scripts, and deploy to AWS.
- Basic UI elements for user interaction.
- A basic deployment process without advanced configurations.
- AI-Powered Code Analysis: Summarizes code files and identifies key components.
- Terraform Template Generation: Generates Terraform templates based on code file summaries.
- AWS Deployment: Deploys the generated Terraform template to AWS.
- VS Code Integration: Provides a seamless workflow within the VS Code environment.

