tmd import
Import external markdown files into the vault using a three-step workflow: scan, plan, execute.
Scan sources
Section titled “Scan sources”tmd import scan <paths...>Scan source directories or files for markdown content, extracting frontmatter patterns and collecting file statistics.
Example
Section titled “Example”tmd import scan ~/notes ~/docs/blogOutputs a JSON ScanResult including:
sources— each markdown file with path, size, and frontmatter keysfile_count— total markdown files founddirectories— directory structure with per-directory file countspatterns— aggregate frontmatter key statistics (frequency and sample values)existing_types— vault type schemas with their propertiesno_frontmatter_count— files without YAML frontmatter
Generate a plan
Section titled “Generate a plan”tmd import plan <classifications-file>tmd import plan classifications.json --output plan.jsonGenerate an import plan from a JSON file containing object classifications. The classifications file is a JSON array of ObjectPlan entries, typically produced by an AI analyzing a scan result.
| Flag | Short | Description |
|---|---|---|
--output | -o | Write plan to file instead of stdout |
ObjectPlan format
Section titled “ObjectPlan format”[ { "source_path": "books/clean-code.md", "type_name": "book", "name": "Clean Code", "properties": {"author": "Robert C. Martin"}, "body": "Book content here...", "conflict": "none", "depends_on": [] }]The plan command detects new types that need to be created, checks for conflicts with existing objects, and computes dependency-ordered import sequence (tags first, then independent objects, then dependent objects).
Execute a plan
Section titled “Execute a plan”tmd import execute <plan-file>Execute an import plan to create types and objects in the vault.
Execution phases
Section titled “Execution phases”- Create types — new type schemas listed in the plan
- Create objects — in dependency order, respecting conflict flags (
skipornone) - Reconcile — resolve wiki-links across all imported objects
Output
Section titled “Output”Returns a JSON ImportReport:
{ "types_created": 1, "objects_created": 8, "objects_skipped": 2, "objects_failed": 0, "details": [...], "unresolved_refs": [], "suggestions": []}AI-assisted workflow
Section titled “AI-assisted workflow”The import commands are designed for AI orchestration via the onboarding skill:
- AI runs
tmd import scanto analyze source files - AI classifies files into types and maps properties
- AI constructs the classifications JSON and generates a plan
- User reviews and approves the plan
- AI runs
tmd import executewith the approved plan
Use tmd instructions onboarding to get the full onboarding skill instructions with vault context.