Working on creating Crew templates and pipeline templates

This commit is contained in:
Brandon Hancock
2024-08-01 11:43:39 -04:00
parent c5e8302a7d
commit 9996cf206e
29 changed files with 502 additions and 66 deletions

20
src/crewai/cli/utils.py Normal file
View File

@@ -0,0 +1,20 @@
import click
def copy_template(src, dst, name, class_name, folder_name):
print(f"Copying {src} to {dst}")
print(f"Interpolating {name}, {class_name}, {folder_name}")
"""Copy a file from src to dst."""
with open(src, "r") as file:
content = file.read()
# Interpolate the content
content = content.replace("{{name}}", name)
content = content.replace("{{crew_name}}", class_name)
content = content.replace("{{folder_name}}", folder_name)
# Write the interpolated content to the new file
with open(dst, "w") as file:
file.write(content)
click.secho(f" - Created {dst}", fg="green")