CLI Commands
preview - Local Preview
Learn how to use the preview command to preview documents locally.
`preview` is the reader-view check before delivery. It starts the local reader server so you can verify published routes, navigation, and rendering instead of looking at the authoring view in Studio.
When to Use It
- the page is finished and already set to `published`
- you want to confirm the default language and reader entry route
- you want a final check before `build` or deployment
Command
npx @anydocs/cli preview ./my-docs`preview` is already live by default. `--watch` is only a compatibility flag.
What You Should Expect
- the project structure and config are validated first
- the service reads the default language
- the default entry jumps to the first published page; if none exists yet, it falls back to `/{lang}`
- the terminal prints the Preview URL
- on-disk changes to published content are reflected in the reader
The Most Common Misunderstanding
Seeing a page in Studio does not mean it will appear in preview. `preview` serves only `published` pages; `draft` and `in_review` do not appear.