| name | cli-anything-hwpx |
| description | CLI harness for reading, editing, creating, and validating Hancom Office HWPX documents. Supports text extraction, find/replace, tables, images, export to text/markdown/html, schema validation, undo/redo, and interactive REPL. |
cli-anything-hwpx
CLI tool for Hancom Office HWPX document manipulation. No Hancom Office installation required.
Installation
pip install cli-anything-hwpx
cd hwpx/agent-harness && pip install -e .
Quick Start
cli-anything-hwpx document new --output report.hwpx
cli-anything-hwpx --file report.hwpx text extract
cli-anything-hwpx --file report.hwpx export markdown -o report.md
cli-anything-hwpx repl
Command Groups
| Group | Commands | Description |
|---|
document | new, open, save, info | Document lifecycle management |
text | extract, find, replace, add | Text content operations |
table | add, list | Table creation and inspection |
image | add, list, remove | Image management |
export | text, markdown, html | Export to various formats |
validate | schema, package | Document and package validation |
structure | sections, add-section, set-header, set-footer, bookmark, hyperlink | Document structure |
undo | — | Undo last change |
redo | — | Redo last undo |
repl | — | Interactive REPL mode |
Global Options
| Option | Description |
|---|
--json | Output as structured JSON (for agent consumption) |
--file PATH | Open a .hwpx file before running the command |
Usage Examples
Document Management
cli-anything-hwpx document new --output blank.hwpx
cli-anything-hwpx document open existing.hwpx
cli-anything-hwpx document save output.hwpx
cli-anything-hwpx document info
Text Operations
cli-anything-hwpx text extract
cli-anything-hwpx text extract --format markdown
cli-anything-hwpx text find "검색어"
cli-anything-hwpx text replace --old "초안" --new "최종본"
cli-anything-hwpx text add "새 문단 텍스트"
Table & Image
cli-anything-hwpx table add --rows 3 --cols 4
cli-anything-hwpx table list
cli-anything-hwpx image add photo.png --width 100 --height 80
cli-anything-hwpx image list
cli-anything-hwpx image remove 0
Export
cli-anything-hwpx export text -o output.txt
cli-anything-hwpx export markdown -o output.md
cli-anything-hwpx export html -o output.html
Validation
cli-anything-hwpx validate schema document.hwpx
cli-anything-hwpx validate package document.hwpx
Structure
cli-anything-hwpx structure sections
cli-anything-hwpx structure add-section
cli-anything-hwpx structure set-header "Page Header"
cli-anything-hwpx structure set-footer "Page Footer"
cli-anything-hwpx structure bookmark "chapter1"
cli-anything-hwpx structure hyperlink "https://example.com" --text "Link"
JSON Output Mode
All commands support --json for structured output:
cli-anything-hwpx --json --file doc.hwpx document info
cli-anything-hwpx --json --file doc.hwpx text find "keyword"
Agent Guidance
- Always use
--json flag for machine-readable output
- Open a document first with
document open or --file before other operations
- Use
undo after mistakes — up to 50 levels supported
- For batch processing, chain commands with
--file flag
- HWPX format is ZIP + XML — no proprietary binary format
- Requires
python-hwpx>=2.8.0 library (auto-installed)