gitea-cli/README.md

53 lines
1.3 KiB
Markdown
Raw Normal View History

2025-01-22 15:01:20 +00:00
# Gitea CLI
A command line interface for interacting with Gitea servers.
## Installation
1. Clone this repository
2. Install dependencies:
```bash
pip install -r requirements.txt
```
## Configuration
You can configure the Gitea CLI in two ways:
2025-01-22 15:01:20 +00:00
### 1. Environment Variables
Set the following environment variables:
```bash
export GITEA_URL=https://your-gitea-instance.com
export GITEA_TOKEN=your_access_token
```
### 2. Command Line Arguments
Alternatively, provide the configuration via command line arguments:
```bash
python gitea_cli.py create-repo --gitea-url https://your-gitea-instance.com --gitea-token your_access_token --name my-repo
2025-01-22 15:01:20 +00:00
```
To get an access token:
1. Log into your Gitea instance
2. Go to Settings > Applications
3. Generate a new token
## Usage
### Create a new repository:
```bash
python gitea_cli.py create-repo --name my-repo --description "My new repository" --private
```
### Create a repository and set it as remote:
If you're in a git repository and want to create a new Gitea repository and set it as the remote origin:
```bash
python gitea_cli.py create-repo --name my-repo --description "My new repository" --set-remote
```
This will:
1. Create a new repository on Gitea
2. Check if the current directory is a git repository
3. Remove any existing 'origin' remote
4. Add the new Gitea repository as 'origin'