This article explains how to export pages in confluence space having specific labels into PDF files using Confluence CLI.
Instructions
To export pages having a specific label
--action runFromPageList --labels "mylabels" --common " --action exportPage --id "@pageId@" --exportType "PDF" --file "@pageId@.pdf""
To export pages including subpages that have a specific label
--action runFromPageList --labels "mylabels" --common " --action exportSpace --space "@space@" --title \""@title@\"" --exportType "PDF" --file "@pageId@.pdf""
The parameters and actions used in the above command are:
runFromPageList runs actions for each page from a page list.
exportSpace exports space to a file.
exportPage exports pages to a file.
--file refers Path/name to file of result output.
--exportType indicates the type of pages export should be in.
--labels pass the required label name, here “mylabels” is passed as a label value.