@docmd/core

中文文档
0.9.9发布于 2026/11/04MITTypeScriptES Module构建来源已验证近 30 天下载 8万

Documentation compiler for humans and machines. One Markdown source, one command — generates website, search, AI context, and knowledge formats together.

原始使用文档
文档目录18 节
  1. Quick Start
  2. One Source. Every Output.
  3. Why docmd?
  4. Features
  5. Zero config, instant start
  6. Lightweight by default, fast everywhere
  7. AI & agent-ready
  8. Built to scale
  9. AI Assistant & Cloud Relay
  10. CLI
  11. Plugins
  12. Configuration
  13. Programmatic API
  14. Migration
  15. Open Source
  16. Community
  17. Support docmd
  18. License
docmd

Documentation for humans and machines.
One Markdown source → website, search, AI context, agents, and knowledge formats.

npm version monthly downloads GitHub stars license

Website  ·  Documentation  ·  Cloud Relay  ·  Live Editor  ·  Agent Skills  ·  Issues


docmd documentation — light and dark mode preview

Quick Start

Point docmd at a folder of Markdown files:

npx @docmd/core dev

Open http://localhost:3000.

That's it. Navigation is generated from your file structure. No config file, frontmatter, or framework required.

When you're ready to deploy:

npx @docmd/core build

docmd generates a static site that can be deployed to Vercel, Cloudflare Pages, Netlify, GitHub Pages, S3, NGINX, Caddy, or any other static host.

Requires Node.js 20+.

Global installation and Docker

Install globally:

npm install -g @docmd/core

# or
pnpm add -g @docmd/core

Then:

docmd dev
docmd build

Or run with Docker:

docker run -p 3000:3000 ghcr.io/docmd-io/docmd:latest

Pin the Docker image to a specific release for reproducible production builds.

One Source. Every Output.

docmd is an open source documentation compiler.

Instead of treating your Markdown as input for a website alone, docmd compiles the same source into outputs for readers, search engines, LLMs, coding agents, and knowledge systems.

Markdown
   │
   ▼
 docmd
   │
   ├── → Static documentation site
   ├── → Offline search index
   ├── → llms.txt / llms-full.txt
   ├── → Open Knowledge Format (OKF)
   ├── → Sitemap + SEO metadata
   ├── → robots.txt + Open Graph
   ├── → MCP interface for AI agents
   └── → AI Assistant context

One source tree. One build pipeline. No separate documentation and AI knowledge stacks to maintain.

Why docmd?

Documentation increasingly has more than one reader.

People need a fast, navigable website. Search engines need structured metadata. LLMs need clean context. Coding agents need tools and protocols. RAG systems need structured knowledge.

docmd builds these together while keeping Markdown at the centre.

docmd comparison with other documentation tools
See the complete comparison with Docusaurus, Mintlify and other documentation tools →

Features

Zero config, instant start

Point docmd at any Markdown folder and it runs. Navigation is generated automatically from your file structure — no boilerplate, frontmatter, or build pipeline required to get started.

Lightweight by default, fast everywhere

docmd generates static HTML with minimal vanilla JavaScript and fast SPA-style navigation. Offline full-text search, sitemap, canonical URLs, Open Graph metadata, and other essentials are built into the output.

AI & agent-ready

docmd treats machine-readable documentation as part of the build, not a separate publishing workflow.

  • AI Assistant — RAG-powered chat grounded in your documentation
  • MCP Server — lets compatible coding agents search, read, and validate your docs
  • llms.txt / llms-full.txt — complete LLM-readable documentation context
  • Open Knowledge Format (OKF) — structured knowledge bundles for AI and RAG systems
  • Agent Skills — reusable instructions for LLMs and coding agents
  • Copy as Markdown / Copy Context — clean context extraction directly from the browser
  • Semantic search — optional vector retrieval alongside built-in keyword search

Built to scale

  • Internationalisation with locale-aware search and generated outputs
  • Versioning for multiple documentation releases
  • Workspaces for monorepos and multi-project setups
  • OpenAPI 3.x rendering for API documentation
  • Built-in templates, custom CSS/JavaScript, and light/dark mode

AI Assistant & Cloud Relay

docmd includes a RAG-powered AI Assistant grounded in your documentation.

You can connect it to your own backend or local AI provider. If your documentation is deployed as a static site, docmd Cloud Relay provides the hosted bridge instead.

Your documentation
        │
        ▼
 @docmd/plugin-ai
        │
        ▼
 docmd Cloud Relay
        │
        ▼
 Your AI provider

Cloud Relay securely sends AI requests to the provider you choose, so provider credentials do not need to be shipped to the browser and you do not need to operate an AI backend.

Cloud Relay is free to use with your own AI provider key.

  • Bring your own provider and model
  • Keep provider credentials off the client
  • Works with static hosting
  • No AI backend to deploy or maintain
  • Usage visibility and reader-question insights
  • Connect multiple documentation projects from one account

Set up Cloud Relay → • AI Assistant documentation →

The Cloud Relay is free. Model usage may be charged separately by your chosen AI provider.

CLI

docmd dev            # Start the local development server
docmd build          # Build for production
docmd live           # Start the browser-based Live Editor
docmd init           # Create a configuration file
docmd doctor         # Check configuration and plugin status
docmd validate       # Check internal documentation links
docmd migrate        # Migrate from Docusaurus, VitePress, MkDocs, or Starlight
docmd deploy         # Generate deployment configuration
docmd mcp            # Run the MCP server over stdio
docmd add <name>     # Install a plugin or template
docmd stop           # Stop running docmd development servers

See complete CLI Commands →

Plugins

docmd is built around a plugin system. Common documentation capabilities ship with core, while optional plugins can be installed when needed.

PluginStatusDescription
aiCoreRAG-powered AI Assistant with BYOK, local providers, and Cloud Relay
searchCoreOffline keyword search with optional semantic search
seoCoreSEO and Open Graph metadata
sitemapCoreGenerates sitemap.xml
gitCoreGit history and last-updated metadata
analyticsCoreLightweight analytics integration
llmsCoreGenerates llms.txt and llms-full.txt
okfCoreOpen Knowledge Format bundles
mermaidCoreMermaid diagram rendering
openapiCoreOpenAPI 3.x documentation renderer
pwaOptionalProgressive Web App and offline navigation
threadsOptionalInline documentation discussions (by @svallory)
mathOptionalKaTeX / LaTeX rendering

Install an optional plugin:

docmd add <plugin-name>

Build your own: Plugin Development Guide →

Configuration

Configuration is optional.

Add docmd.config.json, docmd.config.ts, or docmd.config.js in your project root when you need more control:

{
  "title": "My Project",
  "url": "https://docs.myproject.com",
  "src": "./docs",
  "out": "./dist"
}

TypeScript and JavaScript configurations can be used when dynamic values are required.

Configuration reference →

Programmatic API

Use docmd from Node.js scripts, CI pipelines, or custom build systems.

import { build } from '@docmd/core';

// Build documentation programmatically.
await build('./docmd.config.json', { isDev: false });

CommonJS and ESM are supported.

Node API reference →

Migration

Existing documentation does not need to start from scratch.

docmd migrate

Migration tooling is available for supported documentation frameworks including Docusaurus, VitePress, MkDocs, and Starlight.

Migration documentation →

Open Source

Your documentation is the intellectual heart of your project. It belongs in plain Markdown files in your Git repository — portable, version-controlled and auditable.

The docmd compiler and official core plugins are MIT-licensed and will remain free to use, with no paywalled compiler features.

Generated documentation can be hosted anywhere and does not require docmd-hosted infrastructure.

Community

Support docmd

If docmd is useful to you:

  • Give the repository a ⭐
  • Share it with someone building documentation
  • Open issues, contribute fixes, or build a plugin
  • Sponsor development on GitHub

License

MIT License. See LICENSE for details.

版本与发布记录

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

版本发布日期距今
0.9.9latest2026/11/049 天前
0.9.82026/10/1727 天前
0.9.72026/09/271 个月前
0.9.62026/09/211 个月前
0.9.52026/09/082 个月前
0.9.42026/08/242 个月前

关于 @docmd/core 的常见问题

@docmd/core 是什么?

Documentation compiler for humans and machines. One Markdown source, one command — generates website, search, AI context, and knowledge formats together.

如何安装 @docmd/core?

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

@docmd/core 支持 TypeScript 吗?

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

@docmd/core 支持 ESM 还是 CommonJS?

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

@docmd/core 需要什么版本的 Node.js?

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

@docmd/core 可以商用吗?

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

@docmd/core 的下载量有多少?

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

@docmd/core 还在维护吗?

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