feat(tools): create_project_from_template

Generates a new repo from mathias/template-go-web via Gitea's generate
API, then substitutes __PROJECT_NAME__ and __MODULE_PATH__ placeholders
in six known files (best-effort, partial failure surfaced in result).

Validates name regex, allowlist, template flag, and destination
non-existence before generating. Adds Template field to gitea.Repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-05-04 23:02:21 +02:00
parent e95e87e8e3
commit 39dc22ec3a
6 changed files with 642 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ func main() {
reg.Register(tools.NewIssueComment(giteaClient, ownerAllow))
reg.Register(tools.NewPRComment(giteaClient, ownerAllow))
reg.Register(tools.NewPRFilesDiff(giteaClient, ownerAllow))
reg.Register(tools.NewCreateProjectFromTemplate(giteaClient, ownerAllow, "mathias", "template-go-web"))
mcpSrv := mcp.NewServer(mcp.ServerOptions{
Registry: reg,