Skip to content

CLI reference

The menestrel CLI runs with no install through npx menestrel <command>. Every command accepts --lang fr|en and --json.

Wires an existing Astro site: writes cms.config.ts, an unversioned .env, and prints the snippets to paste into the Astro config and the layout. Writes are idempotent, a second run breaks nothing.

Option Description
--token <cmt_...> Project admin token, dropped into the .env.
--yes Does not prompt, accepts the default writes.

Pushes the schema described in cms.config.ts to the server.

Option Description
--config <file> Config path (default cms.config.ts).
--rename <a=b> Declares a collection or field rename. Repeatable.
--dry-run Prints the diff without pushing.
--allow-deletions Allows destructive deletions (otherwise refused, exit 3).
--yes Does not prompt before pushing.

Migrates an existing site: scans src/content/ and src/data/, maps onto the schema, uploads deduplicated media, creates and publishes the entries. Resumable after an interruption.

Option Description
--config <file> Config path.
--input <dir> Root to scan (default: the current directory).
--dry-run Scans and maps without writing anything.
--yes Runs the import with no confirmation.

Gets your content out: content/ as Markdown, data/ as verbatim JSON, media/ with originals, plus a bilingual README.

Option Description
--out <dir> Output directory (default ./menestrel-export). Alias: --output.
--no-media Does not export binaries, the reference is kept.

Downloads the published snapshot into .menestrel/snapshot/ for an offline build.

Option Description
--output <dir> Target directory (default .menestrel/snapshot).
--snapshot-id <snap_...> Pins a specific snapshot instead of the latest published.
--demo Writes a demo fixture, with no network and no token.
Code Meaning
0 Success.
1 Internal or network error.
2 Invalid config.
3 Deletion refused without --allow-deletions.
4 Version conflict or migration in progress.
5 Authentication: missing or invalid token, or project mismatch.