Skip to content

DOCX Export

Export Confluence pages to Microsoft Word (DOCX) format using customizable templates.

  • Authenticated profile (atlcli auth login)
  • Space permission: View permission on pages to export
  • Word-compatible template file (.docx or .docm)
Terminal window
# Export a page using a template
atlcli wiki export 12345678 --template corporate --output ./report.docx
# Export using space:title format
atlcli wiki export "DOCS:Architecture Overview" -t report -o ./arch.docx
FormatExampleDescription
Page ID12345678Numeric Confluence page ID
Space:TitleDOCS:My PageSpace key and page title
URLhttps://...Full Confluence page URL
OptionDescription
--template, -tTemplate name or path (required)
--output, -oOutput file path (required)
--no-imagesDon’t embed images from attachments
--include-childrenInclude child pages in export
--no-mergeKeep children as separate array for template loops
--no-toc-promptDisable TOC update prompt in Word
--profileUse a specific auth profile

Templates are resolved in order (first match wins):

  1. Direct file path (if exists)
  2. Project: .atlcli/templates/confluence/<name>.docx
  3. Profile: ~/.atlcli/profiles/<profile>/templates/confluence/<name>.docx
  4. Global: ~/.atlcli/templates/confluence/<name>.docx

atlcli supports both .docx and .docm (macro-enabled) templates.

Terminal window
# List available templates
atlcli wiki export template list
# Save a template
atlcli wiki export template save corporate --file ./template.docx --level global
# Delete a template
atlcli wiki export template delete old-template --confirm
LevelLocationUse Case
project.atlcli/templates/confluence/Project-specific templates
profile~/.atlcli/profiles/<name>/templates/confluence/Instance-specific templates
global~/.atlcli/templates/confluence/Shared across all projects

When a Confluence page contains a :::toc macro, it’s converted to a Word-native TOC field:

:::toc
:::

The exported TOC:

  • Uses Word’s built-in TOC functionality
  • Includes heading levels 1-3 with hyperlinks
  • Shows placeholder text until updated in Word

By default, Word prompts to update fields when opening the document:

“This document contains fields that may refer to other files. Do you want to update the fields in this document?”

Click Yes to populate the TOC with correct entries and page numbers.

Use --no-toc-prompt to disable the update prompt:

Terminal window
atlcli wiki export 12345 -t report -o out.docx --no-toc-prompt

When using this option:

  • Word opens without prompting
  • TOC shows placeholder text
  • Update manually: right-click TOC, select “Update Field”

Templates use Jinja2 syntax. Available variables:

VariableDescription
{{ title }}Page title
{{ content }}Page content (as Word subdocument)
{{ pageId }}Confluence page ID
{{ pageUrl }}Full page URL
{{ tinyUrl }}Short page URL
VariableDescription
{{ author }}Creator’s display name
{{ authorEmail }}Creator’s email
{{ modifier }}Last modifier’s display name
{{ modifierEmail }}Last modifier’s email
VariableDescription
{{ created }}Creation date (ISO format)
{{ modified }}Last modified date (ISO format)
{{ exportDate }}Export timestamp

Use the date filter for formatting: {{ modified | date('YYYY-MM-DD') }}

VariableDescription
{{ spaceKey }}Space key (e.g., “DOCS”)
{{ spaceName }}Space name
{{ spaceUrl }}Space URL
VariableDescription
{{ labels }}List of page labels
{{ attachments }}List of attachments
{{ children }}Child pages (with --include-children --no-merge)
Terminal window
atlcli wiki export 12345678 --template basic --output ./page.docx
Terminal window
# Merge children into single document
atlcli wiki export 12345 -t book -o book.docx --include-children
# Keep children separate for template loops
atlcli wiki export 12345 -t book -o book.docx --include-children --no-merge
Terminal window
atlcli wiki export 12345 -t report -o report.docx --no-images
Terminal window
atlcli wiki export 12345 -t report -o report.docx --no-toc-prompt

atlcli supports templates created for Scroll Word Exporter. Scroll placeholders ($scroll.title, $scroll.content, etc.) are automatically converted to the equivalent atlcli variables.

  • Ensure the template is a valid .docx or .docm file
  • Check that the template was created in Word 2007 or later
  • Try opening the template itself to verify it’s not corrupted
  • Click inside the TOC
  • Right-click and select “Update Field”
  • Choose “Update entire table”
  • Verify images are attached to the Confluence page
  • Check that --no-images flag is not set
  • Embedded images use the template’s image placeholder styling
  • Pages - Page operations and finding page IDs
  • Attachments - Managing page attachments for export
  • Templates - Page templates (different from export templates)
Jira and Confluence are trademarks of Atlassian Corporation Plc. atlcli is not affiliated with, endorsed by, or sponsored by Atlassian.