MarkItDown CLI
Use the installed markitdown command to convert readable local files into Markdown. Preserve source files and prefer the CLI over custom extraction code unless the user rejects it or a conversion fails for a clear reason.
Use for single-file or batch conversion, conversion checks or retries, stdin, and extensionless inputs. Do not use for summarizing without conversion, editing existing Markdown, dependency management, or standalone OCR/cloud extraction.
Workflow
- Locate inputs; inspect names, sizes, and planned output paths.
- Verify
command -v markitdown. If missing, report it, do not install without approval, and point tohttps://github.com/microsoft/markitdown#installation. - Choose output paths. Do not overwrite existing
.mdfiles unless replacement is explicit. - Run one
markitdowninvocation per input so failures are attributable. Quote paths and avoid unsafe glob assumptions. - Consult
markitdown --helpfor input-type hints when using stdin, extensionless files, or misleading filenames, and for encoding options when needed. - Spot-check Markdown for empty output, truncation, encoding problems, or missing structure. Treat unexpected defects as an unsuccessful conversion: correct a clear cause and retry; if quality cannot be recovered, report the output as failed or incomplete rather than counting it as successfully converted.
- Report converted files, skipped existing outputs, failures with exact CLI errors, and any follow-up dependency issue.
Basic usage
markitdown input.docx -o output.md
Consult CLI help for other output modes and supported conversion options.
Use --use-docintel or --use-content-understanding only for MarkItDown Markdown conversion when the user explicitly asks for that route and the required endpoint is configured.