Search by

piotrpress / github-backup

PiotrPress

CLI tool for bulk downloading GitHub repositories as ZIP archives.

Package info

github.com/PiotrPress/github-backup

pkg:composer/piotrpress/github-backup

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-10-30 22:13 UTC

This package is auto-updated.

Last update: 2026-10-30 22:19:56 UTC


README

CLI tool for bulk downloading GitHub repositories as ZIP archives.

Usage

php gb <directory> [-o|--owner OWNER] [-p|--pattern PATTERN]

or via Docker:

./bin/run <directory> [-o|--owner OWNER] [-p|--pattern PATTERN]

Arguments

  • directory - Directory where the repositories will be backed up. If the directory does not exist, it will be created.

Options

  • -o|--owner OWNER - GitHub owner (user or organization) of the repositories to backup. If not specified, backup will be performed for all repositories of the authenticated user.
  • -p|--pattern PATTERN - Pattern to filter repositories by name. If not specified, all repositories will be backed up.

Description

GithubBackup is a PHP command-line application that downloads GitHub repositories as ZIP archives. It lists repositories accessible to the authenticated user, optionally filters them by owner and repository name, and saves each archive under <directory>/<owner>/<repository>/ with a UTC timestamp in its filename.

Downloads are streamed to disk and incomplete archives are removed if a download fails. Each run creates a new archive, making the tool suitable for periodic execution with an external scheduler such as cron.

ZIP archives contain a snapshot of the repository's default branch, not its Git history, other branches, or tags.

Development

./bin/dev

Requirements

export GITHUB_TOKEN=<your_token>

or for Docker:

  • Docker 24.0 or higher. Run the container with the token in .env file:
GITHUB_TOKEN=<your_token>