Your one-stop CLI tool for backing up Immich albums like a pro.
Built for Bun, powered by SQLite, and polished for the modern dev. Automate it, test it, or just vibe with it.
Here's what you're getting out of the box:
- π Auth with Immich API (API key powered)
- π Download all albums or get picky with filters
- π§ Resume failed downloads like nothing happened
- π§Ύ Keep track of downloaded stuff via local SQLite
- π§ͺ Validate your files with checksum before wasting bandwidth
- π§± Mirror Immich album folder structure
- π¦ Override existing files with
--force(only if you mean it) - π― Filter albums with
--onlyor--exclude - π¬ Fully interactive CLI with Inquirer prompts
- π Cross-platform magic (macOS, Linux, Windows)
Requires Bun 1.2+.
git clone https://github.com/zckyachmd/immich-album-downloader.git
cd immich-album-downloader
bun installRun without .env in an interactive terminal to start the setup wizard, or copy the example file and fill in your values:
cp .env.example .envExisting .env files and env var names continue working. CLI flags override saved config for that run.
Required configuration:
IMMICH_BASE_URL- Your Immich server URLIMMICH_API_KEY- Your Immich API key
Optional configuration (all can be overridden via CLI arguments):
DEFAULT_OUTPUT- Default download directory (override with--outputor-o)IMMICH_CONCURRENCY- Concurrent downloads (override with--concurrencyor-c)IMMICH_MAX_RETRIES- Max retries (override with--max-retriesor-r)IMMICH_DOWNLOAD_TIMEOUT- Download timeout in milliseconds (5000-600000, default: 30000)IMMICH_RATE_LIMIT_REQUESTS- API rate limit requests per windowIMMICH_RATE_LIMIT_WINDOW_MS- Rate limit time window in millisecondsIMMICH_SSL_VERIFY- SSL verification (set tofalsefor self-signed certs)
π‘ Tip: Priority: CLI flags >
.env/ process env > interactive prompt > optional defaults. API keys are never printed.π See
.env.examplefor complete documentation of all configuration options.
Local installation:
bun run download # Interactive mode - select albums
bun run download:all # Download all albums (quick start)Docker (using pre-built image from GitHub Container Registry):
# Create .env file with your configuration
cp .env.example .env
# Edit .env with your Immich server details
# Run interactive mode
docker run --rm -it \
--env-file .env \
-v "$(pwd)/downloads:/downloads" \
-v "$(pwd)/data:/app/data" \
ghcr.io/zckyachmd/immich-album-downloader:latest
# Or download all albums
docker run --rm \
--env-file .env \
-v "$(pwd)/downloads:/downloads" \
-v "$(pwd)/data:/app/data" \
ghcr.io/zckyachmd/immich-album-downloader:latest --allBuild locally (alternative):
docker build -t ghcr.io/zckyachmd/immich-album-downloader:latest .π‘ Tip: Logs go to the console and
data/immich-album-downloader.log. No surprises.π‘ Tip: See USAGE.md for complete Docker usage guide.
π‘ Tip: Most CLI options have short aliases:
-afor--all(download all)-Rfor--resume-failed(resume)-dfor--dry-run(preview)-vfor--verbose(detailed logging)See USAGE.md for complete documentation of all aliases.
- USAGE.md - Complete usage guide with CLI options, examples, and advanced features
- LICENSE.md - License information
- SECURITY.md - Security best practices and guidelines
-
It talks to your Immich server using your API key
-
It fetches albums and assets, filters them based on your flags
-
For each asset, it checks:
- Does the file already exist?
- Does the checksum match?
- Did we already mark this asset as downloaded in SQLite?
-
If yes β skip
-
If no β download it, verify it, log it, move on
All files are downloaded to folders that match your Immich album names β no weird nesting.
Run tests with:
bun testRun tests in watch mode:
bun run test:watchGenerate coverage report:
bun run test:coverageSee SECURITY.md for security best practices and guidelines.
Key security features:
- β Environment variable validation
- β Path traversal protection
- β Secure file permissions
- β Log sanitization
- β HTTPS validation
- β Rate limiting
- β Input validation
- β Health checks
Crafted with caffeine & code by zckyachmd
Massive respect to the Immich project for making this even possible π
This tool is unofficial. It's not affiliated with Immich.
Your API key and photos stay on your machine β scout's honor.
This project is licensed under the MIT License - see the LICENSE.md file for details.