-
Notifications
You must be signed in to change notification settings - Fork 107
command create
zmworm edited this page Mar 31, 2026
·
23 revisions
Create a blank Office document.
officecli create <file> [--type <type>]
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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
file |
string | Yes | - | Output file path (.docx, .xlsx, or .pptx) |
| 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 |
# 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- If the file is currently held by a resident process (via
open), the command will fail. You mustclosethe file first. - The file will be overwritten if it already exists.
- Creating a
.pptxoutputsslideWidthandslideHeightin the console.
Based on OfficeCLI v1.0.28