init
Create the Relizy config of your project in a few questions, everything else is detected.
Usage
npx relizy init [options]What It Does
The init command reads your repository, asks only what it cannot guess, shows the changes it will make, then writes a minimal relizy.config.ts.
Detected for you
- Packages: Relizy does not scan the whole repository. It reads the package globs declared by your workspace (
pnpm-workspace.yaml, theworkspacesof thepackage.jsonfor npm, yarn and bun,lerna.json,rush.json,deno.json), lists the folders they match, and reads thepackage.jsonof each one: name, version andprivateflag. Without a workspace config, the project is a single package - Apps without version: added to
monorepo.ignored, Relizy only releases versioned packages - Package manager:
packageManagerfield, then the lockfile - Git provider: GitHub, GitLab or other, from the
originremote (provider releases and PR comments are turned off for the others) - Build command: a
buildscript becomespublish.buildCmd - Publish settings:
publishConfig.accessandpublishConfig.registryof the packages, used as defaults in the advanced mode - Existing config: a
relizy.config.*file or arelizykey in thepackage.json
Asked to you
Every question comes with a default deduced from the repository:
- What to release: publish packages to npm, or only version the project (bump, changelog, tag, provider release). Private packages are suggested for versioning only.
- Folders to release (monorepo with several workspace globs): the globs with publishable packages are checked.
- Version mode (monorepo):
independentwhen the packages are already on different versions,selectiveotherwise. See version modes. - Advanced options (optional): dependency bumps,
0.xbreaking changes, root changelog, hidden commit types, changelog format command, npm access, registry, build command, Twitter and Slack announcements, PR comment mode and AI release notes. - Commit linting: install the
commit-msghook runningrelizy commitlint(in.husky/when husky is set up). - Release script: add
"release": "relizy release"to thepackage.json.
Before writing anything, init shows the generated config and the list of changes (files created, package.json updates, hook), and asks for a single confirmation.
When the root package.json has no name or version, they are part of these changes: Relizy reads both. In unified and selective modes, the version is the highest version of the packages, the shared version bumped at each release. In independent mode, it is 0.0.0 and never bumped.
The generated file only contains the values that differ from the defaults:
import { defineConfig } from 'relizy'
// All the options: https://relizy.dev/config/overview
export default defineConfig({
monorepo: {
versionMode: 'selective',
packages: ['packages/*'],
ignored: ['packages/docs'],
},
publish: {
buildCmd: 'pnpm run build',
},
})At the end, init prints the next steps: installing Relizy if it is not a dependency yet, and the environment variables to set in your CI (npm, GitHub or GitLab, Twitter, Slack and AI tokens, depending on your answers).
Options
--yes
Accept the detected values without asking. Useful in scripts and for AI agents:
npx relizy init --yesThe advanced options are skipped, the commit-msg hook is installed (an existing hook is kept) and the release script is added. The command also runs without questions when there is no terminal or in CI.
--force
Replace an existing config file. Without it, init asks for confirmation, or fails with --yes:
npx relizy init --yes --forceA config file in another format (e.g. relizy.config.js) is removed so it does not take precedence over the new relizy.config.ts.
--dry-run
Print the config without writing anything:
npx relizy init --dry-run--config
Name of the config file, without .config.ts:
npx relizy init --config relizy.standalone
# Writes relizy.standalone.config.tsSee multiple configs.
Next Steps
- Preview your next release:
npx relizy release --dry-run - Fine-tune the config: configuration overview
- Set up your CI: GitHub Actions or GitLab CI