pub enum Commands {
Init,
Check {
diff: bool,
format: OutputFormat,
},
Update {
dry_run: bool,
watch: bool,
},
List,
Lsp,
Mcp,
}Variants§
Init
Initialize mdt in a project by creating a sample template file.
Creates a template.t.md file in the project root with example provider
blocks and usage instructions. If the file already exists, this command
is a no-op and exits successfully.
Check
Check that all consumer blocks are up to date.
Scans all files in the project for consumer blocks and compares their current content against what the matching provider would produce. Exits with a non-zero status code if any consumer blocks are stale.
Ideal for CI pipelines to enforce documentation synchronization. Use
--diff to see exactly what changed and --format to control the
output style.
Fields
diff: boolShow a unified diff for each stale consumer block, highlighting the differences between current and expected content.
format: OutputFormatOutput format for check results. Use text for human-readable
output, json for programmatic consumption, or github for
GitHub Actions annotations that appear inline on PRs.
Update
Update all consumer blocks with the latest provider content.
Reads provider blocks from *.t.md template files, renders any
template variables using data from mdt.toml, applies transformers,
and replaces matching consumer block content in all scanned files.
Use --dry-run to preview changes without writing to disk, or
--watch to automatically re-run whenever source files change.
Fields
List
List all provider and consumer blocks in the project.
Displays every provider block (from *.t.md files) and consumer block
found across the project, along with file paths and block names. Useful
for auditing template coverage and discovering orphaned consumers.
Lsp
Start the mdt language server (LSP).
Communicates over stdin/stdout using the Language Server Protocol.
Configure your editor to run mdt lsp as the language server
command for markdown and template files.
Provides diagnostics for stale consumers, auto-completion of block names, hover information, and go-to-definition from consumers to their providers.
Mcp
Start the mdt MCP (Model Context Protocol) server.
Communicates over stdin/stdout using the Model Context Protocol.
Configure your AI assistant to run mdt mcp as an MCP server
to give it structured access to mdt’s template system.
Exposes tools for checking, updating, and listing template blocks, allowing AI assistants to manage documentation synchronization.
Trait Implementations§
Source§impl FromArgMatches for Commands
impl FromArgMatches for Commands
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Commands
impl Subcommand for Commands
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommand