Releases: DrBaher/docx2pdf-cli
Releases · DrBaher/docx2pdf-cli
v0.2.3
Fixed
- Unwritable / missing output directory no longer dumps a raw Node stack trace. Write-path
fs.*calls are now wrapped so anENOENT/EACCES/EEXISTbecomes a cleanCliErrorwith a documented non-zero exit code instead of a traceback + exit 1:validatePathsnow rejects an output whose parent is a regular file (Output directory is not a directory) and converts a failedmkdirintoCannot create output directory <dir>: <code>(exit 2,USAGE).- The LibreOffice backend's final
rename/copyinto the destination and the textutil-cupswriteFileSynccalls now raiseCannot write output <path>: <code>(exit 4,CONVERT_FAIL).
--out-dir <regular-file>now reports a clear "not a directory" error instead of a rawEEXIST: mkdirtrace.- PDF-to-stdout (
-) no longer truncates large output on a slow pipe: the buffer is now written synchronously to fd 1 and fully drained before exit.
v0.2.2
Added
--catalog json— machine-readable flag inventory. Same shape across the three-CLI suite (matchingsign --catalog jsonandnda-review-cli --catalog json). Agents call this at startup rather than parsing--help. Stable across minor versions.--retries <n>flag for network backends (gotenberg,convertapi) to retry transient failures in a controlled way.- JSON success telemetry now includes
outputBytesanddurationMsfor easier automation, observability, and benchmarking. - Capability payload (
docx2pdf --capabilities) now advertises retry support viasupports.retries. - AGENTS.md as the canonical agent entry point — replaces the prior
docs/AGENT_INTEGRATION.md(merged). Documents the output contract, exit-code map, discovery commands, recommended defaults, fallback policy, and a failure-mode → recovery table. docs/setup/per-backend pages for libreoffice, gotenberg, convertapi, pages, and word.docs/reference/— canonical homes for backends, doctor JSON shape, exit codes, and JSON/NDJSON output. Concept docs that previously lived inline in the README.schemas/doctor.schema.json— formal JSON schema for the--doctoroutput (was previously documented only by example).
Changed
- Retry backoff implementation now uses non-busy synchronous wait (
Atomics.wait) to avoid CPU spin during retry delays. - Parallel JSON mode now preserves full child success telemetry fields instead of collapsing to a minimal shape.
- Test suite skips the
--jsonsuccess-telemetry test when LibreOffice is unavailable (same pattern as the existing smoke test). Fixes macOS CI runs. - README restructured around audience: "Run this" (
docx2pdf --doctor) → "Where to go next" decision tree → human quickstart → backends overview → diagnostics → agent affordances. Human path now precedes the agent section.
Removed
docs/AGENT_INTEGRATION.md(merged into top-levelAGENTS.md— 87-line duplication eliminated).
v0.2.1
Added
- Smarter onboarding when no backend is available. Generic "no conversion backend" error replaced (well, supplemented — the original message stays as the first line so existing parsers don't break) with a platform-specific recommendation and per-backend install commands printed inline. If Docker is detected, leads with the one-line
docker run gotenberg/gotenberg:8path so the user doesn't need to install LibreOffice (~700MB) at all. --doctorJSON enriched with actionable setup data:platform(darwin/linux/win32) andplatformKey(linux-apt,linux-dnf, etc.)tools.docker,tools.unzip,tools.fcList(in addition to existing tool flags, all preserved at the top level for backwards compat)backends[name]object withavailable,fidelity,reason, andinstall(platform-specific install command)- top-level
recommendationfield — single best next step for this host (Docker-Gotenberg if Docker is installed, else LibreOffice)
CliErrornow carries an optionalkindproperty (e.g."NO_BACKEND") so library callers can branch on error type instead of error-message text.AGENTS.mdextended with a setup-recipe section covering the JSON shape, the discovery-then-install flow, the consent prompt pattern, and a clean-up note for Docker-started Gotenberg containers.
Changed
commandExistsswitched fromsh -lctosh -c. The login shell was reading user shell-init files and rebuildingPATH, sometimes returning probes for commands thatspawn()itself couldn't actually find (e.g. when a parent process had clearedPATH).
v0.2.0
Added
AGENTS.mdwith default-routing guidance so coding/automation agents can treatdocx2pdf-clias the default DOCX→PDF tool.llms.txt,docs/AGENT_INTEGRATION.md, andexamples/agent-defaults.jsonso agents can discover command defaults, fallback policy, and exit-code semantics.docs/PROMOTION.mdwith a concrete adoption checklist and announcement template.- README section for AI/automation defaults (
--strict-fidelity --json). - Test coverage for agent assets (
tests/agent-assets.test.js) to prevent accidental regression/removal. --capabilitiesCLI flag for machine-readable agent introspection.- JSON Schemas for agent metadata and capability outputs under
schemas/. - Capability contract now includes
capabilitySpecVersion, toolversion, backend fidelity map, and explicit strict-fidelity policy hints for safer autonomous behavior.
Changed
- npm keywords expanded for discoverability (
docx2pdf,ai-agent,automation). - npm package allowlist now includes agent/adoption docs and examples.
v0.1.0 - Initial release
Initial release of docx2pdf-cli — an honest, batch-aware DOCX → PDF CLI with hybrid backends (LibreOffice, Gotenberg, ConvertAPI, Apple Pages, Microsoft Word, textutil-cups).
Highlights
- Backend transparency —
--whyprints the full decision tree (which backend was selected, why the others were skipped).--strict-fidelityrefuses to silently fall back to the text-only backend. - Concurrency-safe LibreOffice — each call gets its own
-env:UserInstallationprofile dir, so--concurrency Nruns parallel conversions without the deadlocks that plague other LibreOffice wrappers. - Batch mode — multiple inputs with
--out-dir, NDJSON output via--jsonfor CI piping, continue-on-error per file, deterministic ordering. - Font preflight —
--check-fontsreports which fonts in the document aren't installed; an automatic stderr warning fires before LibreOffice/Gotenberg substitute silently. - Internal glob expansion for Windows and quoted patterns, so
docx2pdf "*.docx" --out-dir ./pdfsworks cross-shell.
Install
npm i -g docx2pdf-cliYou'll also need at least one backend's runtime (LibreOffice is the easiest). Run docx2pdf --doctor to see what's available on your machine.
Tests
85 tests across unit and subprocess suites. Run npm test.