docrs-cli
The docrs command: find, replace, review, compare and compose Word (.docx) files without disturbing what you didn't touch, and convert Markdown, editor HTML or TipTap JSON to Word styled by a template. Built on the docrs library.
docrs --help lists every command and docrs <command> --help its options.
from-markdown reads images only from the Markdown file's directory (standard input: the current directory) or --resource-path; absolute, UNC and file: paths and paths leading out of it are refused with a warning.
Output and exit codes:
-
--jsonprints machine-readable reports (schema_version: 1). Errors are printed as JSON on stdout too,{"schema_version": 1, "error": {"code", "reason", "message", "refusal", "limit"}}, including argument errors (--jsonanywhere on the command line).--helpand--versionprint text and exit 0. -
Exit codes:
Code Meaning 0 success 2 invalid argument 3 refusal (ambiguous, not found, protected, unsupported structure, boundary, relationship policy, malformed package) 4 resource limit 5 I/O 70 internal error (a bug; a panic is reported as code internal, reasoninternal_panic) -
findexits 3 when nothing matches.replaceexits 3 when it replaces nothing,--allincluded (no match:target_not_found; every match refused: the first refusal), and writes no output. Its report givesreplaced_countandrefused_count. -
Outputs are written atomically, and
--outmay be the input file. A refusal leaves every file unchanged.
License
MIT. Upstream attribution is in NOTICE.md.