Requires Rust (1.85+).
git clone https://github.com/dend/coconut.git
cd coconut
cargo build --releaseThe binary will be at ./target/release/coconut.
Coconut uses GOG's Galaxy OAuth2 flow. You authenticate once via your browser:
coconut auth loginThis opens GOG's login page. After signing in, paste the redirect URL back into the terminal. Your token is stored at ~/.config/coconut/token.json and refreshes automatically.
coconut auth status # check login state
coconut auth logout # remove stored tokencoconut library list
coconut library list --platform linuxcoconut library info "baldurs gate"Displays available downloads per platform, extras (manuals, soundtracks), and game features.
coconut library syncDownloads all installers and extras for every game in your library. Files are organized as:
~/coconut/library/
game_slug/
windows/
setup_game_1.0.exe
linux/
game_installer.sh
mac/
game_installer.pkg
extras/
manual.pdf
soundtrack.zip
.coconut-manifest.json
On first run, you'll be prompted to confirm the sync directory (default: ~/coconut/library).
coconut library sync --game "witcher" # sync a specific game
coconut library sync --platform linux # only Linux installers
coconut library sync --game "doom" --force # re-download even if presentWhen your primary disk runs out of space, provide a secondary location:
coconut library sync --sync-dir ~/coconut/library --overflow-dir /mnt/external/coconutCoconut monitors free space and automatically switches to the overflow directory when the primary drops below 1 GB. Each directory maintains its own manifest.
Coconut keeps a global download history at ~/.config/coconut/download_history.json that records every successful download. This persists even if you move or delete the downloaded files, so re-running sync won't re-download files you've already pulled.
To import entries from existing per-directory manifests (e.g., from downloads made before the history feature was added):
coconut library sync --backfill-history- Resume: Interrupted downloads resume from where they left off via
.partfiles and HTTP Range headers. - Retries: Failed downloads are retried up to 10 times automatically.
- Stall detection: If no data arrives for 60 seconds, the download is restarted.
- Token refresh: Expired tokens are refreshed transparently on 401 responses.
Contributions are welcome! Please see CONTRIBUTING.md for details.
This project is licensed under the MIT License. See LICENSE for details.