docboss.dev

Command line

Word documents to text, Markdown and pages from the terminal.

One binary. docboss reads .docx and .doc files, detects the format from the bytes, renders pages, converts to DOCX and composes DOCX from Markdown. Every command that reads a document takes --password, and most take an http(s):// URL read with range requests. MIT OR Apache-2.0.

$cargo install docboss-cliErrors go to stderr prefixed docboss:; document and I/O errors exit 1, usage errors and invalid jq programs exit 2.

Read

Text, Markdown, HTML and JSON.

Text has one line per paragraph with list labels, table rows tab-separated, and footnotes and endnotes after the main text. Markdown is GitHub-flavored; HTML is semantic, a body fragment unless --standalone. q runs a jq program through jaq over the same JSON as json.

~/reports
$ docboss info report.docx                # format, metadata, page setup, page count, counts
$ docboss text report.docx                # one line per paragraph, list labels included
$ docboss text report.docx --headers-footers --comments
$ docboss text legacy.doc --no-labels -o legacy.txt
$ docboss md report.docx --images images -o report.md
$ docboss html report.docx --standalone -o report.html
$ docboss json report.docx --blocks       # one object per block
$ docboss q report.docx '.metadata.title' -r
$ docboss text https://example.com/report.docx   # range requests, not a download

Subcommands

Everything the binary does.

infoFormat, metadata, page setup, page count and content counts
textPlain text; --headers-footers, --no-notes, --comments, --no-labels, -o
mdGitHub-flavored Markdown; --images DIR, --embed-images, --title, --page-breaks
htmlSemantic HTML, images embedded unless --images is given; --standalone
jsonThe document model as JSON; --blocks for the per-block view, --compact
qA jq program over the JSON form of the document; -r, --blocks
renderLay out and render pages to PNG, PPM, BMP or JPEG, picked by the -o extension; --page, --scale, --jpeg-quality
imagesThe document's images at their stored size and format
partsThe ZIP entries or compound-file streams of the container
hexHexdump the whole file or one part; --offset, --length, --width
xmlAn XML part of a DOCX, indented; --raw as stored
convertA fresh DOCX, or .md, .html, .txt or .json, by the -o extension
create mdCommonMark and GFM composed into a DOCX; --size letter|a4, --title
fontsThe fonts the document names and the faces they resolve to
diagnosticsEverything the reader approximated or dropped; --layout adds layout
tuiThe interactive terminal explorer
skillInstall or print the skill document for coding agents

parts, hex and xml take a local path; the other read commands also take a URL. Full flags per subcommand in the CLI reference.

Render

Pages to PNG, PPM, BMP or JPEG.

The -o extension picks the format and %d is replaced by the page number. Without --page every page is rendered, laid out once and painted on all cores. --scale is pixels per point, so 1.0 is 72 dpi and 2.0 is 144 dpi. Page numbers are 1-based on the command line.

render
$ docboss render report.docx --page 1 -o page.png          # one page, 72 dpi
$ docboss render report.docx --scale 2 -o 'page-%d.png'    # every page at 144 dpi
$ docboss render report.docx --page 1 -o page.jpg --jpeg-quality 85
$ docboss render legacy.doc -o 'legacy-%d.ppm'
$ docboss images report.docx -o images     # pictures at their stored size and format
$ docboss fonts report.docx                # each font and the face it resolves to here

Convert and create

DOC to DOCX, Markdown to DOCX.

convert
$ docboss convert legacy.doc -o legacy.docx
$ docboss convert legacy.doc -o legacy.md    # or .html, .txt, .json
$ docboss create md notes.md -o notes.docx --size a4 --title "Notes"
$ docboss convert locked.docx --password secret -o unlocked.docx
inspect
$ docboss parts report.docx                # ZIP entries with stored and unpacked sizes
$ docboss parts legacy.doc                 # compound-file streams
$ docboss xml report.docx word/styles.xml  # one XML part, indented
$ docboss hex legacy.doc WordDocument --length 64
$ docboss diagnostics report.docx --layout
$ docboss tui report.docx

A converted file carries what the model holds; embedded fonts and the theme part are not written, and convert writes a decrypted document as a plain DOCX. docboss skill install writes a skill document for coding agents into ./.claude/skills/docboss, or ~/.claude/skills/docboss with --global.