An open API service indexing awesome lists of open source software.

https://github.com/rhoopr/kei

Photo sync engine. Parallel downloads, incremental sync, state tracking, and unattended Docker operation, all in a single binary.
https://github.com/rhoopr/kei

apple backup cli docker icloud icloud-photos photo-backup rust selfhosted

Last synced: about 2 months ago
JSON representation

Photo sync engine. Parallel downloads, incremental sync, state tracking, and unattended Docker operation, all in a single binary.

Awesome Lists containing this project

README

          


kei logo

kei: media sync engine


Sync your cloud photos and videos to local storage. Fast, resumable, runs unattended.


Rust MSRV 1.91+
License: MIT
Version
Build

Homebrew
Downloads
Docker
Pulls

- Parallel downloads with incremental sync (seconds on large libraries after the first run)
- Resumable transfers verified by size and content hash
- Watch mode, systemd integration, headless 2FA, Docker-ready
- iCloud Photos supported today. Google Takeout and Immich next.

---

> [!IMPORTANT]
> v0.13 (next release) reshapes selection and folder-structure flags. `--exclude-album NAME` becomes `--album '!NAME'`. `--library` accepts multiple values. `kei sync` with no flags now runs per-album passes plus an unfiled pass. Legacy `{album}` in `--folder-structure` auto-migrates with a warning until v0.20. Full migration guide: [docs/v0.13-migration.md](docs/v0.13-migration.md).
>
> | Flag | Default |
> |---|---|
> | `--album` | `all` |
> | `--smart-folder` | `none` |
> | `--library` | `primary` |
> | `--unfiled` | `true` |
> | `--folder-structure` | `%Y/%m/%d` |
> | `--folder-structure-albums` | `{album}` |
> | `--folder-structure-smart-folders` | `{smart-folder}` |

> [!TIP]
> Coming from `icloudpd`? The [Migration Guide](docs/migration-from-python.md) shows how to `kei sync` without re-downloading.

---

## Install

```sh
brew install rhoopr/kei/kei # Homebrew
docker pull ghcr.io/rhoopr/kei:latest # Docker
```

Pre-built binaries for macOS, Linux, and Windows are on the [Releases page](https://github.com/rhoopr/kei/releases). For Docker Compose, building from source, FreeBSD, and other install paths, see the [Install wiki page](https://github.com/rhoopr/kei/wiki/Install).

> [!IMPORTANT]
> kei can't access your photos if Advanced Data Protection is on. Turn ADP off and enable "Access iCloud Data on the Web" in your Apple ID settings. Details: [Authentication wiki](https://github.com/rhoopr/kei/wiki/Authentication#advanced-data-protection-adp).

---

## Quick start

```sh
kei sync -u you@example.com -d ~/Photos/iCloud --save-password
```

You'll be prompted for your password, then asked to approve 2FA on a trusted device. Downloads start right after. After the first run, just `kei sync` - username, directory, and password are all remembered.

For a guided walkthrough, run `kei config setup` instead.

---

## Docs

Everything lives on the [wiki](https://github.com/rhoopr/kei/wiki): full CLI reference, filtering and folder templates, watch mode, Docker Compose, credentials, troubleshooting, and more.

- [Commands](https://github.com/rhoopr/kei/wiki/Home#commands) - `sync`, `login`, `list`, `password`, `config`, `reset`, `status`, `verify`, `import-existing`
- [Configuration](https://github.com/rhoopr/kei/wiki/Configuration) - TOML file, env vars, precedence
- [Docker](https://github.com/rhoopr/kei/wiki/Docker) - Compose files and headless 2FA
- [Credentials](https://github.com/rhoopr/kei/wiki/Credentials) - keyring, encrypted file, password files and commands
- [Changelog](CHANGELOG.md)
- [How iCloud's Incremental Sync Works](https://robhooper.xyz/blog-synctoken) - deep dive on CloudKit syncTokens

---

## Contributing

Contributions welcome. Open an issue first if you're planning something big.

```sh
just gate # pre-push gate: fmt, clippy, tests, doc, audit, typos
just --list # see every recipe
```

See [CONTRIBUTING.md](CONTRIBUTING.md) and [tests/README.md](tests/README.md) for the test catalog.

## License

MIT - see [LICENSE](LICENSE)

## Acknowledgments

kei started as `icloudpd-rs`, a Rust rewrite of [icloud-photos-downloader](https://github.com/icloud-photos-downloader/icloud_photos_downloader). Thanks to the original maintainers for their reverse-engineering work.