Intégration Gitea

VérifiéSûr

Cette compétence permet d'interagir avec Gitea, un service Git auto-hébergé, via son API et son interface en ligne de commande. Elle prend en charge la gestion des dépôts, des tickets, des demandes de tirage et des opérations utilisateur/organisation. Utilisez-la pour automatiser des tâches de workflow sur une instance Gitea.

Spar Skills Guide Bot
DeveloppementIntermédiaire
17002/06/2026
Claude CodeCursorWindsurf
#gitea#api#repository-management#pull-requests#issues

Recommandé pour

Notre avis

Ce skill permet d'interagir avec une instance Gitea via son API REST ou l'outil CLI tea pour gérer les dépôts, les issues et les pull requests.

Points forts

  • Automatisation complète des opérations courantes sur Gitea (création, mise à jour, fusion de PR)
  • Utilisation de l'API REST ou du client officiel `tea` selon les préférences
  • Gestion sécurisée via tokens et variables d'environnement
  • Opérations CRUD complètes sur issues, pull requests et dépôts

Limites

  • Nécessite que l'utilisateur fournisse un token API et l'URL de l'instance Gitea
  • Dépend de la disponibilité de `curl` ou `tea` sur l'environnement d'exécution
  • Les limites de taux de l'API Gitea peuvent restreindre l'automatisation intensive
Quand l'utiliser

Utilisez ce skill lorsque vous devez automatiser des tâches de gestion de projet sur une instance Gitea auto-hébergée (création de dépôts, suivi de tickets, revue de code).

Quand l'éviter

Ne l'utilisez pas si vous travaillez avec GitHub, GitLab ou d'autres services Git qui nécessitent des API différentes, ou si l'utilisateur ne dispose pas d'un accès API approprié.

Analyse de sécurité

Sûr
Score qualité90/100

The skill provides legitimate instructions for interacting with the Gitea API using curl and tea CLI. It advises against hardcoding tokens and recommends using environment variables. No destructive or exfiltrating actions are described.

Aucun point d'attention détecté

Exemples

Create a new repository
Create a new private repository named 'my-project' on my Gitea instance at https://gitea.mydomain.com with a description 'My new project'.
List open issues
List all open issues in the repository 'my-org/my-repo' on Gitea.
Create a pull request
Create a pull request from branch 'feature-x' to 'main' in repository 'my-org/my-repo' with title 'Add feature X' and description 'This PR adds feature X.'

name: gitea description: Interact with Gitea (self-hosted Git service) using the Gitea API. Use when working with Gitea repositories, issues, pull requests, or API operations. allowed-tools: Bash, Read, Write, Grep, Glob

Gitea Integration

This skill helps you interact with Gitea, a self-hosted Git service, using its API and CLI tools.

Prerequisites

Before using Gitea API commands, ensure:

  1. Gitea instance URL is known
  2. API token is available (can be created in Gitea Settings > Applications > Generate New Token)
  3. curl or tea (Gitea CLI) is installed

Common Operations

Repository Management

List Repositories

curl -H "Authorization: token YOUR_TOKEN" \
  https://gitea.example.com/api/v1/user/repos

Create Repository

curl -X POST -H "Authorization: token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"repo-name","description":"Repo description","private":false}' \
  https://gitea.example.com/api/v1/user/repos

Get Repository Info

curl -H "Authorization: token YOUR_TOKEN" \
  https://gitea.example.com/api/v1/repos/OWNER/REPO

Issue Management

List Issues

curl -H "Authorization: token YOUR_TOKEN" \
  https://gitea.example.com/api/v1/repos/OWNER/REPO/issues

Create Issue

curl -X POST -H "Authorization: token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Issue title","body":"Issue description"}' \
  https://gitea.example.com/api/v1/repos/OWNER/REPO/issues

Update Issue

curl -X PATCH -H "Authorization: token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"state":"closed"}' \
  https://gitea.example.com/api/v1/repos/OWNER/REPO/issues/ISSUE_NUMBER

Pull Request Management

List Pull Requests

curl -H "Authorization: token YOUR_TOKEN" \
  https://gitea.example.com/api/v1/repos/OWNER/REPO/pulls

Create Pull Request

curl -X POST -H "Authorization: token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"PR title","head":"feature-branch","base":"main","body":"PR description"}' \
  https://gitea.example.com/api/v1/repos/OWNER/REPO/pulls

Merge Pull Request

curl -X POST -H "Authorization: token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"Do":"merge"}' \
  https://gitea.example.com/api/v1/repos/OWNER/REPO/pulls/PR_NUMBER/merge

User and Organization Management

Get Current User Info

curl -H "Authorization: token YOUR_TOKEN" \
  https://gitea.example.com/api/v1/user

List Organization Repositories

curl -H "Authorization: token YOUR_TOKEN" \
  https://gitea.example.com/api/v1/orgs/ORG_NAME/repos

Using Gitea CLI (tea)

If the tea CLI is available, you can use it for simpler commands:

# Login
tea login add --url https://gitea.example.com --token YOUR_TOKEN

# List repos
tea repos ls

# Create issue
tea issues create --title "Issue title" --body "Description"

# Create PR
tea pulls create --head feature-branch --base main --title "PR title"

# List PRs
tea pulls ls

Best Practices

  1. Security: Never hardcode API tokens. Use environment variables or ask the user for credentials.
  2. Error Handling: Always check API responses for errors before proceeding.
  3. Rate Limiting: Be mindful of API rate limits on the Gitea instance.
  4. Validation: Validate repository names, branch names, and other inputs before making API calls.

Workflow Example

When asked to create a new repository and set it up:

  1. Ask user for Gitea instance URL and verify they have an API token
  2. Create the repository using the API
  3. If requested, initialize with README or other files
  4. Set up repository settings (private/public, description, etc.)
  5. Provide the repository URL to the user

Environment Variables

Commonly used environment variables:

  • GITEA_URL: Base URL of the Gitea instance
  • GITEA_TOKEN: API token for authentication
  • GITEA_USER: Username for the Gitea instance

API Documentation

For complete API reference, refer to:

  • Gitea API Swagger docs: https://your-gitea-instance.com/api/swagger
  • Official docs: https://docs.gitea.com/api/1.20/
Skills similaires