Expand description
§jubarte-cli
The jubarte engine’s command line: every operation of the library behind
one clap surface - compare, changes, accept, reject, convert, diff, read,
edit, add, comments, append, validate, check, scrub, visual-diff,
capabilities, debug and self-update (behind its feature). This crate is
a library with no binary: the jubarte executable is built by the
facade crate jubarte (cargo install jubarte). build.rs stamps
--version with the source commit when the crate is built from this
repository, and nothing when it is built from an unpacked package inside
another repository.
§Example
use jubarte_cli::cli::top_level_command;
fn main() {
// The full command tree needs more stack than the 1 MiB Windows gives
// a main thread in a debug build; the `jubarte` binary also parses on
// an 8 MiB thread.
let parsed = std::thread::Builder::new()
.stack_size(8 * 1024 * 1024)
.spawn(|| {
top_level_command()
.try_get_matches_from([
"jubarte", "compare", "old.docx", "new.docx", "-o", "redline.docx",
])
.map(|m| m.subcommand_name().map(str::to_owned))
})
.expect("spawn the parsing thread")
.join()
.expect("the parsing thread does not panic");
assert_eq!(parsed.expect("the arguments parse").as_deref(), Some("compare"));
}Re-exports§
pub use jubarte_render;
Modules§
- admission
- Input admission: budgets, refusal reasons, and the limits types the bindings and CLI expose. Resource admission for untrusted DOCX input: bound the ZIP container before anything inflates it without limits.
- append
- Append one document after another. Append one document after another: B’s body follows A’s, and what B’s content refers to (images, links, styles, lists, notes, headers) is carried into A’s package under ids that do not collide with A’s.
- audit
- Accessibility, style and structure findings.
jubarte validate --rules a11y,style,structure: accessibility, style and structure findings with the paragraph id an agent can act on. - capabilities
- What the bindings expose, feature by feature.
What this build can do. Agents read it before choosing an operation:
jubarte capabilities --json,jubarte_redlines.capabilities(). - changes
- Tracked changes one at a time: list, accept or reject a selection. Tracked changes one at a time: list each with an id, accept or reject a selection and keep the rest tracked, as Word’s Accept/Reject This Change does.
- cli
- The
jubartecommand’s parser and dispatch. Shared, platform-neutral command declarations and parsing. No runtime I/O. - comments
- Comment threads across the parts that hold them. Comment threads: list every comment with its thread position and the text it is anchored to, and write the comment part family whole.
- debug
- Maintainer triage views.
jubarte debug: triage a.docxthat Word refuses, or compare two builds of one. Every report is short on purpose. It counts findings by kind, shows a few examples of each (limit), and with two files prints only what differs. - document_
comparer - One-call document comparison and revision accept/reject.
DocumentComparer façade (M5). Port of
DocumentComparer.ts(compare path). - edit
- Tracked-change editing: plans in, redlines and clean copies out. Guarded document editing for agents and tools.
- fields
- Refresh a table of contents and other fields (needs
render). Refresh the cached results of fields from jubarte’s own layout. - ids
- The one grammar of the ids jubarte prints and reads:
ShortId(src/ids/short.rs, spec 2026-10-13 §2 and §2.1). The functions here are the options’ views of it: a change (r12,r1+2,header1.r1), a comment (c27), the text a comment covers (c27.text), and what-ptakes (a paragraphp12, a storyheader1or its paragraphheader1.p2, a cellt0.row1.cell2[.p1], a comment, or changes). - inline
- The typed inline CLI actions, compiled into plan contracts. Compile one typed action into PlanV2; mutation stays in the shared engine.
- inspect
- Read-only paragraph/package views and the Markdown projection. Read-only views of a DOCX for agents and tools: body paragraphs an edit can address, package facts, and a Markdown projection that carries paragraph ids so the reader’s coordinates are the editor’s coordinates.
- legacy_
doc - Word 97-2003
.docreading: text, headings and tables. Word 97-2003 (.doc) to text, paragraphs, headings, lists and tables: the main story, no headers or footers. - markdown
- The composed markdown module (A6): the markdown crate’s module plus
this crate’s patch, redline and unified modules, reproducing the
facade’s historical
markdownfrom one place. - namespaces
- WordprocessingML and related namespace /
XNameconstants. WordprocessingML and related namespace /XNameconstants ported fromPtOpenXmlUtil.ts(the subset the comparer references) — M1.7. - opc
- Open Packaging Conventions adapter (
PartFs). OPC (Open Packaging Conventions) layer — M1.5. - perf
- P0-LAB-01 stage counters/timers — no-ops unless
perf-profileis enabled. P0-LAB-01 — feature-gated stage counters and coarse timers. - publication
- Host filesystem publication, capability-confined and staged. Host filesystem publication is unavailable to browser/WASM byte APIs. Stage complete bytes before replacing outputs. A set has one commit per file; errors name any files already committed. No rollback or delete-old fallback is attempted. Native host filesystems only.
- result
- Stable result codes the bindings print.
Machine result envelope for the v2 routes (
edit apply,edit template,review accept, and friends). - revision_
processor - Accept and reject tracked revisions across a package. Revision accept / reject pipeline (M3).
- scrub
- Remove authors and metadata before sending. Remove who touched a document before it goes out, and find where a text still occurs in one.
- settings
- Settings application (
w:settings). Document settings an edit plan writes intoword/settings.xml: Track Changes on or off,updateFieldson open, and editing restrictions. - strict_
translation - ISO Strict → Transitional package normalization. ISO/IEC 29500 Strict → Transitional namespace normalization (M8).
- text_
diff - Text diff views (agent view and CriticMarkup). Git/GitHub unified patches of complete document text snapshots, and other review presentations.
- unid
- Port of
UnidHelper(UnidHelper.ts) — M1.7. - update
jubarte self-update: install a GitHub release, only when asked.jubarte self-update: replace this binary with a GitHub release when the user runsjubarte self-update(docs/SELF_UPDATE.md).- util
- Shared small utilities.
Small shared utilities, ported from
PtUtil.ts(M1.6). - validate
- Check that Word will open a package, and repair it. Word-validity findings beyond the schema: what makes Word refuse or repair a package, as data.
- wml_
document WmlDocument: document bytes plus the lazily parsed main part. Port ofWmlDocument/PtMainDocumentPart(WmlDocument.ts) — M1.7.- xmllinq
- Arena DOM (
xmllinq) used by the comparer. LINQ-to-XML-style mutable XML tree, ported fromlib/xml-linq.ts.