45 lines
1.0 KiB
Markdown
45 lines
1.0 KiB
Markdown
|
# 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
|
||
|
|
||
|
Create a `.env` file in the project root with your Gitea credentials:
|
||
|
|
||
|
```env
|
||
|
GITEA_URL=https://your-gitea-instance.com
|
||
|
GITEA_TOKEN=your_access_token
|
||
|
```
|
||
|
|
||
|
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'
|