feat(repos): add repo edit subcommand (#928)

## Summary
- Add `tea repo edit` subcommand to update repository properties via the Gitea API
- Support flags: `--name`, `--description`/`--desc`, `--website`, `--private`, `--template`, `--archived`, `--default-branch`
- Boolean-like flags use string type to distinguish "not set" from "false", following the pattern in `releases/edit.go`

## Test plan
- [x] `go build ./...` passes
- [x] `go vet ./...` passes
- [x] `tea repo edit --help` shows all flags correctly
- [x] Manual test: `tea repo edit --private true` on a test repo
- [x] Manual test: `tea repo edit --name new-name --description "new desc"` on a test repo

Reviewed-on: https://gitea.com/gitea/tea/pulls/928
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2026-03-12 03:06:44 +00:00
committed by Bo-Yi Wu (吳柏毅)
parent 302c946cb8
commit a531faa626
3 changed files with 133 additions and 0 deletions

View File

@@ -1199,6 +1199,32 @@ Delete an existing repository
**--owner, -O**="": owner of the repo
### edit, e
Edit repository properties
**--archived**="": Set archived [true/false]
**--default-branch**="": Set default branch
**--description, --desc**="": New description of the repository
**--login, -l**="": Use a different Gitea Login. Optional
**--name**="": New name of the repository
**--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json)
**--private**="": Set private [true/false]
**--remote, -R**="": Discover Gitea login from remote. Optional
**--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional
**--template**="": Set template [true/false]
**--website**="": New website URL of the repository
## branches, branch, b
Consult branches