Doctor and Inspect Readiness
Use doctor and inspect readiness output to decide whether preview, convert, upload, or draft creation is ready before running a publish workflow.
Doctor and Inspect Readiness
md2wechat 2.4.0 gives agents a clearer way to decide what is ready before they convert, upload, or create a WeChat draft.
The short rule is:
use doctor --json to check local setup, then use inspect --json to check one article.
What each command answers
| Command | Use it for | Do not treat it as |
|---|---|---|
md2wechat doctor --json | local configuration readiness | proof that one article can be published |
md2wechat inspect article.md --json | article-level target readiness | a full account login or live upload test |
doctor is local-only. It checks whether the current machine looks configured enough to attempt conversion, image generation, or WeChat draft work.
inspect checks a specific Markdown file and reports whether the requested targets are ready, blocked, degraded, or not requested.
Recommended order
For a new runtime or upgraded install, start here:
md2wechat version --json
md2wechat doctor --json
md2wechat capabilities --jsonFor an article workflow, continue with:
md2wechat inspect article.md --json
md2wechat preview article.md
md2wechat convert article.mdFor draft creation, inspect the draft target before creating the draft:
md2wechat inspect article.md --draft --cover cover.jpg --json
md2wechat convert article.md --draft --cover cover.jpgThe readiness contract
New agents should prefer these fields from inspect --json:
{
"data": {
"readiness": {
"schema_version": "1",
"targets": {
"preview": "ready",
"convert": "ready",
"upload": "not_requested",
"draft": "blocked"
},
"blockers": [
{
"code": "MISSING_COVER",
"target": "draft"
}
]
}
}
}The older fields are still available:
convert_readyupload_readydraft_readypreview_fidelity
But targets and blockers are the better surface for agents because they explain what is blocked and where.
Common blockers
| Blocker | Usually means | Next check |
|---|---|---|
MISSING_API_KEY | API mode cannot run yet | check md2wechat doctor --json and config |
LOCAL_IMAGE_MISSING | the Markdown points to a missing local image | fix the image path or remove it |
MISSING_COVER | draft creation needs a cover | pass --cover or --cover-media-id |
Safe agent behavior
When building an agent workflow, do this:
- Run
doctor --jsonbefore API-dependent work. - Run the smallest discovery commands needed for the task.
- Run
inspect --jsonfor the article. - If a target is blocked, stop that target and report the blocker.
- Preview before conversion or draft creation when the user has not seen the output.
This keeps automation from guessing and makes failures easier to explain.