How kklimuk/docx-cli works
docx-cli is an agent-oriented command-line editor for Word .docx files. The principal workflow is to read a document using stable locators, find and edit content, optionally add comments or tracked changes, then return the modified file for review in Word. The CLI also supports document creation, rendering, and specialized content such as tables, images, equations, styles, and sections. The tree and README establish these capabilities; sampled source confirms CLI dispatch, query handling, and edit-layer dependencies, but not all command-to-core wiring.
Main entry points: index.ts Command dispatcher · find Find and replace · edit Edit and insert · document Document model
Components 20
CLI entry
- Command dispatcher
src/cli/index.ts
Read and review
- Read and inspect
src/cli/read - Find and replace
src/cli/find - Document diff
src/cli/diff - Page rendering
src/cli/render
Document changes
- Edit and insert
src/cli/edit - Tracked changes
src/cli/track-changes - Comments
src/cli/comments
Content tools
- Create documents
src/cli/create - Tables
src/cli/tables - Styles and layout
src/cli/styles - Images and links
src/cli/images - Equations
src/cli/equations - Code blocks
src/cli/code
Document engine
- Document model
src/core/ast/document - OOXML package
src/core/raw - Edit operations
src/core/edit/index.tsx - Query operations
src/core/find
Other components
- Agent or user
- Microsoft Word
Connections 19
- Agent or user → Command dispatcher: invokes commands
- Command dispatcher → Read and inspect: dispatches
- Command dispatcher → Find and replace: dispatches
- Command dispatcher → Document diff: dispatches
- Command dispatcher → Page rendering: dispatches
- Command dispatcher → Edit and insert: dispatches
- Command dispatcher → Tracked changes: dispatches
- Command dispatcher → Comments: dispatches
- Command dispatcher → Create documents: dispatches
- Command dispatcher → Tables: dispatches
- Command dispatcher → Styles and layout: dispatches
- Command dispatcher → Images and links: dispatches
- Command dispatcher → Equations: dispatches
- Command dispatcher → Code blocks: dispatches
- Find and replace → Query operations: queries document
- Edit and insert → Edit operations: applies edits
- Edit operations → Document model: mutates model
- Document model → OOXML package: represents package
- Agent or user → Microsoft Word: opens result