@dualmark/cli

中文文档
0.11.0发布于 2026/08/24Apache-2.0TypeScriptESM + CJS构建来源已验证近 30 天下载 5206

Conformance test runner for the AEO spec. dualmark verify <url> scores any site against the AEO Specification.

原始使用文档
文档目录8 节
  1. Install
  2. Usage
  3. Flags
  4. JSON output schema (AEO Spec v1.0)
  5. Exit codes
  6. Programmatic usage
  7. What's checked
  8. License

@dualmark/cli

dualmark verify <url> — conformance test runner for the AEO Specification.

Install

bun add -d @dualmark/cli
# or run directly:
bunx @dualmark/cli verify https://example.com/blog/hello

Usage

dualmark verify https://example.com/blog/hello
dualmark verify https://example.com/blog/hello.md --skip-negotiation
dualmark verify https://example.com --json
dualmark verify https://example.com --timeout 5000

Flags

FlagEffect
--jsonEmit machine-readable JSON (AEO Spec v1.0) instead of human-readable text; cannot be combined with --quiet or --color
--quietSuppress successful text output (failures still print report)
--colorEnable color mode for text output (reserved; currently no-op)
--no-colorDisable color mode for text output (reserved; currently no-op)
--skip-negotiationSkip Accept-header / Link-header / 406 checks. Use against sites that serve markdown only at .md URLs without runtime content negotiation (e.g. static-only deploys)
--timeout <ms>Per-request timeout (default 10000)

JSON output schema (AEO Spec v1.0)

When --json is set, the CLI prints this object:

{
  "url": "https://example.com/blog/hello",
  "markdownUrl": "https://example.com/blog/hello.md",
  "score": 95,
  "max": 100,
  "level": "advanced",
  "skippedNegotiation": false,
  "durationMs": 123,
  "checks": [
    {
      "id": "md.fetch",
      "points": 20,
      "max": 20,
      "passed": true,
      "message": "OK"
    }
  ]
}

Notes:

  • level is one of none, basic, standard, advanced.
  • skippedNegotiation indicates whether --skip-negotiation was used.
  • checks[].points is 0 when a check fails, otherwise equal to checks[].max.
  • checks preserve the canonical check evaluation order from the conformance runner.

Exit codes

  • 0 — pass (score ≥ 80% of max)
  • 1 — fail (below threshold or any required check failed)
  • 2 — CLI usage error

For GitHub Actions, GitLab CI, and Docker examples, see the Use in CI guide.

Programmatic usage

import { verifyUrl } from "@dualmark/cli";
const report = await verifyUrl("https://example.com/blog/hello");
console.log(report.score, "/", report.maxScore);

What's checked

  • md.fetch — markdown twin URL is reachable (2xx)
  • md.contentType — text/markdown; charset=utf-8
  • md.tokensHeader — X-Markdown-Tokens is a positive integer
  • md.noindex — X-Robots-Tag includes noindex
  • md.vary — Vary includes Accept
  • md.body — body is non-empty
  • md.aeoVersion — X-AEO-Version advertised (recommended)
  • md.nosniff — X-Content-Type-Options: nosniff (recommended)

When negotiation is enabled (default):

  • html.reachable — HTML URL is 2xx
  • html.linkAlternate — HTML response advertises markdown twin via Link rel="alternate"
  • html.vary — HTML response Vary: Accept (recommended)
  • negotiation.botUa — GPTBot UA receives markdown
  • negotiation.acceptHeader — Accept: text/markdown receives markdown
  • negotiation.notAcceptable — Accept that excludes html+markdown returns 406 (recommended)

License

Apache 2.0

版本与发布记录

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

版本发布日期距今
0.11.0latest2026/08/242 个月前
0.10.02026/06/184 个月前
0.8.02026/05/305 个月前
0.7.02026/05/215 个月前
0.5.22026/05/126 个月前
0.5.02026/05/076 个月前

关于 @dualmark/cli 的常见问题

@dualmark/cli 是什么?

Conformance test runner for the AEO spec. dualmark verify <url> scores any site against the AEO Specification.

如何安装 @dualmark/cli?

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

@dualmark/cli 支持 TypeScript 吗?

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

@dualmark/cli 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@dualmark/cli 需要什么版本的 Node.js?

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

@dualmark/cli 可以商用吗?

@dualmark/cli 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@dualmark/cli 的下载量有多少?

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

@dualmark/cli 还在维护吗?

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