
wordcraft
Open Source Word Processor in Pure Rust
Fast, Cross-Platform Word Processing with Full .docx Support, PDF Export, and Multilingual Features.
What is wordcraft?
WordCraft is a modern, open-source word processor library written entirely in pure Rust, designed for speed, reliability, and deep compatibility with industry-standard document formats. It supports reading and writing .docx (OOXML), legacy .doc, .odt, .rtf, .html, .md, .tex, and exports high-fidelity PDFs with selectable text, links, and bookmarks. Built with egui for native performance on macOS, Windows, Linux, BSD, and the web via WebAssembly, WordCraft delivers a familiar ribbon interface with live styles, track changes, mail merge, and full accessibility features—all while running offline and respecting user privacy.
WordCraft is engineered for both human creators and AI agents, offering 422 structured commands that power the ribbon, keyboard shortcuts, CLI, MCP server, and macros. Its layered architecture separates document modeling, layout, rendering, and UI, enabling robust parsing, caching, and extensibility. With built-in spell and grammar checking (English, Polish, and more), multilingual interface support, and clean-room implementation from public specifications, WordCraft delivers professional-grade document processing without vendor lock-in or telemetry. It is MIT OR Apache-2.0 licensed and actively developed by the ArtCraft team and community.
Getting Started with wordcraft
Install WordCraft from the GitHub releases or build it from source using Cargo. For the desktop app, clone the repository and run cargo run --release -p wordcraft -- --sample to open the sample document. The CLI tool is available as wordcraft-cli and supports converting documents to PDF, extracting text, inspecting structure, and driving the app via commands. WordCraft requires no external dependencies beyond Rust and works fully offline, including spell checking and grammar suggestions.
Install via Cargo
git clone https://github.com/storytold/wordcraft
cd wordcraft
cargo build --release -p wordcraft-cli
./target/release/wordcraft-cli --helpFull .docx Support with High Fidelity
WordCraft provides comprehensive read/write support for .docx (OOXML) and legacy .doc files, preserving layout, styles, tables, headers, footers, comments, and track changes. It handles complex documents like the 188-page sample with sub-millisecond re-layout, caches paragraph layout for fast typing, and exports PDFs with real, selectable text, bookmarks, and hyperlinks. The engine supports section breaks, columns, page numbering, watermarks, drop caps, automatic hyphenation, and text wrapping around objects. With strict export modes, you can detect missing glyphs or unsupported pictures before writing, ensuring reliable output for production use.
Export a Document to PDF with Strict Mode
wordcraft-cli convert report.docx report.pdf --strict
# Exits 3 if any character or picture would be omitted
# Outputs JSON report to stderr on failureMail Merge and Document Automation
WordCraft includes robust mail merge capabilities, enabling you to generate personalized documents from CSV data sources. You can insert address blocks, greeting lines, merge fields, and apply rules to conditionally include content. The process supports previewing results and finishing to a new document, envelope, or label. Combined with the CLI and MCP server, WordCraft enables full automation: agents can generate reports, invoices, or letters by executing commands like mail_merge, insert_merge_field, and save_document programmatically—ideal for batch processing or integrating with AI workflows.
Run Mail Merge via CLI
wordcraft-cli run --template letter.docx \
--cmd 'mail_merge.csv=contacts.csv' \
--cmd 'mail_merge.address_block' \
--cmd 'mail_merge.greeting_line' \
--save output.docx --export_pdf output.pdfMultilingual Interface and Spelling
WordCraft ships with an interface translated into over 20 languages—including Chinese, Japanese, Portuguese, Spanish, Arabic, and more—and defaults to your system language. Spelling and hyphenation are powered by Hunspell dictionaries (English, Polish, Russian, Portuguese, Czech, Italian, Croatian, Turkish) or built-in data when language packs are included. Grammar checking is available for English and Polish, with suggestions shown inline. All proofing tools work offline, and you can switch languages per text run, ensuring accurate checking for multilingual documents.
Enable Multilingual Support at Build
# Clone language data and build with translations
git clone https://github.com/storytold/craft-i18n ../craft-i18n
git -C ../craft-i18n checkout "$(cat craft-i18n.rev)"
CRAFT_I18N_DIR="$PWD/../craft-i18n" cargo build --release -p wordcraftAgent-Driven Automation via CLI and MCP
WordCraft was designed for both human and AI agent interaction. Every ribbon action maps to a command ID, enabling control via keyboard shortcuts, the command search, CLI, JSON control channel, and MCP server. Agents can execute sequences of commands, inspect document structure without screenshots, render pages, and save results—all confined to read/write roots for security. This makes WordCraft ideal for integration into CI/CD pipelines, document generation services, or AI-assisted writing tools.
Drive WordCraft with MCP Commands
# Add WordCraft as an MCP tool for an agent
claude mcp add wordcraft -- wordcraft-cli mcp \
--automation-read-root /path/to/read \
--automation-write-root /path/to/write
# Example: select text, apply bold, and save
wordcraft-cli run --cmd 'select.text={"text":"Title"}' \
--cmd 'format.bold' --save output.docx