Skip to content

command create

zmworm edited this page Mar 31, 2026 · 23 revisions

create

Create a blank Office document.

Synopsis

officecli create <file> [--type <type>]

Description

Creates a new blank Office document at the specified path. The document type is inferred from the file extension, or can be explicitly specified with --type. If the file has no extension but --type is provided, the appropriate extension is appended automatically.

The created document contains the minimal required structure:

  • DOCX: Document with an empty body
  • XLSX: Workbook with one sheet ("Sheet1") containing empty sheet data
  • PPTX: Presentation with a slide master, theme, and 4 slide layouts

Arguments

Name Type Required Default Description
file string Yes - Output file path (.docx, .xlsx, or .pptx)

Options

Name Type Required Default Description
--type string No inferred from extension Document type: docx, xlsx, or pptx
--json bool No false Output result as JSON envelope

Examples

# Create a blank Word document
officecli create report.docx

# Create a blank Excel spreadsheet
officecli create data.xlsx

# Create a blank PowerPoint presentation
officecli create slides.pptx

# Create with explicit type (extension appended automatically)
officecli create report --type docx

Notes

  • If the file is currently held by a resident process (via open), the command will fail. You must close the file first.
  • The file will be overwritten if it already exists.
  • Creating a .pptx outputs slideWidth and slideHeight in the console.

See Also


Based on OfficeCLI v1.0.28

Clone this wiki locally