Forgejo Sync Manager CLI

Command-line tool for batch synchronization of Forgejo repositories to local machine

Token authentication, update detection, progress tracking.


CLI tool for batch synchronization of Forgejo repositories to local machine.

  • Automatic authentication via personal access token
  • Repository cloning and updating with progress tracking
  • Update detection via commit hash comparison
  • Full repository recloning option
  • Parallel progress display for large repository sets
  • Persistent configuration storage

git clone https://github.com/smartlegionlab/forgejo-sync-manager-cli.git
cd forgejo-sync-manager-cli
python -m venv venv
source venv/bin/activate
python app.py

Run:

python app.py

Configuration (first run):

  • Server URL (e.g., http://localhost:3000)
  • Personal access token with read:repository and read:user scopes

Configuration stored in ~/forgejo-sync-manager/config.json

Main Menu

  • 1 — Display user information
  • 2 — Repository operations
  • 3 — Settings (full reset)
  • 4 — About (author, repository, license, disclaimer)
  • 0 — Exit

Repository Menu

  • 1 — Show statistics (total, public, private, forks)
  • 2 — List all repositories with names, types, and sizes
  • 3 — Check for updates (compares local and remote commit hashes)
  • 4 — Sync all repositories (clone missing, pull existing)
  • 5 — Reclone all repositories (delete and fresh clone)
  • 0 — Back to main menu

  • Authentication: Token-based authentication via Forgejo API
  • Repository Discovery: Fetches complete repository list with pagination (50 per page)
  • Update Detection: For each existing repository, executes git fetch and compares HEAD with FETCH_HEAD
  • Sync Operations: Uses authenticated URLs with embedded token for Git operations
  • Directory Structure: ~/forgejo-sync-manager/{username}/repositories/

  • Language: Python 3.8+
  • Core Library: forgejo-sync-manager-core
  • HTTP: requests
  • Platform: Linux / macOS / Windows
  • License: BSD 3-Clause

  • forgejo-sync-manager-core — Universal core library for Forgejo repository synchronization
  • requests — HTTP library for Python

Python CLI Forgejo Linux Git