CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

Asciidoctor

$ asciidoctor 官方出品 低风险
Asciidoctor · 设计与文档排版 · MIT · macos / linux / windows

Asciidoctor(asciidoctor)是高性能的 Ruby AsciiDoc 官方参考处理器,可将 .adoc 文档转换为 HTML5、DocBook 5 或 Unix man 手册页。支持 -o - 标准输出流、-a 文档属性、-S safe 安全沙箱模式,以及 --failure-level WARN 严格警告失败退出码。

FCRS-1.0 综合评分
84 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install asciidoctor
CLI vs MCP 选型建议 仅 CLI 可用

使用 asciidoctor 在本地毫秒级将 .adoc 编译为 HTML5、DocBook 或 man 手册页,无需 MCP 介入。

Agent 友好度体检单

— 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 19 / 25

确定性的无交互 CLI,支持 -o - 标准输出流、--failure-level WARN 与 -q,但缺少原生 --json 输出。

  • -o - stdout output and --failure-level WARN exit codes
  • Plain-text stderr diagnostics with no --json flag
安全与权限边界 22 / 25

内置 -S(--safe-mode)多级安全模式(unsafe、safe、server、secure),可有效限制恶意文件包含与远程 URI 读取。

  • Configurable -S safe-mode sandbox for untrusted documents
安装与运行摩擦 13 / 15

可通过 brew install asciidoctor、gem install asciidoctor 及各 Linux 发行版包管理器轻松安装。

  • Widely packaged via Homebrew, RubyGems, apt, and dnf
能力覆盖与边际价值 13 / 15

高速且符合规范的 AsciiDoc 处理器,支持 HTML5、DocBook5、man 手册及 asciidoctor-diagram/asciidoctor-pdf 扩展。

  • Multi-backend conversion with rich -a attribute overrides
维护与来源背书 9 / 10

Asciidoctor 官方项目(asciidoctor/asciidoctor),采用 MIT 协议持续维护。

  • Official Asciidoctor GitHub organization
文档与可验证性 8 / 10

docs.asciidoctor.org 提供优秀的 CLI 手册页与命令参考。

  • Official CLI reference at docs.asciidoctor.org

安全边界、鉴权与放权指南

鉴权方式
无需鉴权
凭证存储位置

无需凭据;纯离线处理本地 .adoc 文件。

潜在副作用
只读查询 本地写入
费用与配额提示

100% 免费、离线、开源(MIT)。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# Asciidoctor Agent Rules
- Keep default safe mode (`-S safe` or `-S secure`) when compiling untrusted `.adoc` inputs; avoid `-S unsafe` or `-a allow-uri-read`.
- Use `--failure-level WARN` in CI/verification runs so broken `include::` directives fail the command.
- Pass `-o -` for dry stdout validation without leaving build artifacts behind.

Agent 高频安全命令配方

只读查询(安全推荐)

输出到 stdout 以只读校验 AsciiDoc
asciidoctor -b html5 -o - --failure-level WARN doc.adoc > /dev/null

将 doc.adoc 渲染到 stdout 而不写入磁盘文件,出现警告时返回非零退出码。

查看已安装的 Asciidoctor 版本
asciidoctor --version

输出当前 asciidoctor 及 Ruby 运行时版本。

受控写入与预演

将 AsciiDoc 文档编译为 HTML5
asciidoctor -b html5 -a toc=left -o out.html doc.adoc

将 doc.adoc 转换为独立的 out.html 并附带左侧目录属性。

核心优势

  • + 支持 -o - 标准输出流与 --failure-level WARN,可实现零写入的语法与 include:: 校验。
  • + 内置 -S 安全沙箱模式,能限制不可信文档的 include:: 文件包含与外部 URI 读取。

注意事项与踩坑点

  • ! 无 --json 输出模式,无法结构化返回警告或 AST 信息。
  • ! 导出 PDF 或渲染内嵌图表需额外安装 Ruby gem(asciidoctor-pdf、asciidoctor-diagram)。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI