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

@@ -15,6 +15,7 @@ type Repo struct {
Private bool `json:"private"`
CloneURL string `json:"clone_url"`
HTMLURL string `json:"html_url"`
Template bool `json:"template"`
}
func (c *Client) ListRepos(ctx context.Context, owner string, page, limit int) ([]Repo, error) {