๐ง Agentic Coding TrendsMay 19, 2026โ
Tests passing
Workflow Auto-Generator
An automation tool that generates CI/CD or coding task automation workflows (e.g., GitHub Actions YAML files) based on project requirements extracted through natural language prompts. It simplifies creating complex automation workflows by leveraging AI.
What It Does
- AI-powered generation of CI/CD workflows from natural language descriptions.
- Supports multiple workflow providers like GitHub Actions and GitLab CI.
- Validates generated YAML files for syntax correctness.
Installation
1. Clone this repository or download the workflow_autogenerator.py file.
2. Install the required dependencies:
pip install -r requirements.txtUsage
python workflow_autogenerator.py --prompt "Deploy a Node.js application to production on push to main branch" --platform github --output deploy.yml --api-key YOUR_OPENAI_API_KEYSource Code
import argparse
import openai
import yaml
import os
def generate_workflow(prompt, platform, api_key):
"""
Generates a CI/CD workflow YAML configuration based on a natural language prompt.
Args:
prompt (str): The natural language description of the desired workflow.
platform (str): The target platform (e.g., 'github', 'gitlab').
api_key (str): OpenAI API key for accessing GPT models.
Returns:
str: The generated YAML configuration as a string.
Raises:
ValueError: If the platform is unsupported.
Exception: If an error occurs during the OpenAI API call.
"""
if platform not in ['github', 'gitlab']:
raise ValueError("Unsupported platform. Supported platforms are: 'github', 'gitlab'.")
openai.api_key = api_key
try:
response = openai.Completion.create(
engine="text-davinci-003",
prompt=f"Generate a {platform} CI/CD workflow YAML file for the following task: {prompt}",
max_tokens=500
)
yaml_content = response.choices[0].text.strip()
# Validate YAML syntax
yaml.safe_load(yaml_content)
return yaml_content
except yaml.YAMLError as e:
raise ValueError("Generated YAML is invalid.") from e
except Exception as e:
raise Exception("Failed to generate workflow.") from e
def save_workflow_to_file(yaml_content, output_file):
"""
Saves the generated YAML content to a file.
Args:
yaml_content (str): The YAML content to save.
output_file (str): The output file path.
"""
with open(output_file, 'w') as file:
file.write(yaml_content)
def main():
parser = argparse.ArgumentParser(description="Workflow Auto-Generator: Generate CI/CD workflows from natural language prompts.")
parser.add_argument('--prompt', required=True, help="Natural language description of the desired workflow.")
parser.add_argument('--platform', required=True, choices=['github', 'gitlab'], help="Target platform for the workflow (github or gitlab).")
parser.add_argument('--output', required=True, help="Output file to save the generated workflow YAML.")
parser.add_argument('--api-key', required=True, help="OpenAI API key.")
args = parser.parse_args()
try:
yaml_content = generate_workflow(args.prompt, args.platform, args.api_key)
save_workflow_to_file(yaml_content, args.output)
print(f"Workflow successfully generated and saved to {args.output}")
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
main()Community
Downloads
ยทยทยท
Rate this tool
No ratings yet โ be the first!
Details
- Tool Name
- workflow_autogenerator
- Category
- Agentic Coding Trends
- Generated
- May 19, 2026
- Tests
- Passing โ
Quick Install
Clone just this tool:
git clone --depth 1 --filter=blob:none --sparse \ https://github.com/ptulin/autoaiforge.git cd autoaiforge git sparse-checkout set generated_tools/2026-05-19/workflow_autogenerator cd generated_tools/2026-05-19/workflow_autogenerator pip install -r requirements.txt 2>/dev/null || true python workflow_autogenerator.py