Reference
CLI
Three commands. Two of them you'll run constantly; the third generates finetuning data.
npx mdlang <command> [options] Commands: init Scaffold mdlang.config.ts, MDLANG.md, and an example action generate Read actions/*.md and emit a typed client into actions/generated/ dataset Synthesize inputs per action, run them, and write a finetuning JSONL help Show help Options: --cwd <dir> Run against a different working directory --force For 'init': overwrite existing files --out <file> For 'dataset': output JSONL path (default: dataset.jsonl) --count <n> For 'dataset': examples per action (default: 3) --action <name> For 'dataset': only this action (repeatable or comma-separated) --live-tools For 'dataset': run real tools instead of mocking theminit
Scaffolds a config file, a system prompt, and one example action. Pass --force to overwrite files that already exist.
npx mdlang initgenerate
Reads every file in your actions directory and writes the typed client. Along the way it connects to each configured MCP server and validates that every tool an action references actually exists — actions naming an unknown server or tool are skipped with a warning.
npx mdlang generateRun it after any change to an action, to MDLANG.md, or to your config’s tool registry.
dataset
Asks your model to invent realistic inputs for each action, runs them, and appends each completed round to a JSONL file in OpenAI finetuning format.
npx mdlang dataset --count 5 --out train.jsonl| Option | Default | Effect |
|---|---|---|
--out | dataset.jsonl | Output path. |
--count | 3 | Examples generated per action. |
--action | all actions | Restrict to named actions. Repeatable, or comma-separated. |
--live-tools | off | Execute real tools instead of mocking them. |
By default tools are mocked. The model still sees each tool’s real name, description, and schema, and calls it exactly as it would in production — but the result is synthesized rather than executed. No live system is touched and nothing is written.