A command-line tool to export all your locally stored books from Apple Books to any directory on macOS.
- 🚀 Fast bulk export of all your Apple Books library
- 📚 Preserves original formats (EPUB, PDF)
- 🏷️ Clean filenames using book titles
- 🗂️ Automatic EPUB handling - converts EPUB directories to proper .epub files
- 🎯 Smart file detection - finds books in multiple storage locations
- 🔍 Verbose mode for detailed progress tracking
- 🧪 Dry run mode to preview what will be exported
- ⚡ Progress indicators during export
- macOS with Apple Books installed
- Books must be downloaded locally (not just stored in iCloud)
- Command line access
# Download and install
curl -L https://github.com/jonnyace/apple-books-exporter/raw/main/export-books -o /usr/local/bin/export-books
chmod +x /usr/local/bin/export-books
# Or install to your local bin directory
curl -L https://github.com/jonnyace/apple-books-exporter/raw/main/export-books -o ~/.local/bin/export-books
chmod +x ~/.local/bin/export-books-
Download the script:
git clone https://github.com/jonnyace/apple-books-exporter.git cd apple-books-exporter -
Make it executable:
chmod +x export-books
-
(Optional) Copy to your PATH:
cp export-books /usr/local/bin/
Export all books to default location (~/Desktop/Exported_Books):
export-books# Export to custom directory
export-books --output ~/Documents/MyBooks
# Export with verbose progress
export-books --verbose --output /Volumes/External/Books
# Preview what would be exported (dry run)
export-books --dry-run
# Show help
export-books --help| Option | Description |
|---|---|
-o, --output DIR |
Output directory (default: ~/Desktop/Exported_Books) |
-v, --verbose |
Show detailed progress information |
-h, --help |
Show help message |
--version |
Show version information |
--dry-run |
Preview export without copying files |
The tool works by:
- Reading Apple Books database - Accesses the SQLite database where Apple Books stores metadata
- Finding local files - Locates actual book files in various Apple Books storage locations:
~/Library/Containers/com.apple.BKAgentService/Data/Documents/iBooks/Books/~/Library/Mobile Documents/iCloud~com~apple~iBooks/Documents/
- Processing files - Handles different formats appropriately:
- EPUB directories: Zipped into proper .epub files
- PDF files: Copied directly
- Clean naming - Uses book titles for filenames, sanitized for filesystem compatibility
$ export-books --verbose
[INFO] Found 1,234 books with local files
[INFO] Exporting books to: /Users/username/Desktop/Exported_Books
[1/1234] Zipping: Example Book Title
[2/1234] Copying: Another Book.pdf
[3/1234] Zipping: Sample Novel
...
[SUCCESS] Export completed successfully!
[SUCCESS] All 1,234 books exported to: /Users/username/Desktop/Exported_Books- Make sure Apple Books is installed and has been opened at least once
- Ensure you're running on macOS
- Your books might only exist as metadata (not downloaded)
- Download books locally in Apple Books first
- Check if books are stored in iCloud but not synced locally
- Close Apple Books before running the export
- Check file permissions
# If you get permission errors, try:
sudo chown -R $(whoami) ~/Desktop/apple-books-exporter- Books with local files (.epub directories, .pdf files)
- Both purchased and manually imported books
- Books stored in Apple Books containers
- Books in iCloud Documents (if synced locally)
- Books that exist only as metadata (not downloaded)
- Sample books
- Audiobooks (different storage system)
- Books removed but with remaining metadata
- This tool only reads your local Apple Books database and files
- No data is transmitted anywhere
- All operations are performed locally on your machine
- The tool is read-only - it never modifies your Apple Books library
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.
- Initial release
- Basic export functionality
- EPUB and PDF support
- Verbose and dry-run modes
- Cross-platform file detection
Created by @jonnyace
If you encounter issues:
- Check the troubleshooting section
- Run with
--verboseflag for detailed output - Open an issue on GitHub with the error details
Star this repo if it helped you! ⭐