Create and write to a .pages file using Terminal
A Pages document is not a simple file, but a Zip archive.
A Pages document contains much more than just plain text. A blank document is still based on a template, with a set page size and other metadata.


Creating a blank document in Pages creates this structure:



To create a Pages document programatically, use AppleScript to tell Pages to do it for you.

tell application "Pages" to ¬
  save (make new document) in file "Macintosh HD:path:to:folder:Blank.pages"


To run AppleScript from the command line, use osascript.

osascript -e 'tell application "Pages" to save (make new document) in file "Macintosh HD:path:to:folder:Blank.pages"'