lmoffice reference

Complete CLI subcommands, flags, Word/Excel/PowerPoint schema types and methods, standard lmcode_std_v3 catalog functions, and exit codes for lmoffice.

CLI subcommands and flags

Command or flagArgumentsDescription
lmoffice --versionnonePrint the lmoffice version string and exit 0.
lmoffice docx--help | --lmcode-schema [--json] | --lmcode-signatures | --lmcode FILEWord (.docx) host route: inspect embedded schema, print canonical signatures, or execute compiled bytecode.
lmoffice xlsx--help | --lmcode-schema [--json] | --lmcode-signatures | --lmcode FILEExcel (.xlsx) host route: inspect embedded schema, print canonical signatures, or execute compiled bytecode.
lmoffice pptx--help | --lmcode-schema [--json] | --lmcode-signatures | --lmcode FILEPowerPoint (.pptx) host route: inspect embedded schema, print canonical signatures, or execute compiled bytecode.
lmoffice inspectFILE [--markdown]Validate a .docx, .xlsx, or .pptx file with OpenXmlValidator and print a JSON summary (or extracted Markdown with --markdown).

Word schema (lmoffice docx)

Type / contextMethod signatureDescription
context docx: DocxHostdocx.create(string) -> DocxCreate a new Word document builder targeting the given output path.
DocxHostdocx.inspect(string) -> string | docx.to_markdown(string) -> stringInspect an existing .docx package as JSON or extract its content as Markdown.
DocxHostdocx.sample_image(string) -> voidWrite a self-contained 64x64 sample PNG image to the given path.
Docxd.heading(string, int) -> Paragraph | d.paragraph(string) -> ParagraphAppend a heading at level 1..6 or a body paragraph and return its Paragraph handle.
Docxd.bullet(string) -> Paragraph | d.numbered(string) -> ParagraphAppend a bulleted or numbered list item paragraph.
Docxd.clause(string, int) -> Paragraph | d.signature(string) -> ParagraphAppend a numbered legal clause at level 1..3 or a signature block line.
Docxd.table(int, int) -> Table | d.image(string, int, int) -> DocxAppend a rows-by-cols table or an inline image with width and height in pixels.
Docxd.page_break() -> Docx | d.section_break(string) -> DocxInsert a page break or a section break (such as nextPage, continuous, landscape).
Docxd.header(string) -> Docx | d.footer(string) -> DocxSet plain text running header or footer.
Docxd.header_fields(string) -> Docx | d.footer_fields(string) -> DocxSet running header or footer supporting {PAGE} and {NUMPAGES} fields.
Docxd.title(string) -> Docx | d.author(string) -> DocxSet package metadata title and author properties.
Docxd.font(string) -> Docx | d.font_size(float) -> DocxSet default document font family and size in points.
Docxd.page_size(float, float) -> Docx | d.orientation(string) -> Docx | d.margins(float, float, float, float) -> DocxConfigure page width and height in points, orientation (portrait or landscape), and top/right/bottom/left margins.
Docxd.columns(int, float) -> Docx | d.text_box(string, float, float) -> DocxConfigure multi-column section layout (count, space_pt) or insert a bordered text box.
Docxd.toc(string, int) -> Docx | d.heading_numbering(bool) -> DocxInsert a table of contents with title and max depth, or enable hierarchical heading numbering.
Docxd.markdown(string) -> Docx | d.markdown_file(string) -> DocxAppend document content parsed from an inline Markdown string or a UTF-8 Markdown file.
Docxd.html_doc(string, string) -> Docx | d.html_xml(string, string) -> DocxAppend content from html-doc@1 / css-doc@1 strings or legacy html-subset@1 / css-subset@1 strings.
Docxd.save() -> voidWrite and close the .docx package on disk.
Paragraphp.bold(bool) | p.italic(bool) | p.size(float) | p.color(string) | p.align(string) | p.font(string) -> ParagraphStyle paragraph text runs and alignment (left, center, right, justify).
Paragraphp.spacing(float, float, float) | p.indent(float, float, float) | p.keep_with_next(bool) | p.tab_stop(float, string) -> ParagraphSet before/after/line spacing, left/right/first-line indent, pagination keep, or tab stop position and alignment.
Paragraphp.hyperlink(string, string) | p.footnote(string) | p.comment(string, string) | p.inserted(string, string) | p.deleted(string, string) -> ParagraphAppend a hyperlink (text, url), footnote, author comment, or tracked insertion/deletion.
Tablet.cell(int, int, string) -> Table | t.paragraph(int, int, string) -> ParagraphSet 1-based cell text or create a stylable Paragraph inside a cell.
Tablet.borders(bool) | t.column_width(int, float) | t.shade(int, int, string) | t.merge(int, int, int, int) | t.cell_border(int, int, string, string, int) -> TableConfigure table borders, column width in points, hex cell shading, rectangular cell merge, or individual cell border side/color/size.

Excel schema (lmoffice xlsx)

Type / contextMethod signatureDescription
context xlsx: XlsxHostxlsx.create(string) -> Xlsx | xlsx.inspect(string) -> string | xlsx.to_markdown(string) -> string | xlsx.sample_image(string) -> voidCreate a workbook, inspect or convert an existing .xlsx file to Markdown, or generate a 64x64 sample PNG.
Xlsxwb.sheet(string) -> Sheet | wb.sheet_from_markdown_table(string, string) -> Sheet | wb.sheet_from_csv(string, string) -> SheetCreate an empty worksheet or populate a typed worksheet from a Markdown table or CSV string.
Xlsxwb.named_range(string, string, int, int, int, int) -> Xlsx | wb.image(string, int, int, int, int) -> Xlsx | wb.save() -> voidDefine a workbook-level named range, embed an image on the active sheet, or save the .xlsx file.
Sheets.set(int, int, string|int|float|bool) -> Sheet | s.formula(int, int, string) -> SheetSet a 1-based (row, col) cell value or store an Excel formula expression.
Sheets.bold(int, int) | s.italic(int, int) | s.font_size(int, int, float) | s.font_color(int, int, string) | s.font_name(int, int, string) -> SheetApply font styling to a cell at (row, col).
Sheets.fill(int, int, string) | s.number_format(int, int, string) | s.align(int, int, string) | s.valign(int, int, string) | s.wrap(int, int, bool) -> SheetSet cell background fill color, number format string, horizontal/vertical alignment, or text wrapping.
Sheets.border(int, int, string, string) | s.border_box(int, int, int, int, string, string) -> SheetApply cell or range outline borders with style and hex color.
Sheets.col_width(int, float) | s.row_height(int, float) | s.col_hide(int, bool) | s.row_hide(int, bool) | s.col_group(int, int, bool) -> SheetConfigure column widths, row heights, hidden rows/columns, or collapsible column outline groups.
Sheets.freeze(int, int) | s.merge(int, int, int, int) | s.tab_color(string) | s.page_orientation(string) | s.fit_to_page(int, int) | s.repeat_rows(int, int) -> SheetFreeze top rows and left columns, merge cell ranges, or configure worksheet tab color and print setup.
Sheets.autofilter(int, int, int, int) | s.table(int, int, int, int, string) | s.data_validation_list(int, int, int, int, string) | s.named_range(string, int, int, int, int) -> SheetAdd an autofilter, formatted table, comma-separated dropdown validation list, or sheet named range.
Sheets.hyperlink(int, int, string, string) | s.comment(int, int, string, string) | s.image(string, int, int, int, int) -> SheetAttach a hyperlink, author comment, or anchored image to a cell.
Sheets.conditional_cell_is(int, int, int, int, string, string, string, string) | s.conditional_color_scale(int, int, int, int, string, string) | s.conditional_color_scale3(int, int, int, int, string, string, string) | s.conditional_icon_set(int, int, int, int, string) -> SheetAdd conditional formatting rules (operator/formula/fill/font, 2-color or 3-color scales, or icon sets).
Sheets.bar_chart(int, int, int, int, string, string, string) | s.line_chart(int, int, int, int, string, string, string) | s.pie_chart(int, int, int, int, string, string, string) -> SheetEmbed a native DrawingML bar, line, or pie chart anchored at (row1, col1, row2, col2) with title, category range, and value range.

PowerPoint schema (lmoffice pptx)

Type / contextMethod signatureDescription
context pptx: PptxHostpptx.create(string) -> Pptx | pptx.inspect(string) -> string | pptx.to_markdown(string) -> string | pptx.sample_image(string) -> voidCreate a presentation, inspect or convert an existing .pptx file to Markdown, or generate a 64x64 sample PNG.
Pptxp.slide() -> Slide | p.theme(string, string, string, string) -> Pptx | p.markdown(string) -> Pptx | p.save() -> voidAdd a slide, configure theme palette (primary, accent, background, text hex colors), build slides from Markdown, or save the .pptx package.
Slides.title(string) | s.title_slide(string, string) | s.section_header(string, string, string) | s.two_content(string, string, string) -> SlideSet slide title or populate standard title, section-header, or two-column layouts.
Slides.text(float, float, float, float, string) | s.bullet(float, float, float, float, string) | s.hyperlink(float, float, float, float, string, string) -> SlidePlace a positioned text box, bullet list box, or hyperlink box at (x, y, w, h) in pixels.
Slides.image(string, float, float, float, float) | s.rect(float, float, float, float, string) | s.rounded_rect(float, float, float, float, string, string) | s.ellipse(float, float, float, float, string, string) -> SlidePlace an image, filled rectangle, or labeled rounded rectangle / ellipse at (x, y, w, h).
Slides.line(float, float, float, float, string, float) | s.arrow(float, float, float, float, string, float) -> SlideDraw a line or arrow from (x1, y1) to (x2, y2) with hex color and stroke width.
Slides.notes(string) | s.footer(string) | s.slide_number(bool) | s.transition(string) -> SlideSet speaker notes, slide footer text, slide number visibility, or slide transition effect.
Slides.table(float, float, float, float, int, int) -> PptxTableCreate a table at (x, y, w, h) with the specified row and column counts.
Slides.bar_chart(float, float, float, float, string, string, string, string) | s.line_chart(float, float, float, float, string, string, string, string) | s.pie_chart(float, float, float, float, string, string, string) -> SlidePlace a native bar, line, or pie chart at (x, y, w, h) with title, categories, values, and series name.
PptxTablet.cell(int, int, string) | t.cell_bg(int, int, string) | t.cell_color(int, int, string) | t.bold(int, int, bool) | t.font_size(int, int, float) | t.align(int, int, string) | t.header_row(string, string) -> PptxTablePopulate and style 1-based PowerPoint table cells and header rows.

Standard lmcode_std_v3 catalog

CategoryFunctions, types, or signaturesDescription
Strings and encodingsstr_len, str_substr, str_find, str_contains, str_starts_with, str_ends_with, str_lower, str_upper, str_trim, str_replace, str_repeat, str_split, str_match, str_to_int, str_is_int, str_to_float, str_is_float, str_base64_encode, str_base64_decode, str_hex_encode, str_hex_decodeUTF-8 byte string inspection, manipulation, numeric parsing, and base64/hex encoding.
Math and filesmath_abs, math_min, math_max, math_floor, math_ceil, math_round, math_sqrt, math_pow, file_read, file_write, file_append, file_exists, file_linesOverloaded int/float math helpers and UTF-8 file I/O.
Collections, JSON, and return framingIntList, FloatList, StrList, IntMap, FloatMap, StrMap, IntStack, FloatStack, StrStack, IntQueue, FloatQueue, StrQueue, IntPQ, FloatPQ, StrPQ, Json (json_parse, template_render), lmcode_return_set, lmcode_return_put, lmcode_return_put_null, lmcode_return_nullTyped containers, JSON parsing, Mustache-style template rendering, and structured LMCODE_RETURN payload builders.

Exit codes

Exit codePhaseMeaning
0successCommand, inspection, or _lmcode_ document generation succeeded.
2cliInvalid command-line flags, unknown subcommand, or malformed invocation manifest.
3load / runBytecode loading failure, schema mismatch, or unhandled VM/runtime error.
4appDocument validation failure, invalid table/cell coordinate, missing input file, or Open XML package write error.