# OfficeCLI L1 Semantic Views: 10 Modes for Document Inspection and AI Integration

> Explore OfficeCLI's 10 L1 semantic view modes for inspecting Office documents. Discover outline, text, annotated, and more modes for deep document analysis and AI integration. Uncover insights with stable path-based modeling.

- Repository: [OfficeAI/OfficeCLI](https://github.com/iofficeai/OfficeCLI)
- Tags: deep-dive
- Published: 2026-07-28

---

**OfficeCLI provides 10 distinct L1 semantic view modes—outline, text, annotated, stats, issues, html, svg, screenshot, pdf, and forms—that enable inspection of Office documents at varying abstraction levels using a stable path-based model instead of raw OOXML.**

The **iOfficeAI/OfficeCLI** repository defines these semantic views through the `view` command, which parses Word, PowerPoint, and Excel files into machine-readable representations. These modes operate on an internal path-based document model (e.g., `/slide[1]/shape[2]`) rather than XML namespaces, allowing AI agents and automation scripts to reason about document structure reliably across Office format versions.

## Available OfficeCLI L1 Semantic View Modes

The semantic view system is documented in [`README.md`](https://github.com/iOfficeAI/OfficeCLI/blob/main/README.md) (lines 20-22) and implemented across the CLI handlers. Each mode targets specific analysis needs, from structural extraction to quality assurance.

### Structural Analysis Modes

- **outline**: Displays hierarchical document structure including slides, sections, paragraphs, and tables in a tree-like format.
- **text**: Extracts plain text from all readable content without formatting or metadata.
- **annotated**: Preserves text with inline annotations showing styles, fonts, colors, and formatting flags.

### Document Intelligence Modes

- **stats**: Reports document statistics including page counts, slide totals, word counts, and element totals. Supports the optional `--page-count` flag for detailed pagination data.
- **issues**: Detects quality problems such as text overflows, missing alt text, broken formulas, and accessibility violations.

### Rendering and Export Modes

- **html**: Generates full-fidelity, self-contained HTML suitable for web viewing and AI agent consumption.
- **svg**: Creates vector-graphics representations of document pages for scalable rendering.
- **screenshot**: Produces per-page PNG screenshots using the built-in renderer.
- **pdf**: Exports documents to PDF format via an exporter plug-in.
- **forms**: Extracts form fields and data via a format-handler plug-in.

## How L1 Semantic Views Work

Unlike direct OOXML parsing, OfficeCLI L1 semantic views operate on a **path-based model** (e.g., `/slide[1]/shape[2]`). This abstraction layer, implemented in [`src/officecli/Handlers/ViewHandler.cs`](https://github.com/iOfficeAI/OfficeCLI/blob/main/src/officecli/Handlers/ViewHandler.cs), provides stability across Office versions and eliminates the need to handle complex XML namespaces. According to the iOfficeAI/OfficeCLI source code, this approach allows AI agents to reference document elements consistently regardless of underlying file format changes.

## Command Line Examples

```bash

# Show hierarchical outline of a PowerPoint deck

officecli view deck.pptx outline

# Extract plain text from Word document

officecli view report.docx text

# Get annotated view with formatting details

officecli view report.docx annotated

# Display statistics with page counting

officecli view deck.pptx stats --page-count

# Check for quality issues (JSON output)

officecli view deck.pptx issues --json

# Export as HTML for web viewing

officecli view deck.pptx html -o /tmp/deck.html

# Generate PNG screenshots per slide (limit to pages 1-5)

officecli view deck.pptx screenshot -o /tmp/deck.png --page 1-5

# Export to PDF (requires plug-in)

officecli view deck.pptx pdf -o /tmp/deck.pdf

# Extract form fields as JSON

officecli view report.docx forms --json

```

## Implementation Architecture

The view command implementation spans several key files in the repository. [`src/officecli/Program.cs`](https://github.com/iOfficeAI/OfficeCLI/blob/main/src/officecli/Program.cs) handles top-level CLI argument parsing and dispatches to the appropriate sub-command handler. The actual mode implementations reside in [`src/officecli/Handlers/ViewHandler.cs`](https://github.com/iOfficeAI/OfficeCLI/blob/main/src/officecli/Handlers/ViewHandler.cs) (or similar handler files), where each semantic view mode translates the internal document model into the requested output format. Additional documentation appears in [`wiki/command-view.md`](https://github.com/iOfficeAI/OfficeCLI/blob/main/wiki/command-view.md) detailing mode-specific options and advanced usage patterns for the L1 semantic view API.

## Summary

- OfficeCLI L1 semantic views provide 10 distinct inspection modes ranging from outline extraction to PDF export.
- Modes operate on a stable path-based model rather than raw OOXML, simplifying AI agent integration and cross-version compatibility.
- Key implementation files include [`src/officecli/Program.cs`](https://github.com/iOfficeAI/OfficeCLI/blob/main/src/officecli/Program.cs) for argument parsing and [`src/officecli/Handlers/ViewHandler.cs`](https://github.com/iOfficeAI/OfficeCLI/blob/main/src/officecli/Handlers/ViewHandler.cs) for mode-specific logic.
- Plug-in modes (pdf, forms) require additional format handlers while core modes work out of the box.
- All modes support the standard `officecli view <file> <mode>` syntax with optional flags for JSON output and page limiting.

## Frequently Asked Questions

### What is the difference between text and annotated modes in OfficeCLI?

The **text** mode extracts raw readable content without formatting, while **annotated** mode preserves style information, font details, and formatting flags inline with the text. Use annotated when you need to understand visual presentation hierarchies, and text when you require only the document's literal content for natural language processing.

### Can I export only specific pages using OfficeCLI L1 semantic views?

Yes. The **screenshot** mode supports the `--page` flag to limit rendering to specific ranges (e.g., `--page 1-5`). This parameter allows targeted analysis of large documents without processing unnecessary pages, making batch operations more efficient.

### Do I need additional plug-ins to use all OfficeCLI L1 semantic views?

Most core modes (outline, text, annotated, stats, issues, html, screenshot) work out of the box. However, **pdf** export requires an exporter plug-in, and **forms** extraction requires a format-handler plug-in, as documented in the repository's [`README.md`](https://github.com/iOfficeAI/OfficeCLI/blob/main/README.md) command table.

### Why does OfficeCLI use a path-based model instead of direct OOXML parsing?

The path-based model (e.g., `/slide[1]/shape[2]`) provides a stable abstraction layer that remains consistent across Office format versions. According to the iOfficeAI/OfficeCLI source code, this approach eliminates XML namespace complexity and enables AI agents to reason about document structure without tracking format-specific XML schemas or handling binary Office format variations.