Skip to content

codeincanada/confluence-export

Repository files navigation

Confluence Export

🚀 Interactive Confluence Export Tool v2.0 - Export Confluence pages with meaningful content, interactive page selection, and comprehensive error handling. This tool allows you to export entire Confluence spaces, including all pages and their attachments, making the content available for programmatic access and integration.

✨ Features

  • 🎯 Interactive Page Selection: Choose specific pages to export
  • 📝 Multiple Content Formats: Export as HTML, Markdown, or both
  • 📝 Blog Post Support: Export both regular pages and blog posts with independent caching
  • Smart Rate Limiting: Intelligent API rate limiting with exponential backoff
  • 📊 Progress Tracking: Real-time progress bars and detailed statistics
  • 🛡️ Error Handling: Comprehensive error reporting with retry logic
  • 📋 Export Index: Metadata and organization for exported content
  • 🔄 Attachments Support: Download page attachments with size validation
  • 🎛️ CLI Interface: Interactive and non-interactive modes
  • 🗂️ Structured Output: Organized directory structure with meaningful content
  • 🔐 Authentication Support: Uses Confluence API tokens for secure access

🚀 Quick Start

Installation

npm install

Interactive Export

npm start

This will launch the interactive CLI where you can:

  1. Browse and select specific pages to export
  2. Choose content format (HTML, Markdown, or both)
  3. Configure export options
  4. Monitor progress in real-time

📖 Detailed Documentation

For comprehensive usage instructions, see CLI-USAGE.md which covers:

  • Complete setup guide
  • Interactive vs non-interactive modes
  • All command-line options
  • Troubleshooting guide
  • Best practices and examples

For blog post export functionality, see BLOG_SUPPORT.md which covers:

  • Blog post export features
  • Content type selection
  • Independent caching system
  • Blog-specific metadata
  • Directory organization

Configuration

Copy the example environment file and update it with your credentials:

cp .env.example .env

Edit .env with your Confluence details:

CONFLUENCE_BASE_URL=https://your-domain.atlassian.net/wiki
CONFLUENCE_EMAIL=your-email@company.com
CONFLUENCE_API_TOKEN=your-api-token
SPACE_KEY=YOUR_SPACE_KEY

Usage

# Basic export
npm start

# With custom options
npm start -- --output ./my-export --concurrency 10

# Development mode with verbose output
npm start -- --dev

🛠️ CLI Options

  • -d, --dev: Enable development mode with verbose logging
  • -o, --output <dir>: Specify output directory (default: ./output)
  • -c, --concurrency <number>: Set max concurrent downloads (default: 5)

🔧 Configuration Options

Variable Description Default
CONFLUENCE_BASE_URL Your Confluence instance URL Required
CONFLUENCE_EMAIL Your Atlassian account email Required
CONFLUENCE_API_TOKEN Your API token Required
SPACE_KEY The space key to export Required
OUTPUT_DIR Output directory ./output
MAX_CONCURRENCY Max concurrent downloads 5
RETRY_ATTEMPTS Number of retry attempts 3
MAX_FILE_SIZE Max file size in bytes 104857600 (100MB)

🔄 Use Cases

1. Documentation Migration

  • Confluence to GitBook: Export content for migration to GitBook or similar platforms
  • Confluence to Notion: Prepare content for import into Notion workspaces
  • Legacy System Migration: Extract content from old Confluence instances for new systems

2. Content Analysis & Search

  • Search Indexing: Create custom search indexes across all documentation
  • Content Analytics: Analyze documentation patterns, update frequency, and usage
  • Knowledge Graph: Build relationships between pages and topics

3. API Development

  • Documentation APIs: Serve Confluence content through REST APIs
  • Mobile Apps: Provide documentation content to mobile applications
  • Chatbots: Feed documentation to AI chatbots for customer support

4. Backup & Archival

  • Offline Access: Create local copies for offline documentation access
  • Compliance: Maintain archives for regulatory or legal requirements
  • Disaster Recovery: Backup critical documentation outside Confluence

5. Integration & Automation

  • CI/CD Documentation: Automatically update deployment documentation
  • Monitoring Dashboards: Display documentation status and metrics
  • Workflow Automation: Trigger processes based on documentation changes

6. Content Syndication

  • Multi-Platform Publishing: Distribute content across multiple platforms
  • External Portals: Share documentation with external stakeholders
  • Developer Portals: Create developer documentation sites

7. Analytics & Reporting

  • Documentation Health: Track documentation completeness and freshness
  • Team Productivity: Monitor documentation contribution patterns
  • Content Audits: Identify outdated or missing documentation

🛠️ Development

Running Tests

npm test

Linting

npm run lint

Formatting

npm run format

📄 License

This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published