Metadata-Version: 2.4
Name: headless-word
Version: 0.1.1
Summary: Word document automation tool for agents in headless environments
Project-URL: Repository, https://github.com/hewliyang/headless-word
Author-email: Hew Li Yang <hewliyang@u.nus.edu>
License: MIT
License-File: LICENSE
Keywords: automation,document,docx,headless,libreoffice,word
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business
Requires-Python: >=3.10
Requires-Dist: pydantic>=2.0.0
Requires-Dist: websockets>=16.0
Provides-Extra: watch
Requires-Dist: websockets>=13.0; extra == 'watch'
Description-Content-Type: text/markdown

# headless-word

Word document automation via LibreOffice for headless environments.

## Install

```bash
uv tool install headless-word
```

## Agent Skill

```bash
npx skills add hewliyang/headless-word
```

## Requirements

- Python 3.10+
- LibreOffice 25.2+ (with Writer)
- `poppler-utils` for screenshots (`pdftoppm`)

## Quick Start

```bash
headless-word check              # verify LibreOffice is installed
headless-word start              # start the daemon
headless-word new doc.docx       # create a new document → session ID
headless-word get-document-text <sid>
headless-word screenshot <sid> --page 1 --out page1.png
headless-word stop               # stop the daemon
```

## Commands

```
headless-word <command> [options]

Daemon:
  start                Start the LibreOffice daemon
  stop                 Stop the daemon
  status               Check daemon status
  check                Check environment setup

Sessions:
  open                 Open a document
  new                  Create a new document
  save                 Save a document
  close                Close a session
  list                 List open sessions
  export-pdf           Export as PDF

Reading:
  get-document-text    Get document text (paragraphs, styles, lists)
  get-document-structure  Get document structure (headings, tables, sections)
  get-ooxml            Extract OOXML for inspection
  screenshot           Render a page to PNG

Writing:
  execute              Execute Python/UNO code inside LibreOffice
  insert-ooxml         Insert raw OOXML elements into document

Live Preview:
  watch                Live document viewer with auto-reload
```
