#markdown #markdown-template #template #template-cli

bin+lib mdt_cli

the cli which updates markdown content anywhere using comments as template tags

6 releases (3 breaking)

Uses new Rust 2024

0.7.0 Mar 2, 2026
0.6.0 Feb 27, 2026
0.4.1 Feb 25, 2026
0.2.1 Feb 24, 2026

#144 in Template engine

40 downloads per month

Unlicense and GPL-3.0-only

1MB
19K SLoC

mdt_cli

the CLI for mdt (manage markdown templates)


Crate Docs Status Coverage Unlicense


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

cargo install mdt_cli@0.7.0

CLI Commands

  • mdt init [--path <dir>] — Create a sample template.t.md file 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 info [--path <dir>] — Print project diagnostics and cache observability metrics.
  • mdt doctor [--path <dir>] [--format text|json] — Run health checks with actionable hints, including cache validity and efficiency.
  • 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.

Diagnostics Workflow

  • Run mdt info first to inspect project shape, diagnostics totals, and cache reuse telemetry.
  • Run mdt doctor when you need actionable health checks and remediation hints (config/data/layout/cache).
  • Use MDT_CACHE_VERIFY_HASH=1 when troubleshooting cache consistency issues and comparing reuse behavior.

Template Syntax

Provider tag (defines a template block in *.t.md definition files):

<!-- {@blockName} -->

Content to inject

<!-- {/blockName} -->

Consumer tag (marks where content should be injected):

<!-- {=blockName} -->

This content gets replaced

<!-- {/blockName} -->

Inline tag (provider-free interpolation using configured data):

Current version: <!-- {~version:"{{ package.version }}"} -->0.0.0<!-- {/version} -->
| Artifact | Version                                                                   |
| -------- | ------------------------------------------------------------------------- |
| mdt_cli  | <!-- {~cliVersion:"{{ package.version }}"} -->0.0.0<!-- {/cliVersion} --> |

Filters and pipes: Template values support pipe-delimited transformers:

<!-- {=block|prefix:"\n"|indent:"  "} -->

Available transformers: trim, trimStart, trimEnd, indent, prefix, suffix, linePrefix, lineSuffix, wrap, codeBlock, code, replace, if.

Dependencies

~28–46MB
~615K SLoC