-
Notifications
You must be signed in to change notification settings - Fork 527
command create
zmworm edited this page Jun 8, 2026
·
54 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. Stamps
compatibilityMode=15and Word-2013+ companioncompatSettingsso the file does not open in Mac Word's Compatibility Mode. Honors the--localeflag forthemeFontLang; if--localeis absent, falls back to the OS culture. Locales starting withar/he/fa/urauto-enable RTL (setsdocDefaultsdirection + sectionbidi). - 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
|
--minimal |
bool | No | false |
Emit raw OOXML scaffolding only — no theme, no default style table, no layouts. Useful when about to replay a full dump over the result. (docx) |
--locale |
BCP-47 tag | No | OS culture | Document locale stamped on themeFontLang. Auto-enables RTL for ar*/he*/fa*/ur* locales. (docx) |
--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.97