How to Get Help with OfficeCLI Commands: A Schema-Driven Discovery Guide

OfficeCLI provides a schema-driven help system accessible via the officecli help command that lets you discover document formats, CRUD verbs, and element schemas through hierarchical queries against the built-in JSON schemas.

OfficeCLI is an open-source command-line tool by iOfficeAI for automating Microsoft Office documents. Understanding how to get help with OfficeCLI commands is essential for navigating its schema-driven architecture, which supports DOCX, XLSX, and PPTX formats through a unified CRUD interface. The help system is implemented in src/officecli/CommandBuilder.Help.cs and provides dynamic documentation generated directly from the schema files bundled with the binary.

The help Command Architecture

The entry point for the help system is implemented in src/officecli/CommandBuilder.Help.cs at lines 90-100. When you invoke officecli help, the command accepts up to three optional arguments that form a hierarchical query path:

  • <format> – The document format (docx, xlsx, pptx) or alias (word, excel, ppt)
  • <verb> – One of the CRUD operations: add, set, get, query, or remove
  • <element> – A schema element name (e.g., paragraph, chart, slide)

The parser distinguishes between verbs and elements by checking the second token against the static HelpVerbs list defined at lines 12-17 in CommandBuilder.Help.cs. This disambiguation logic appears at lines 142-197, ensuring that commands like officecli help docx add correctly interpret add as a verb rather than an element name.

Help Query Patterns

The help system supports seven distinct query patterns that provide progressively specific information about the OfficeCLI schema.

Basic Help with No Arguments

Running officecli help without arguments displays the System.CommandLine (SCL) usage banner and a concise cheat-sheet for schema references. This mode provides a high-level overview of available commands and serves as the starting point for exploration.

Listing All Schema Definitions

The help all command outputs a flat, grep-friendly dump of every format/element/property combination defined in the schema. You can add --json for a single envelope-wrapped JSON document or --jsonl for newline-delimited JSON (NDJSON) output suitable for piping to other tools.


# Dump entire schema as NDJSON and filter for chart properties

officecli help all --jsonl | grep "chartType"

Format-Specific Help

Specify a format name or alias to list all available elements for that document type:


# List all elements available in PowerPoint files

officecli help pptx

This queries the SchemaHelpLoader class in src/officecli/Help/SchemaHelpLoader.cs, which normalizes format names and validates them against the built-in schemas.

Verb-Filtered and Element-Specific Help

Combine format and verb arguments to see only elements supporting specific operations:


# Show elements that can be added to Word documents

officecli help docx add

# Show the full schema for the paragraph element

officecli help docx paragraph

The help <format> <verb> <element> pattern renders the element schema filtered to show only properties relevant to the specified verb, implemented through the SchemaHelpRenderer class in src/officecli/Help/SchemaHelpRenderer.cs.

JSON Output for Automation

Append --json to any help query to receive machine-readable output instead of human-readable text. This is particularly useful when integrating OfficeCLI into scripts or CI/CD pipelines:

officecli help docx paragraph --json

Early-Dispatch Help Commands

OfficeCLI reserves certain top-level commands for special help topics that bypass the schema-driven system. The EarlyDispatchHelp dictionary at lines 44-88 in CommandBuilder.Help.cs routes these commands:


# Show usage for the MCP server command

officecli help mcp

# Display information about available skills

officecli help skills

# Show installation instructions

officecli help install

These commands provide static usage text for utility functions that exist outside the standard format/verb/element hierarchy.

Practical Code Examples

Explore the schema incrementally using these common patterns:


# Show top-level help and format list

officecli help

# List every element in Excel files

officecli help xlsx

# Find which verbs support the chart element in PowerPoint

officecli help pptx set chart

# Export complete schema documentation as JSON

officecli help all --json

All help output is generated from the schema loader (SchemaHelpLoader) and rendered by SchemaHelpRenderer or SchemaHelpFlatRenderer in src/officecli/Help/, guaranteeing that officecli help always reflects the exact capabilities of the binary version you are running.

Core Implementation Files

File Purpose
src/officecli/CommandBuilder.Help.cs Core implementation of the help command, argument parsing (lines 90-106, 142-197), and early-dispatch routing (lines 44-88)
src/officecli/Help/SchemaHelpLoader.cs Loads JSON schemas, normalizes format names, and validates verbs/elements
src/officecli/Help/SchemaHelpRenderer.cs Renders single element schemas as human-readable text
src/officecli/Help/SchemaHelpFlatRenderer.cs Generates flat dumps and JSON/JSONL output for help all commands
src/officecli/Program.cs Rewrites --help flags into the help sub-command and routes early-dispatch requests

Summary

  • Entry point: Use officecli help with up to three hierarchical arguments: format, verb, and element.
  • Verb disambiguation: The system recognizes add, set, get, query, and remove as verbs via the HelpVerbs static list.
  • Output formats: Human-readable text for interactive use; add --json or --jsonl for programmatic consumption.
  • Schema source: All documentation is generated from built-in JSON schemas loaded by SchemaHelpLoader, ensuring version consistency.
  • Special commands: Use help mcp, help skills, or help install for utility command documentation.

Frequently Asked Questions

How do I list all available document formats in OfficeCLI?

Run officecli help without arguments or specify officecli help all to see supported formats. The system recognizes docx (Word), xlsx (Excel), and pptx (PowerPoint) along with their aliases word, excel, and ppt, as implemented in the NormalizeFormat method of SchemaHelpLoader.cs.

Can I get help output in JSON format for scripting?

Yes. Append --json to any help query for a single JSON document, or use --jsonl for newline-delimited JSON. This is processed by SchemaHelpFlatRenderer.cs and is ideal for piping to tools like grep or jq to filter specific properties across the entire schema.

What is the difference between help all and help <format> all?

The help all command dumps every format/element/property row across all document types, while help <format> all restricts the output to a specific format such as docx or xlsx. Both support the --json and --jsonl flags for structured output.

How does OfficeCLI distinguish between verbs and elements in help queries?

The parser checks the second token against the static HelpVerbs array (add, set, get, query, remove) defined at lines 12-17 in CommandBuilder.Help.cs. If the token matches, it is treated as a verb; otherwise, it is processed as an element name, enabling intuitive queries like officecli help docx add versus officecli help docx paragraph.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →