Configuration
The relizy.config.ts file, its sections, the top-level options, the tokens and their environment variables, and how to keep several configs.
Config File
// relizy.config.ts
import { defineConfig } from 'relizy'
export default defineConfig({
monorepo: {
versionMode: 'selective',
packages: ['packages/*'],
},
})The config is loaded with c12 from the root of the project and merged with the defaults. Supported files:
relizy.config.ts(recommended, typed bydefineConfig),.mts,.cts,.js,.mjs,.cjsrelizy.config.json,.yaml,.yml,.toml- the
relizyfield of the rootpackage.json
A standalone package needs no config. A monorepo needs monorepo.versionMode and monorepo.packages, or monorepo.groups (see Monorepo). Run relizy init to generate the file.
An array of the config replaces the default one instead of being merged with it: bump.dependencyTypes: ['peerDependencies'] does not keep dependencies.
Sections
| Key | Page |
|---|---|
monorepo | Monorepo |
bump | Bump |
changelog, types, includeDepsCommits, excludeAuthors, noAuthors, hideAuthorEmail | Changelog |
publish | Publish |
profiles | Profiles |
release | Release |
templates | Templates |
ai | AI |
social | Social |
prComment | PR Comment |
mergePreview | Merge Preview |
hooks | Hooks |
commitlint | Commitlint |
projectName, cwd, from, to, logLevel, safetyCheck, signTags, scopeMap, repo, tokens, detectRewrittenTags, onRewrittenTag | This page |
projectName
- Type:
string - Default: the
nameof the rootpackage.json
Name of the project in the social posts, the release titles and the AI prompts.
cwd
- Type:
string - Default:
process.cwd()
Root of the project: where the config, the packages, the git repository and the package manager are read.
from / to
- Type:
string - Default:
from: the last release tag;to: the tag of the new version, elseHEAD - CLI:
--from <ref>,--to <ref>
Git range of the commits read by the bump, the changelog, the provider release and the social posts.
logLevel
- Type:
'silent' | 'error' | 'warning' | 'normal' | 'default' | 'debug' | 'trace' | 'verbose' - Default:
'default' - CLI:
--log-level <level>
verbose shows the logs of each step, debug how relizy resolves the config, the tags and the versions.
safetyCheck
- Type:
boolean - Default:
true - CLI:
--no-safety-check
Global switch of the checks run before writing anything: the AI credentials, the tokens and the registry authentication (publish, also gated by publish.safetyCheck), the provider token (provider-release), the social credentials (social), and in relizy release the branch being up to date with its remote and the push access.
signTags
- Type:
boolean - Default:
false
Sign the release tags with GPG (git tag -s).
scopeMap
- Type:
Record<string, string> - Default:
{}
Renames the scopes of the commits in the changelogs ({ ui: 'components' }). Its keys are also allowed scopes for relizy commitlint.
repo
- Type:
{ provider?: 'github' | 'gitlab' | 'bitbucket', domain?: string, repo?: string } - Default: resolved from the
repositoryfield of the closestpackage.json, else from theoriginremote
The repository of the links of the changelogs and of the provider releases. Set it for a self-hosted instance, or when neither the repository field nor the remote is usable. When set, it replaces the detected one entirely.
| Key | Effect |
|---|---|
provider | github, gitlab or bitbucket. Detected from the domain when repo is not set |
domain | Host of the repository (github.com, gitlab.mycompany.com) |
repo | owner/name |
export default defineConfig({
repo: { provider: 'gitlab', domain: 'gitlab.mycompany.com', repo: 'team/project' },
})tokens
The credentials of the commands. Each key falls back to the first environment variable set, in this order (a .env file at the root is loaded):
| Key | Environment variables | Used by |
|---|---|---|
tokens.registry | RELIZY_NPM_TOKEN, NPM_TOKEN, NODE_AUTH_TOKEN | publish (npm, pnpm, bun) |
tokens.github | RELIZY_GITHUB_TOKEN, GITHUB_TOKEN, GH_TOKEN | GitHub releases, PR comment |
tokens.gitlab | RELIZY_GITLAB_TOKEN, GITLAB_TOKEN, GITLAB_API_TOKEN, CI_JOB_TOKEN | GitLab releases, MR comment, push |
tokens.twitter.apiKey | RELIZY_TWITTER_API_KEY, TWITTER_API_KEY | Twitter (X) |
tokens.twitter.apiKeySecret | RELIZY_TWITTER_API_KEY_SECRET, TWITTER_API_KEY_SECRET | Twitter (X) |
tokens.twitter.accessToken | RELIZY_TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN | Twitter (X) |
tokens.twitter.accessTokenSecret | RELIZY_TWITTER_ACCESS_TOKEN_SECRET, TWITTER_ACCESS_TOKEN_SECRET | Twitter (X) |
tokens.slack | RELIZY_SLACK_TOKEN, SLACK_TOKEN | Slack (bot token) |
tokens.ai['claude-code'].apiKey | RELIZY_ANTHROPIC_API_KEY, ANTHROPIC_API_KEY | AI, claude-code provider |
tokens.ai['claude-code'].oauthToken | RELIZY_CLAUDE_CODE_OAUTH_TOKEN, CLAUDE_CODE_OAUTH_TOKEN | AI, claude-code provider |
social.slack.webhookUrl | RELIZY_SLACK_WEBHOOK_URL, SLACK_WEBHOOK_URL | Slack (webhook, wins over the token) |
social.teams.webhookUrl | RELIZY_TEAMS_WEBHOOK_URL, TEAMS_WEBHOOK_URL, then their _B64 variant (base64) | Teams |
A more specific setting wins over these keys:
- registry:
tokens.registry(set by--publish-token) is the token of the default registry, each entry ofpublish.registrieshas its owntoken - provider:
tokens.githubortokens.gitlab(both set by--token).CI_JOB_TOKEN, the last fallback oftokens.gitlab, creates the GitLab releases but cannot comment the merge requests - Twitter and Slack:
social.twitter.credentialsandsocial.slack.credentials, see Social - AI:
ai.providers['claude-code'].apiKeyandoauthToken, see AI
On a local run without these variables, tokens.github is the token of the GitHub CLI when it is logged in (gh auth login, for the host of the repository): no token to create. In a GitHub Actions job, the relizy action passes the GITHUB_TOKEN of the job: no secret to create either, unless the job must push to a protected branch or trigger other workflows.
Keep the tokens out of the config file: set the environment variables in the CI (see CI/CD).
detectRewrittenTags
- Type:
boolean - Default:
true
Detect a from tag no longer reachable from to (the history was rebased after the tag was created) and recover, instead of reading the whole diverged range. See Rewritten Tags.
onRewrittenTag
- Type:
'prompt' | 'ephemeral' | 'rebind' | 'error' - Default:
promptin an interactive terminal,ephemeralotherwise (--yes, CI, no TTY)
What to do with a rewritten tag: ask, use the equivalent reachable commit for this run, move the local tag onto it (no push), or fail. See Rewritten Tags.
Multiple Configs
Several configs can coexist, named relizy.<name>.config.ts, and are selected with --config (the name without .config.<ext>):
relizy release # relizy.config.ts
relizy release --config relizy.standalone # relizy.standalone.config.ts// relizy.standalone.config.ts
import { defineConfig } from 'relizy'
export default defineConfig({
publish: { access: 'public' },
})--config also takes the path of a config file, absolute or relative to the project with its extension (--config ./release/relizy.config.ts, --config /configs/relizy.config.mjs): the project stays the current directory, only the file is read from elsewhere, e.g. a config kept out of the repository. The programmatic API takes the same name or path in configName (release({ configName: 'relizy.standalone' })), and relizy commitlint --config <name> lints with the scopes of that config. A missing config file given with --config is an error.
To release packages with different version modes (a selective set and an independent one) from the same repository, use version groups instead of two configs: a single run bumps, publishes and tags every package with the right dependency versions.