|
10 | 10 | from agentstack import packaging |
11 | 11 | from agentstack import frameworks |
12 | 12 | from agentstack import generation |
| 13 | +from agentstack import repo |
13 | 14 | from agentstack.proj_templates import get_all_templates, TemplateConfig |
14 | 15 |
|
15 | 16 | from agentstack.cli import welcome_message |
@@ -127,18 +128,23 @@ def init_project( |
127 | 128 | packaging.create_venv() |
128 | 129 | log.info("Installing dependencies...") |
129 | 130 | packaging.install_project() |
| 131 | + repo.init() # initialize git repo |
130 | 132 |
|
131 | 133 | # now we can interact with the project and add Agents, Tasks, and Tools |
132 | 134 | # we allow dependencies to be installed along with these, so the project must |
133 | 135 | # be fully initialized first. |
134 | | - for task in template_data.tasks: |
135 | | - generation.add_task(**task.model_dump()) |
136 | | - |
137 | | - for agent in template_data.agents: |
138 | | - generation.add_agent(**agent.model_dump()) |
139 | | - |
140 | | - for tool in template_data.tools: |
141 | | - generation.add_tool(**tool.model_dump()) |
| 136 | + with repo.Transaction() as commit: |
| 137 | + for task in template_data.tasks: |
| 138 | + commit.add_message(f"Added task {task.name}") |
| 139 | + generation.add_task(**task.model_dump()) |
| 140 | + |
| 141 | + for agent in template_data.agents: |
| 142 | + commit.add_message(f"Added agent {agent.name}") |
| 143 | + generation.add_agent(**agent.model_dump()) |
| 144 | + |
| 145 | + for tool in template_data.tools: |
| 146 | + commit.add_message(f"Added tool {tool.name}") |
| 147 | + generation.add_tool(**tool.model_dump()) |
142 | 148 |
|
143 | 149 | log.success("🚀 AgentStack project generated successfully!\n") |
144 | 150 | log.info( |
|
0 commit comments