Anydocs Documents
CLI Commands

convert-import - Convert Imported Content

Turn a staged import batch in `imports/` into canonical draft pages.

`convert-import` is the second stage of legacy migration: stage the source with `import`, then materialize that batch as canonical pages and navigation entries.

Steps

  1. Run import first and capture the importId
  2. Convert the staged batch into canonical pages
  3. Review the generated drafts, navigation, and report
  4. Review page-by-page, then publish what should ship

Run import first and capture the importId

Use `import` to place the legacy directory into the staged `imports/<importId>/` area.

npx @anydocs/cli import ./legacy-docs ./my-docs-project zh

Convert the staged batch into canonical pages

Once you have the `importId`, run `convert-import` to write the batch into `pages/<lang>/` and update the target-language navigation.

npx @anydocs/cli convert-import <importId> ./my-docs-project

Review the generated drafts, navigation, and report

Check inferred `title`, `description`, and `slug` values, confirm the appended import section matches your information architecture, and inspect the conversion report and warnings.

Review page-by-page, then publish what should ship

Converted output starts as `draft`. Clean up the content in Studio or through MCP, then publish only the pages you actually want to expose.

Why the output starts as draft: Legacy content is not exposed automatically. The draft default prevents old material from entering reader and AI outputs without review.
Combining the two stages: If you want import and conversion to happen back-to-back, run `import` with `--convert`.