title: ‘Content-md command line’ description: ‘Command-line tool for browsing and validating content-md sites. Fetch pages as an AI agent, run compliance checks, and convert content to agent skills.’ date: 2026-05-18

license: ‘CC-BY-4.0’

contentmd CLI

Command-line tool for browsing and validating content-md formatted web resources — fetch URLs as an AI agent, check compliance, and convert pages to skills.

Install

Pre-built binaries for Linux, macOS, and Windows are available on GitHub Releases. No runtime required.

Browse

Fetch a URL as an AI agent would — requesting text/markdown via content negotiation, falling back to HTML on 406.

contentmd https://contentmd.org/specification/

# Multiple pages saved to a folder
contentmd --output ./pages https://contentmd.org/specification/ https://contentmd.org/consumers/

# Entire 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 Save each response as a .md file
--frontmatter-only Send Range: x-frontmatter to fetch only the frontmatter
--follow-redirect Follow HTTP redirects (reported as errors by default)

Validate

Check that a URL correctly serves content-md and report compliance.

contentmd validate https://contentmd.org/specification/

Each check is rated pass, warn, or fail. The report includes 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 within ~100 token budget
range-frontmatter Range: x-frontmatter returns only the frontmatter
title-html-match Frontmatter title matches HTML “

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

Output formats

# Machine-readable JSON
contentmd validate --format json https://contentmd.org/

# Save a baseline for later comparison
contentmd validate --save baseline.json https://contentmd.org/

# Markdown table for CI comments
contentmd validate --format markdown https://contentmd.org/

Skill

Convert a content-md page into an Agent Skill (SKILL.md).

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

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

Agent mode

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

Agent mode is auto-detected from coding agent environment variables: CLAUDE_CODE, CURSOR_AGENT, GEMINI_CLI, CODEX_SANDBOX, and more. No flag needed when running inside an AI coding agent.

- [Write content-md](https://contentmd.org/writers) - [Read content-md](https://contentmd.org/consumers) - [Reference](https://contentmd.org/reference) - [GitHub ↗](https://github.com/OneOffTech/contentmd)

</body>