gitea-cli
Go to file
Steve White 6b04b192d6 Updated to use environment variables if present, with manual overrides 2025-01-22 09:16:10 -06:00
.env.example Initial Commit 2025-01-22 09:01:20 -06:00
.gitignore Initial Commit 2025-01-22 09:01:20 -06:00
README.md Updated to use environment variables if present, with manual overrides 2025-01-22 09:16:10 -06:00
gitea_cli.py Updated to use environment variables if present, with manual overrides 2025-01-22 09:16:10 -06:00
requirements.txt Updated to use environment variables if present, with manual overrides 2025-01-22 09:16:10 -06:00

README.md

Gitea CLI

A command line interface for interacting with Gitea servers.

Installation

  1. Clone this repository
  2. Install dependencies:
    pip install -r requirements.txt
    

Configuration

You can configure the Gitea CLI in two ways:

1. Environment Variables

Set the following environment variables:

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:

python gitea_cli.py create-repo --gitea-url https://your-gitea-instance.com --gitea-token your_access_token --name my-repo

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:

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:

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'