@nicolaiort/shikai
v1.4.3
Published
A Conventional Commits-based release CLI
Maintainers
Readme
shikai
shikai is a Conventional Commits-based release CLI. It inspects commits since the last tag, recommends a version bump, generates a changelog, creates a release commit and annotated tag, and can push the tag to the remote.
Motivation
I created this to finally get rid of a bunch of simmilar tasks/scripts sprinkled throughout almost every repo I work in and written in a wild mixture of bash, make, taskfile and JS. It ain't much, but it frees up time wasted by broken release scripts.
Install
npm
npx @nicolaiort/shikaiOr install globally:
npm install -g @nicolaiort/shikaiGo
go install github.com/nicolaiort/shikai@latestPre-built binary
Download the binary for your platform from the latest release.
Choose the asset that matches your OS and architecture:
shikai-linux-amd64shikai-linux-arm64shikai-darwin-amd64shikai-darwin-arm64shikai-windows-amd64.exeshikai-windows-arm64.exe
After downloading, make it executable on Unix-like systems:
chmod +x shikai-*Then move it somewhere on your PATH.
Helper script
On Linux and macOS, you can install the latest matching release binary with Bash:
bash ./scripts/install-latest-release.shBy default, the script installs to ~/bin. Pass INSTALL_DIR=/some/path or a path argument to use a different location.
Configuration
Repository config
You can add an optional .shikai.yml file in the repository root to set defaults such as always pushing tags:
push: true
tag-prefix: v
template: templates/release-changelog.tpl.mdAny supported settings can be added later without changing the CLI shape, including a custom changelog template path.
Start from shikai.sample.yml in the repo root and copy it to .shikai.yml.
Set tag-prefix: "" to create plain semver tags like 1.2.3 instead of v1.2.3.
Hooks
shikai can run shell hooks from .shikai.yml:
hooks.beforehooks.after-changeloghooks.after-taghooks.after-done
Hooks are skipped during --dry-run; the CLI prints the commands it would have run instead.
Hook commands receive SHIKAI_TAG with the release tag being created.
Usage
Run the CLI from the root of the git repository you want to release:
shikaiGenerate the current release notes body for stdout:
shikai changelog > release-notes.mdPrint the full changelog for all versions:
shikai changelog --full > CHANGELOG.mdCommon flags:
--patch,--minor,--majorto pick the version bump directly--dry-runto show what would happen without changing anything--fullto print the full changelog instead of just the latest release notes--pushto push the tag without prompting--prereleaseand--prerelease-idto create a prerelease tag--changelog-pathto write the changelog somewhere other thanCHANGELOG.md--templateto use a custom git-chglog template--pushpushes the release commit and tag to the current branch remote
Example:
shikai --minorDevelopment
Build locally:
go build -o shikai .Or build for the current platform:
task buildRun tests:
go test ./...