feat: repo_create tool #13

Closed
opened 2026-05-14 08:51:46 +00:00 by mathias · 1 comment
Owner

Summary

Add repo_create tool to create new repositories — a prerequisite for hyperguild new-project automation.

Gitea API

POST /api/v1/user/repos (personal) or POST /api/v1/orgs/{org}/repos (org)

Tool spec

tool: repo_create
params:
  owner:         string  // user or org name
  name:          string  // repo name (validated: lowercase, hyphens)
  description:   string?
  private:       bool    // default: true (safe default)
  auto_init:     bool?   // initialise with README (default: true)
  default_branch: string? // default: main
  template:      bool?   // create as template repo
  gitignores:    string? // e.g. "Go"
  license:       string? // e.g. "MIT"

Required token permission

write:repository scope on the Gitea API token.

Risk classification

LOW — creating a repo is safe and reversible (can delete with repo_delete).

Implementation notes

  • Detect org vs user from owner param (check if owner matches authenticated user)
  • Validate name against Gitea naming rules before API call
  • Return full repo object including clone_url and html_url
  • Test: personal repo, org repo, duplicate name error

Motivation

hyperguild new-project needs to create repos programmatically as part of the idea-to-running-service pipeline. Currently requires manual web UI. This is the single most impactful missing tool for that workflow.

Dependency

None — but pairs with repo_update (#12) for setting template flag after creation.

## Summary Add `repo_create` tool to create new repositories — a prerequisite for `hyperguild new-project` automation. ## Gitea API `POST /api/v1/user/repos` (personal) or `POST /api/v1/orgs/{org}/repos` (org) ## Tool spec ``` tool: repo_create params: owner: string // user or org name name: string // repo name (validated: lowercase, hyphens) description: string? private: bool // default: true (safe default) auto_init: bool? // initialise with README (default: true) default_branch: string? // default: main template: bool? // create as template repo gitignores: string? // e.g. "Go" license: string? // e.g. "MIT" ``` ## Required token permission `write:repository` scope on the Gitea API token. ## Risk classification **LOW** — creating a repo is safe and reversible (can delete with repo_delete). ## Implementation notes - Detect org vs user from owner param (check if owner matches authenticated user) - Validate name against Gitea naming rules before API call - Return full repo object including clone_url and html_url - Test: personal repo, org repo, duplicate name error ## Motivation `hyperguild new-project` needs to create repos programmatically as part of the idea-to-running-service pipeline. Currently requires manual web UI. This is the single most impactful missing tool for that workflow. ## Dependency None — but pairs with `repo_update` (#12) for setting template flag after creation.
Author
Owner

Shipped in v0.2.2. Closing during cleanup pass.

Shipped in v0.2.2. Closing during cleanup pass.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/gitea-mcp#13