A powerful command-line tool to export Confluence pages to multiple formats (Markdown, HTML, Text, PDF) with support for bulk exports, parallel fetching, and recursive child page fetching.
📖 New to this tool? Check out the User Guide for detailed instructions, examples, and troubleshooting.
- Multiple Export Formats: Export pages to Markdown, HTML, plain text, or PDF
- Bulk Export: Export multiple pages at once with parallel fetching
- Recursive Export: Automatically include all child pages with
--include-children - Space Export: Export entire Confluence spaces with
--space - Flexible Input: Accept page IDs, full URLs, or read from a file
- Parallel Processing: Fast exports with configurable worker threads
- Progress Display: Beautiful progress bars and status updates with Rich
- Export Manifest: Generate an index of all exported pages
- Configuration Files: Save settings in
.confluence-export.toml - Flexible Output: Choose between flat or hierarchical folder structures
pip install confluence-export# Clone the repository
git clone https://github.com/adriandarian/confluence-export.git
cd confluence-export
# Install the package
pip install -e .- Go to Atlassian API Tokens
- Click "Create API token"
- Copy the generated token
# Option 1: Environment variables (recommended)
export CONFLUENCE_BASE_URL=https://yoursite.atlassian.net
export [email protected]
export CONFLUENCE_API_TOKEN=your-api-token
# Option 2: Create a .env file
echo "CONFLUENCE_BASE_URL=https://yoursite.atlassian.net" >> .env
echo "[email protected]" >> .env
echo "CONFLUENCE_API_TOKEN=your-api-token" >> .env# Export using a full Confluence URL
confluence-export --pages "https://yoursite.atlassian.net/wiki/spaces/DOCS/pages/123456789/My+Page"
# Export multiple pages
confluence-export --pages 123456 789012 --format markdown html
# Export from a file containing URLs/IDs
confluence-export --pages-file pages.txt --format markdown
# Export an entire space
confluence-export --space DOCS --format markdown --output ./backupFull Confluence URLs are automatically parsed:
confluence-export --pages "https://mysite.atlassian.net/wiki/spaces/DOCS/pages/123456789/My+Page+Title"The numeric ID from the URL:
confluence-export --pages 123456789Create a file with URLs or IDs (one per line):
# pages.txt - Lines starting with # are comments
https://mysite.atlassian.net/wiki/spaces/DOCS/pages/123/Overview
# Page IDs work too
456789
# Comma-separated on one line
111222, 333444
confluence-export --pages-file pages.txtconfluence-export --pages 123456 --pages-file more-pages.txt| Format | Flag | Description |
|---|---|---|
| Markdown | --format markdown or md |
Clean Markdown with Confluence macro support |
| HTML | --format html |
Standalone HTML with embedded CSS |
| Text | --format txt or text |
Plain text (great for search/archival) |
--format pdf |
Native Confluence PDF export |
Export to multiple formats at once:
confluence-export --pages 123456 --format markdown html pdfSpeed up large exports with parallel workers:
confluence-export --pages-file pages.txt --workers 8Generate an index of all exported pages:
confluence-export --pages 123456 --include-children --manifestCreates INDEX.md and manifest.json in the output directory.
Save your settings to avoid repeating them:
# Save current settings
confluence-export --base-url https://mysite.atlassian.net \
--email [email protected] \
--output ./exports \
--format markdown html \
--save-config
# Now just run with pages
confluence-export --pages 123456Configuration file (.confluence-export.toml):
[auth]
base_url = "https://mysite.atlassian.net"
email = "[email protected]"
[pages]
file = "pages.txt" # Default pages file
[export]
output = "./exports"
formats = ["markdown", "html"]
include_children = true
manifest = true
[advanced]
workers = 8Recursively export all descendants:
confluence-export --pages 123456 --include-childrenHierarchical (default):
exports/
├── Parent-Page-123.md
└── Parent-Page/
├── Child-Page-456.md
└── Child-Page/
└── Grandchild-789.md
Flat (--flat):
exports/
├── Parent-Page-123.md
├── Child-Page-456.md
└── Grandchild-789.md
Authentication:
--base-url URL Confluence site URL
--email EMAIL Atlassian account email
--token TOKEN Atlassian API token
Page Selection:
--pages PAGE [PAGE ...] Page IDs or URLs (space-separated)
--pages-file FILE File with page IDs/URLs (one per line)
--space SPACE_KEY Export all pages from a space
--include-children Recursively export child pages
Export Options:
--format FORMAT [...] Export format(s): markdown, html, txt, pdf
--output, -o DIR Output directory (default: ./confluence-exports)
--flat Flat file structure (no folders)
--manifest Generate INDEX.md and manifest.json
Advanced Options:
--workers, -w N Parallel workers (default: 4)
--skip-errors Skip failed pages (default: True)
--no-skip-errors Stop on first error
--verbose, -v Verbose output
--quiet, -q Suppress output except errors
Configuration:
--config, -c FILE Config file path (auto-detected)
--save-config [FILE] Save settings to config file
--no-config Ignore config files
confluence-export \
--space DOCS \
--format markdown html pdf \
--include-children \
--manifest \
--output "./backup-$(date +%Y%m%d)" \
--workers 8confluence-export \
--pages "https://mysite.atlassian.net/wiki/spaces/DOCS/pages/123/Getting+Started" \
--include-children \
--format markdown \
--manifest \
--output ./docsconfluence-export --pages 123456 -o ./- Verify your API token at Atlassian API Tokens
- Ensure you're using the email associated with your Atlassian account
- Check that your base URL is correct (should be
https://yoursite.atlassian.net)
- Verify the page ID or URL is correct
- Ensure you have permission to view the page
- Check if the page is in a restricted space
The tool automatically handles rate limiting with exponential backoff. Large exports may temporarily slow down.
PDF export requires additional permissions in Confluence. Ensure your account has export permissions.
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run linter
ruff check .
# Format code
ruff format .The wheel package can be installed via pip and requires Python to be installed:
# Install build tools
pip install build wheel
# Build wheel package
python -m build --wheel
# The wheel will be in dist/confluence_export-*.whl
# Install it with: pip install dist/confluence_export-*.whlStandalone executables don't require Python to be installed. They're perfect for users who just want to run the tool without setting up Python.
pip install pyinstallerLinux/macOS:
./scripts/build.shWindows:
scripts\build.batManual build:
pyinstaller confluence_export.spec --clean --noconfirmThe executable will be in dist/confluence-export (or dist/confluence-export.exe on Windows).
After building, users can run the executable directly:
# Linux/macOS
./dist/confluence-export --help
# Windows
dist\confluence-export.exe --helpThe project includes a GitHub Actions workflow that automatically builds:
- Wheel packages for PyPI
- Standalone executables for Linux, Windows, and macOS
The workflow triggers on version tags (e.g., v1.0.0) and creates a GitHub release with all artifacts.
MIT License - see LICENSE file for details.
- User Guide - Complete user guide with detailed examples
- Configuration Guide - Config file options and examples
- API Reference - Python API documentation
- Development Guide - Contributing and development setup
- CONTRIBUTING.md - Contribution guidelines
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.