Skip to content

feat: add semrel doctor command for pre-flight validation #191

@mwaldheim

Description

@mwaldheim

Summary

A semrel doctor command that validates the local environment before a release is attempted would catch configuration issues early and improve the developer experience.

Motivation

Currently, errors during semrel release only surface at runtime — often after the pipeline has already started. A dedicated validation command would let users verify their setup during development or in CI before any release step is executed.

Proposed behaviour

$ semrel doctor
✔  .semrel.yaml found and valid
✔  plugin: provider-github     found at ~/.semrel/plugins/semrel-plugin-provider-github (v1.3.0)
✔  plugin: updater-npm         found at ~/.semrel/plugins/semrel-plugin-updater-npm (v1.1.0)
✗  plugin: hook-slack          NOT FOUND — expected at ~/.semrel/plugins/semrel-plugin-hook-slack or $PATH
⚠  GITHUB_TOKEN                not set — provider-github will fail at runtime
✔  git repository              detected (branch: main, tag: v1.2.3)

Exit code 0 = all checks pass, non-zero = one or more checks failed.

Checks to include

  • .semrel.yaml exists and passes schema validation
  • Each configured plugin binary is discoverable (~/.semrel/plugins/ or $PATH)
  • Required environment variables declared by plugins are set
  • Current branch matches a configured release branch
  • Git repository is reachable and at least one tag exists
  • --fix flag suggestion for actionable issues (e.g. semrel plugin install hook-slack)

Acceptance criteria

  • semrel doctor exits 0 when everything is fine, non-zero otherwise
  • Output is human-readable in a terminal and parseable with --output-format json
  • Works offline (no network calls) by default; --online flag optionally pings provider APIs

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