Steve White 6b04b192d6 | ||
---|---|---|
.env.example | ||
.gitignore | ||
README.md | ||
gitea_cli.py | ||
requirements.txt |
README.md
Gitea CLI
A command line interface for interacting with Gitea servers.
Installation
- Clone this repository
- 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:
- Log into your Gitea instance
- Go to Settings > Applications
- 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:
- Create a new repository on Gitea
- Check if the current directory is a git repository
- Remove any existing 'origin' remote
- Add the new Gitea repository as 'origin'