Skip to content

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 ​

ts
// 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 by defineConfig), .mts, .cts, .js, .mjs, .cjs
  • relizy.config.json, .yaml, .yml, .toml
  • the relizy field of the root package.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 ​

KeyPage
monorepoMonorepo
bumpBump
changelog, types, includeDepsCommits, excludeAuthors, noAuthors, hideAuthorEmailChangelog
publishPublish
profilesProfiles
releaseRelease
templatesTemplates
aiAI
socialSocial
prCommentPR Comment
mergePreviewMerge Preview
hooksHooks
commitlintCommitlint
projectName, cwd, from, to, logLevel, safetyCheck, signTags, scopeMap, repo, tokens, detectRewrittenTags, onRewrittenTagThis page

projectName ​

  • Type: string
  • Default: the name of the root package.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, else HEAD
  • 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 repository field of the closest package.json, else from the origin remote

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.

KeyEffect
providergithub, gitlab or bitbucket. Detected from the domain when repo is not set
domainHost of the repository (github.com, gitlab.mycompany.com)
repoowner/name
ts
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):

KeyEnvironment variablesUsed by
tokens.registryRELIZY_NPM_TOKEN, NPM_TOKEN, NODE_AUTH_TOKENpublish (npm, pnpm, bun)
tokens.githubRELIZY_GITHUB_TOKEN, GITHUB_TOKEN, GH_TOKENGitHub releases, PR comment
tokens.gitlabRELIZY_GITLAB_TOKEN, GITLAB_TOKEN, GITLAB_API_TOKEN, CI_JOB_TOKENGitLab releases, MR comment, push
tokens.twitter.apiKeyRELIZY_TWITTER_API_KEY, TWITTER_API_KEYTwitter (X)
tokens.twitter.apiKeySecretRELIZY_TWITTER_API_KEY_SECRET, TWITTER_API_KEY_SECRETTwitter (X)
tokens.twitter.accessTokenRELIZY_TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKENTwitter (X)
tokens.twitter.accessTokenSecretRELIZY_TWITTER_ACCESS_TOKEN_SECRET, TWITTER_ACCESS_TOKEN_SECRETTwitter (X)
tokens.slackRELIZY_SLACK_TOKEN, SLACK_TOKENSlack (bot token)
tokens.ai['claude-code'].apiKeyRELIZY_ANTHROPIC_API_KEY, ANTHROPIC_API_KEYAI, claude-code provider
tokens.ai['claude-code'].oauthTokenRELIZY_CLAUDE_CODE_OAUTH_TOKEN, CLAUDE_CODE_OAUTH_TOKENAI, claude-code provider
social.slack.webhookUrlRELIZY_SLACK_WEBHOOK_URL, SLACK_WEBHOOK_URLSlack (webhook, wins over the token)
social.teams.webhookUrlRELIZY_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 of publish.registries has its own token
  • provider: tokens.github or tokens.gitlab (both set by --token). CI_JOB_TOKEN, the last fallback of tokens.gitlab, creates the GitLab releases but cannot comment the merge requests
  • Twitter and Slack: social.twitter.credentials and social.slack.credentials, see Social
  • AI: ai.providers['claude-code'].apiKey and oauthToken, 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: prompt in an interactive terminal, ephemeral otherwise (--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>):

bash
relizy release                             # relizy.config.ts
relizy release --config relizy.standalone  # relizy.standalone.config.ts
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.