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 to https://github.com/microsoft/markitdown#installation.
- Choose output paths. Do not overwrite existing
.md files unless replacement is explicit.
- Run one
markitdown invocation per input so failures are attributable. Quote paths and avoid unsafe glob assumptions.
- Consult
markitdown --help for 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.
1---2name: markitdown-cli3description: Use when converting local document files such as PDFs, Office documents, HTML, text, or other MarkItDown-supported inputs into Markdown.4---56# MarkItDown CLI78Use 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.910Use 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.1112## Workflow13141. Locate inputs; inspect names, sizes, and planned output paths.152. Verify `command -v markitdown`. If missing, report it, do not install without approval, and point to `https://github.com/microsoft/markitdown#installation`.163. Choose output paths. Do not overwrite existing `.md` files unless replacement is explicit.174. Run one `markitdown` invocation per input so failures are attributable. Quote paths and avoid unsafe glob assumptions.185. Consult `markitdown --help` for input-type hints when using stdin, extensionless files, or misleading filenames, and for encoding options when needed.196. 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.207. Report converted files, skipped existing outputs, failures with exact CLI errors, and any follow-up dependency issue.2122## Basic usage2324```bash25markitdown input.docx -o output.md26```2728Consult CLI help for other output modes and supported conversion options.2930Use `--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.