Skip to main content

gog-cli

CI PyPI Python License: MIT Ruff

gog is a Python CLI for backing up a user's owned DRM-free GOG game library.

It is focused on safe, scriptable workflows:

  • list owned games with filtering and fuzzy search
  • plan and execute backups to a local directory
  • preserve metadata needed to audit and restore backups
  • download installers and related files with resumable behavior
  • verify downloaded files when checksums are available

Install

Requires Python 3.12 or newer.

pip install gog-cli

To install the latest development version directly from GitHub:

pip install git+https://github.com/aleksandarristic/gog-cli.git

Development

python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e ".[dev]"
python -m pytest

Run the CLI locally:

gog --help
gog list
gog plan --destination /path/to/backups --all --summary
gog backup --destination /path/to/backups --games-from games.txt --dry-run

Roadmap

See docs/TODO.md for planned features and improvements.

Reference

Basic Workflow

gog auth login
gog refresh
gog list purchased
gog plan --destination /path/to/backups --all --storage --check-free-space
gog backup --destination /path/to/backups --all --yes
gog list backed-up --destination /path/to/backups
gog sync --destination /path/to/backups --all --yes

gog refresh updates the local purchased-library and download-metadata caches. It does not download game installers. Run it before browsing or filtering newly added library metadata.

Browsing Purchased Games

gog list purchased reads the local cache written by gog refresh; it does not contact GOG. Human output includes ID, title, release year, genre/category, and platforms when those fields are available. JSON output also includes scriptable metadata such as owned, release_date, genres, and is_installable.

Examples:

gog list purchased
gog list purchased --format json
gog list purchased --search witcher
gog list purchased --search "baldurs gate"
gog list purchased --platform windows
gog list purchased --platform linux --search ftl
gog list purchased --year 1998..2005
gog list purchased --year 2010..2020 --include-unknown-year
gog list purchased --genre strategy
gog list purchased --genre arcade,rts
gog list purchased --genre strategy --include-unknown-genre
gog list purchased --search "baldurs gate" --platform linux --format json

Year filters omit games with unknown years by default; use --include-unknown-year to keep them. Genre filters similarly omit unknown genres by default; use --include-unknown-genre to keep those rows.

Planning Backups

gog plan shows the same dry-run plan as gog backup --dry-run without downloading files or creating backup directories. Use it before long backup runs to estimate size, inspect filters, and check destination free space.

Examples:

gog plan --destination /path/to/backups --all
gog plan --destination /path/to/backups --all --summary
gog plan --destination /path/to/backups --all --storage
gog plan --destination /path/to/backups --all --check-free-space
gog plan --destination /path/to/backups --all --format json
gog plan --destination /path/to/backups cyberpunk_2077

Platform and language filters can reduce backup size:

gog plan --destination /path/to/backups --all --platform linux --storage
gog plan --destination /path/to/backups --all --platform windows --language en --storage

Selecting Games

Game selectors can be product IDs, slugs, or exact titles. Commands that select games accept repeated --game flags:

gog plan --destination /path/to/backups --game witcher_3 --game cyberpunk_2077
gog backup --destination /path/to/backups --game 123456789 --yes

For larger curated lists, put selectors in a UTF-8 text file and pass --games-from. Blank lines and lines whose first non-whitespace character is # are ignored.

Example games.txt:

# first NAS batch
witcher_3
cyberpunk_2077
123456789

Use the selector file in plan, backup, or sync workflows:

gog plan --destination /path/to/backups --games-from games.txt --storage
gog backup --destination /path/to/backups --games-from games.txt --downloader aria2c --yes
gog sync --destination /path/to/backups --games-from games.txt --dry-run

--games-from is repeatable and combines with repeated --game flags. Do not combine explicit game selectors with --all.

Downloading

gog backup defaults to the built-in direct downloader. To use aria2c, install aria2c and pass --downloader aria2c on an executing backup run:

gog backup --destination /path/to/backups --games-from games.txt --downloader aria2c --yes

When file size metadata is available, gog chooses aria2c connection settings by size: very small files use one connection, mid-size files use two or four, and multi-GB installers use eight or sixteen. Configure aria2c_policy = "conservative" or aria2c_policy = "aggressive" to tune this behavior.

Without --yes, backup and sync commands print a dry-run plan and exit without downloading or modifying backup files.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gog_cli-0.3.1.tar.gz (67.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gog_cli-0.3.1-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file gog_cli-0.3.1.tar.gz.

File metadata

  • Download URL: gog_cli-0.3.1.tar.gz
  • Upload date:
  • Size: 67.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gog_cli-0.3.1.tar.gz
Algorithm Hash digest
SHA256 00b42a72c424ea0557e5e37e199f645d4ec457a0f27aa9996d87e4cfd8b1110f
MD5 8a5075d0180e5435621b48cd11a2b3e8
BLAKE2b-256 b1ae78d0c789f7efba2ee611df7f124e1fce4dec62eb31e369d8ac157d3bbb30

See more details on using hashes here.

Provenance

The following attestation bundles were made for gog_cli-0.3.1.tar.gz:

Publisher: release.yml on aleksandarristic/gog-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gog_cli-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: gog_cli-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 47.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gog_cli-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e9bb5adced47a2c2917269f7c56c3d3bac020669bbe2b0497bf0ed3c66d3c0d
MD5 6d84966f4d15b6703735f0e3f39a189a
BLAKE2b-256 f034462a5152d9171f8dfdb6bb2887c73273c6cf37622b965402f469980703d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for gog_cli-0.3.1-py3-none-any.whl:

Publisher: release.yml on aleksandarristic/gog-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page