Open Source · MIT License

Your iCloud Drive.
On Your Terms.

A powerful terminal utility to download, sync, and back up your iCloud Drive files — with resume support, differential updates, and parallel transfers.

zsh — iFetch

iCloud Wasn't Built for Bulk Downloads

Apple's iCloud Drive is seamless on Apple devices — until you need to download thousands of files, migrate between accounts, or create local backups. Native tools choke on large directories, stall mid-transfer, and offer no resume capability. iFetch fixes that.

🔴

Data Recovery

Disabled iCloud Drive? Your files are trapped in the cloud with no easy way to pull them down in bulk.

🔴

Account Migration

Switching Apple IDs means losing your Drive structure. No built-in tool to export everything at once.

🔴

Unreliable Sync

Large transfers time out, connections drop, and you're left wondering which files actually made it.

🔴

No Local Backups

Cloud-only is risky. You need an offline, version-controlled archive of your critical documents.

Engineered for Reliability

Every feature is designed around one goal: get your data from iCloud to your machine, completely and efficiently.

Parallel Downloads

Configurable worker threads (default 4) for blazing fast concurrent transfers. Saturate your bandwidth.

--max-workers=8
🔄

Differential Updates

Only changed chunks are fetched. File-level delta sync saves bandwidth and time on re-runs.

--chunk-size=2097152
⏸️

Resume Downloads

Checkpointed progress tracking. Connection dropped? Pick up exactly where you left off.

.temp + tracker files
🔐

Secure 2FA Auth

Full support for two-factor and two-step authentication. Credentials stored in your system keyring.

icloud --username=you@me.com
🗂

Profile Filters

Include/exclude glob patterns. Sync only PDFs, skip archives — personalised sync sets per profile.

--profile pdf_backup
🗄

Version History

Automatic on-disk archiving of previous file versions. Rollback any file to a prior state.

.versions/ directory
🧩

Plugin System

Drop a Python file, subclass BasePlugin, hook into auth, progress, and completion events.

plugins/ auto-discover
🤝

Shared Folders

Access and download items shared with your account. Browse shared roots with a single flag.

--list-shared
📊

Download Reports

Structured JSON summary of every session — successes, failures, bytes transferred, and changed chunks.

download_report.json

Up and Running in 3 Minutes

iFetch runs on Python 3.9+ and works on macOS, Linux, and WSL. Follow these steps to get started.

01

Create a Virtual Environment

Isolate iFetch's dependencies in a clean virtual environment.

$ python3 -m venv ivenv
$ source ivenv/bin/activate
02

Install Dependencies

Pull in the Python packages iFetch relies on.

$ pip install pyicloud tqdm requests keyring
03

Authenticate with iCloud

Store your Apple ID credentials securely in your system keyring. You'll complete 2FA once.

$ icloud --username=you@icloud.com
Enter iCloud password: ••••••••
Two-factor authentication required.
Enter verification code: 123456
✓ Authentication successful
04

Start Fetching

Point iFetch at an iCloud Drive path and a local destination. That's it.

$ python ifetch/cli.py Documents/Photos ~/Backups/Photos
======================================================================
iCloud Drive Downloader
Remote Path: Documents/Photos
Local Path: /Users/you/Backups/Photos
Parallel Workers: 4
======================================================================
Authenticating with iCloud... ✓
Downloading from 'Documents/Photos' to '~/Backups/Photos'

Command Reference

Everything is driven from the terminal. Here's the full reference.

Download Files & Folders

Recursively download any iCloud Drive path to a local directory with parallel workers, retry logic, and differential updates.

# Basic download
$ python ifetch/cli.py Documents/Photos ~/Downloads/icloud-photos

# Advanced: 8 workers, 5 retries, 2MB chunks, JSON log
$ python ifetch/cli.py Documents/Code ~/Work/Code \
    --email=you@apple.com \
    --max-workers=8 \
    --max-retries=5 \
    --chunk-size=2097152 \
    --log-file=download.log

List Directory Contents

Preview what's in an iCloud Drive directory without downloading anything.

$ python ifetch/cli.py Documents --list

Listing contents of 'Documents':
──────────────────────────────────────
📁 Photos
📁 Programming
📄 resume.pdf
📄 budget.xlsx

Shared Items

Browse and download files and folders that others have shared with your iCloud account.

$ python ifetch/cli.py --list-shared --email you@apple.com

Listing top-level shared items:
──────────────────────────────────────
📁 Team Assets
📁 Vacation Photos
📄 contract_final.pdf

Profile-Based Filtering

Define include/exclude glob patterns in a JSON profile to sync only what you need.

# ~/.ifetch_profiles.json
{
  "pdf_backup": {
    "include": ["Documents/**/*.pdf"],
    "exclude": ["Documents/Private/*"]
  }
}

$ python ifetch/cli.py Documents ~/PDFs \
    --profile pdf_backup \
    --email you@apple.com

Extend with Plugins

Drop a Python file in plugins/, subclass BasePlugin, and hook into authentication, download progress, and completion events.

# plugins/notify.py
from ifetch.plugin import BasePlugin

class Notify(BasePlugin):
    def after_download(self, remote_item, local_path, success, **kw):
        if success:
            print(f"✓ {remote_item.name} → {local_path}")

iFetch auto-discovers all plugins on startup. No configuration needed.

All CLI Flags

Flag Description Default
--emailiCloud account email (or ICLOUD_EMAIL env var)env / prompt
--max-workers NNumber of concurrent download threads4
--max-retries NRetry attempts per failed chunk (exponential backoff)3
--chunk-size BYTESByte size for each differential-download chunk1 MB
--log-file PATHPath to save structured JSON logsconsole only
--listList directory contents only (no downloads)off
--list-sharedList top-level items shared with youoff
--profile NAMEApply include/exclude patterns from profile fileno filter
--profile-file PATHCustom path to profile JSON~/.ifetch_profiles.json