CLI

Validate and browse content-md sites

A command-line tool for interacting with content-md sites. Fetch pages as an AI agent would, run compliance checks against the spec, and convert content into agent skills.

Download from GitHub

for Windows, Linux and MacOS

Browse

Fetch pages like an AI agent.

The default command sends Accept: text/markdown and prints the content-md response. Falls back to HTML on 406. Works with single URLs, lists, or entire sitemaps.

Single page
contentmd https://contentmd.org/specification/
Multiple pages → folder
contentmd --output ./pages \
  https://contentmd.org/specification/ \
  https://contentmd.org/consumers/
Full site via sitemap
contentmd --sitemap --output ./pages \
  https://contentmd.org
Flag Description
--agent Raw markdown only, no size/token header
--sitemap Fetch /sitemap.xml and iterate every URL in it
--output <folder> Save each response as a .md file (required for multiple URLs)
--frontmatter-only Send Range: x-frontmatter to fetch only the frontmatter
--follow-redirect Follow HTTP redirects (reported as errors by default)
Validate

Check compliance against the spec.

The validate subcommand runs a full compliance report against a URL — content negotiation, caching headers, frontmatter fields, document structure, and more. Every check is rated pass, warn, or fail, with a score from 0 to 100.

Check What it verifies
content-negotiation Server returns text/markdown for Accept: text/markdown
vary-accept Response includes Vary: Accept
frontmatter-title title field present and non-empty
frontmatter-description description field present and non-empty
heading-h1 Markdown body starts with an H1
frontmatter-tokens Frontmatter is within the ~100 token budget
range-frontmatter Range: x-frontmatter returns only the frontmatter block
title-html-match Frontmatter title matches the HTML <title>

And 9 more checks — heading hierarchy, link headers, robots.txt, sitemap presence, description length, and more.

Plain output (default)
contentmd validate https://contentmd.org/specification/

Validating https://contentmd.org/specification/ ...

content-negotiation
vary-accept
frontmatter-title
frontmatter-description
heading-h1
frontmatter-tokens
! link-header — Link header not found
! html-alternate-link — rel=alternate not set

Score: 87/100

Machine-readable output

Use --format json for structured output — useful in CI pipelines or when comparing reports over time.
contentmd validate --format json https://contentmd.org/

Snapshot and diff

Save a baseline report with --save baseline.json and compare it later. Useful for tracking compliance regressions as a site evolves.
contentmd validate --save baseline.json https://contentmd.org/

CI-friendly Markdown table

Use --format markdown to generate a compliance table suitable for posting in pull request comments.
contentmd validate --format markdown https://contentmd.org/
More

Skills and agent mode.

Two more built-in features: convert any content-md page into an agent skill file, and a detection mechanism that lets AI coding agents use the CLI without extra flags.

contentmd skill Convert to agent skill

Converts a content-md page into an Agent Skill (SKILL.md) — remapping frontmatter fields and adding a source: URL reference.

Skill command
contentmd skill https://contentmd.org/specification/

# Write to a file
contentmd skill --output SKILL.md https://contentmd.org/specification/
--agent Agent mode

All three commands support --agent. When active, output is stripped of human-readable formatting: raw markdown for browse, JSON for validate, and a structured object for skill.

Auto-detected from the environment

Agent mode is implied automatically when coding agent environment variables are set — CLAUDE_CODE, CURSOR_AGENT, GEMINI_CLI, CODEX_SANDBOX, and more. No flag needed when running inside an AI coding agent.