molt init
Scaffold molt into a project: create the config and the .changeset/ directory, and detect the ecosystem backend and workspace layout.
Synopsis
Description
molt init is the one-time setup command. It:
- Walks up from the working directory to find the workspace root.
- Detects the ecosystem backend -- uv, Poetry, Hatch, PDM, or setuptools -- and the workspace layout (single package, or a workspace with members). See Ecosystems.
- Writes a molt config. By default molt writes a
[tool.molt]table into the rootpyproject.toml. If you prefer a standalone file, molt writes.molt/config.jsoninstead. See The config file. - Creates the
.changeset/directory with a shortREADME.mdexplaining what the folder is for.
Run interactively, molt init asks a few questions (base branch, changelog integration, whether to auto-commit changesets) and fills in sensible defaults for everything else. Run with --non-interactive, it accepts every default without prompting.
molt init is idempotent and safe to re-run. If a config already exists, molt leaves it untouched and reports that the project is already initialized. It never clobbers an existing README.md, and it creates only the pieces that are missing.
Molt refuses to run when configuration is ambiguous: if both a [tool.molt] table and a .molt/config.json file exist, molt init reports the conflict and exits 1 rather than guessing which one wins.
Options
Exit codes
Examples
Interactive setup in the current project:
Non-interactive setup for CI or a scripted bootstrap:
Initialize a project in another directory:
See also
- The config file -- what
initwrites and where. - Options reference -- every config key.
- Ecosystems -- how the backend is detected.
- Quickstart: single package and Quickstart: monorepo.