@bendyline/docblocks-cli

中文文档
2.7.13发布于 2026/11/06MITTypeScriptES Module构建来源已验证近 30 天下载 2599

Build, preview, convert, render, inspect, and automate documents

原始使用文档
文档目录4 节
  1. Installation
  2. Documentation
  3. Commands
  4. Examples

@bendyline/docblocks-cli

The DocBlocks command-line surface for document build and preview, linked-Squisq format conversion, MP4 rendering, document parsing, workspace catalog refresh, and a local MCP server for agents.

CLI and MCP overview

Installation

Node.js 24.18.0+ or 26+ is required.

npm install -g @bendyline/docblocks-cli
docblocks --help

Documentation

Those guides describe current input support, linked Squisq ownership, format directions, overwrite behavior, MCP authority, artifact lifecycle, and assurance.

Commands

CommandPurpose
docblocks buildRecursively build Markdown into standalone HTML.
docblocks serveRun a constrained local preview server.
docblocks convert <input>Convert through the linked Squisq registry.
docblocks video <input> [output]Render a configurable MP4.
docblocks mcpStart the artifact-first MCP server over local stdio.
docblocks themesList linked Squisq theme IDs.
docblocks transformsList linked Squisq transform IDs.
docblocks parse <input>Parse UTF-8 Markdown into Squisq Markdown AST JSON.
docblocks workspace refresh [dir]Refresh catalog outputs enabled in .docblocks/workspace.json.

Use docblocks help <command> for the installed option summary.

Examples

# Build and preview Markdown
docblocks build --input ./docs --output ./dist
docblocks serve --dir ./docs

# The no-flag conversion set is exactly DOCX, PPTX, PDF, HTML, and DBK
docblocks convert story.md

# Select any export-capable linked-registry formats
docblocks convert report.docx --formats md,pdf,pptx --output-dir ./exports

# Render MP4 with explicit media controls
docblocks video story.md --quality high --orientation portrait

# Render the Dashboard rendition to a square image with accent cards
docblocks convert report.md --formats png --image-resolution square --image-style accent

# Regenerate the catalog.json / index.html a workspace opts into
docblocks workspace refresh ./docs --dry-run
docblocks workspace refresh ./docs

# Discover authoring vocabulary from linked Squisq
docblocks themes
docblocks transforms

# Start MCP with no filesystem authority
docblocks mcp

# Grant independent roots when an agent needs files or durable output
docblocks mcp --allow-read ./documents --allow-write ./exports

For durable output, call list_roots before drafting. If no root is write-enabled, restart the server with --allow-write; do not bypass MCP with the direct convert command. Plain text or ordinary Markdown can be passed directly to convert_document without a preflight; compatible templates are chosen automatically, and explicit Squisq annotations remain optional overrides. For PPTX, a level-one heading creates each deliberate slide boundary by itself; do not add --- between slide headings unless a visible horizontal rule is intended. get_authoring_context is optional discovery for exact annotation examples, safe defaults, and semantically described theme/Summarize choices. MCP guidance tells agents to infer and choose a style from the brief rather than presenting raw IDs, asking one compact high-level question only when the choice is materially ambiguous. The complete catalog remains available at docblocks://authoring-guide.

convert and video accept Markdown, Squisq JSON Doc, DBK/ZIP, folders, and import-capable linked-registry formats. video also renders Dynamic slides from current text and saved design preferences against narration sidecars; stale narration or missing timings fail export. Legacy saved presentation plans remain readable. build/serve standalone HTML includes Copy controls for ordinary fenced code blocks; Mermaid fences remain diagrams. Without --theme, build/serve apply documents.defaultTheme from .docblocks/workspace.json to documents whose frontmatter names no theme; --ignore-workspace-settings opts out. workspace refresh writes only outputs the settings enable, replaces only files carrying the DocBlocks catalog marker, writes only when bytes differ, and exits 1 when a hand-written file blocks an output. build replaces generated HTML files; convert and video refuse existing destinations unless --allow-overwrite is passed. Multi-target conversion stages the complete batch and rolls back replacements if publication fails. Build traversal, input bytes, and output bytes are bounded, as are parse input and JSON output. MCP conversions instead return immutable session artifacts; only explicit save_artifact materializes one, using no-replace or hash-conditional replacement semantics.

The package root is a side-effect-free programmatic API for runBuild, runConvert, runVideo, runParse, and runWorkspaceRefresh. Importing it never starts Commander; the executable is the separate docblocks bin entry.

The live linked registry currently covers Markdown, DOCX, PDF, PPTX, XLSX, CSV, HTML, HTML ZIP, EPUB, DBK, MP4, GIF, and PNG. Direction varies by format, so use the CLI reference or MCP list_formats rather than assuming every format imports.

MP4/GIF rendering requires Chromium and FFmpeg. Install Chromium with npx playwright install chromium; Squisq resolves FFmpeg from SQUISQ_FFMPEG, PATH, or ffmpeg-static, in that order. PNG renders the document's Dashboard rendition to a single image and needs Chromium only.

版本与发布记录

@bendyline/docblocks-cli 共发布 36 个版本,首次发布于 2026/04/04;过去 12 个月发布了 36 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.7.13latest2026/11/062 天前
2.7.122026/11/062 天前
2.7.112026/11/017 天前
2.7.102026/10/318 天前
2.7.92026/10/309 天前
2.7.82026/10/2811 天前

关于 @bendyline/docblocks-cli 的常见问题

@bendyline/docblocks-cli 是什么?

Build, preview, convert, render, inspect, and automate documents

如何安装 @bendyline/docblocks-cli?

在项目目录运行 npm install @bendyline/docblocks-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 docblocks,可以用 npx docblocks 直接运行。

@bendyline/docblocks-cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bendyline/docblocks-cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bendyline/docblocks-cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^24.18.0 || >=26.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bendyline/docblocks-cli 可以商用吗?

@bendyline/docblocks-cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bendyline/docblocks-cli 的下载量有多少?

根据 npm 官方下载统计,@bendyline/docblocks-cli 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,599 次,日均约 87 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bendyline/docblocks-cli 还在维护吗?

最新版本 2.7.13 发布于 2026/11/06(2 天前);至今共发布 36 个版本,其中过去 12 个月发布了 36 个;首次发布于 2026/04/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。