CLI reference
The menestrel CLI runs with no install through npx menestrel <command>. Every command accepts --lang fr|en and --json.
menestrel init
Section titled “menestrel init”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. |
menestrel sync
Section titled “menestrel sync”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. |
menestrel import
Section titled “menestrel import”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. |
menestrel export
Section titled “menestrel export”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. |
menestrel pull
Section titled “menestrel pull”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. |
Exit codes
Section titled “Exit codes”| 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. |