Skip to content

feat: semrel config — interactive setup and config update wizard #194

@mwaldheim

Description

@mwaldheim

Summary

Add a semrel config subcommand that walks the user through creating or updating .semrel.yaml interactively, with contextual help, validation and schema-aware completion.

Motivation

Getting a correct .semrel.yaml on the first try is non-trivial: users have to know the right plugin names, available args, branch patterns, and phase values. A guided wizard lowers the barrier significantly for new adopters and reduces config mistakes.

Proposed UX

Initial setup

$ semrel config init

? Repository forge  [GitHub / GitLab / Gitea / Bitbucket / bare-git]
> GitHub

? Release branch(es)  [main]
> main

? Add a commit analyzer plugin?  [analyzer-conventional / analyzer-default / skip]
> analyzer-conventional

? Commit types triggering a minor bump  [feat]
> feat

? Commit types triggering a patch bump  [fix,perf,refactor]
> fix,perf,refactor

? Add a changelog generator?  [changelog-md / changelog-html / release-notes / skip]
> changelog-md

? Add notification hooks?  [slack / teams / matrix / email / jira / skip]
> slack

? Slack webhook URL  []
> https://hooks.slack.com/services/…

✔  .semrel.yaml written!

Update existing config

$ semrel config add-plugin
$ semrel config set branches.0.name feature/*
$ semrel config validate

Subcommands

Subcommand Description
semrel config init Full wizard to create .semrel.yaml from scratch
semrel config add-plugin Interactively append a plugin block
semrel config validate Validate the current config against the JSON Schema
semrel config set <key> <value> Set a single top-level or nested key
semrel config show Print the resolved config (after defaults are applied)

Implementation notes

  • Prompt library: github.com/charmbracelet/huh or similar terminal-form library
  • The wizard fetches available plugins from the semrel registry (/plugins.json) to offer auto-complete — works offline with a built-in fallback list
  • Generated YAML includes comments explaining each field
  • --no-interactive flag for CI (validates and exits)

Acceptance criteria

  • semrel config init wizard generates a valid .semrel.yaml
  • semrel config validate exits 0/non-zero with actionable errors
  • Works offline (offline fallback plugin list)
  • Generated file round-trips through semrel config validate without errors
  • Tests for validate subcommand with valid and invalid configs

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions