Use when writing Go code to interact with Gitea API - automation, bots, integrations, migrations, or programmatic git forge operations
Provides the Gitea Go SDK for programmatic API access when writing Go code for automation, bots, or integrations. Triggers when you need to create repositories, manage issues/PRs, or perform other Gitea operations from Go.
/plugin marketplace add gaarutyunov/dev-skills/plugin install gitea@dev-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/api-reference.mdreferences/examples.mdreferences/types.mdThe official Go SDK for Gitea provides 332+ API methods with full type safety. Use it for bots, automation, integrations, and complex workflows. For quick CLI operations, use gitea:tea-cli instead.
import "code.gitea.io/sdk/gitea"
// Create client
client, err := gitea.NewClient(
"https://gitea.example.com",
gitea.SetToken("your-token"),
)
go get code.gitea.io/sdk/gitea
See references/authentication.md in tea-cli for token creation.
| Task | Method |
|---|---|
| Repos | |
| List my repos | client.ListMyRepos(ListReposOptions{}) |
| Get repo | client.GetRepo(owner, repo) |
| Create repo | client.CreateRepo(CreateRepoOption{}) |
| Issues | |
| List issues | client.ListRepoIssues(owner, repo, ListIssueOption{}) |
| Create issue | client.CreateIssue(owner, repo, CreateIssueOption{}) |
| Edit issue | client.EditIssue(owner, repo, index, EditIssueOption{}) |
| PRs | |
| List PRs | client.ListRepoPullRequests(owner, repo, ListPullRequestsOptions{}) |
| Create PR | client.CreatePullRequest(owner, repo, CreatePullRequestOption{}) |
| Merge PR | client.MergePullRequest(owner, repo, index, MergePullRequestOption{}) |
| Releases | |
| List releases | client.ListReleases(owner, repo, ListReleasesOptions{}) |
| Create release | client.CreateRelease(owner, repo, CreateReleaseOption{}) |
See references/api-reference.md for complete method list:
See references/types.md for struct definitions:
Repository, Issue, PullRequest, ReleaseUser, Organization, TeamListOptions for paginationSee references/examples.md for idiomatic patterns:
// Token auth (recommended)
client, _ := gitea.NewClient(url, gitea.SetToken(token))
// Basic auth
client, _ := gitea.NewClient(url, gitea.SetBasicAuth(user, pass))
// With 2FA
client, _ := gitea.NewClient(url,
gitea.SetBasicAuth(user, pass),
gitea.SetOTP(otp),
)
// SSH key
client, _ := gitea.NewClient(url,
gitea.UseSSHPubkey(fingerprint, keyPath, passphrase),
)
// Pagination
opts := gitea.ListOptions{Page: 1, PageSize: 50}
for {
repos, resp, _ := client.ListMyRepos(gitea.ListReposOptions{ListOptions: opts})
// process repos...
if resp.NextPage == 0 {
break
}
opts.Page = resp.NextPage
}
// Context support
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
client.SetContext(ctx)
| Problem | Solution |
|---|---|
| Nil pointer panic | Always check error before using result |
| Missing pagination | Use resp.NextPage to get all results |
| Context timeout | Set appropriate timeout for bulk operations |
| Rate limiting | Check resp.Header for rate limit info |
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.