mdt_cli
the CLI for mdt (manage markdown templates)
mdt is a data-driven template engine for keeping documentation synchronized across your project. It uses comment-based template tags to define content once and distribute it to multiple locations — markdown files, code documentation comments (in any language), READMEs, mdbook docs, and more.
Installation
CLI Commands
mdt init [--path <dir>]— Create a sampletemplate.t.mdfile with getting-started instructions.mdt check [--path <dir>] [--verbose]— Verify all consumer blocks are up-to-date. Exits non-zero if any are stale.mdt update [--path <dir>] [--verbose] [--dry-run]— Update all consumer blocks with latest provider content.mdt lsp— Start the mdt language server (LSP) for editor integration. Communicates over stdin/stdout.mdt mcp— Start the mdt MCP server for AI assistants. Communicates over stdin/stdout.
Template Syntax
Provider tag (defines a template block in *.t.md definition files):
Content to inject
Consumer tag (marks where content should be injected):
This content gets replaced
Filters and pipes: Template values support pipe-delimited transformers:
Available transformers: trim, trimStart, trimEnd, indent, prefix, suffix, linePrefix, lineSuffix, wrap, codeBlock, code, replace, if.