Skip to main content

Common commands

The most frequently used relctl commands. See CLI Reference for all flags and subcommands.

Create a release

relctl release create --merge-sha <sha>

Reads the current PR's branch name, computes the next SemVer version, and creates a draft GitHub Release. Run this as the first step after a merge.

Publish a release with assets

relctl release publish \
--release-id "$RELCTL_RELEASE_ID" \
--asset "file=out/myapp_linux-amd64" \
--asset "file=out/myapp_darwin-arm64"

RELCTL_RELEASE_ID is written to $GITHUB_OUTPUT by release create and can be passed between jobs.

Connect to GitHub (non-CI)

relctl connect github \
--repository my-org/my-repo \
--token ghp_your_token

Persists an encrypted .rc file for local use or Jenkins pipelines without runner-injected credentials.

Get PR info

relctl pr info
relctl pr info --merge-commit-sha <sha>

Check version

relctl --version

Dry run

Most commands accept --dry-run to simulate without writing to GitHub:

relctl release create --dry-run --merge-sha <sha>

relctl connect remove

Remove all persisted connection files and secrets.

relctl connect remove

relctl pr

Manage GitHub pull requests.

relctl pr [flags]

relctl pr info

Get pull request information for a given merge commit or PR number.

relctl pr info [flags]
FlagDescription
-c, --merge-commit-sha stringSpecify a merge commit SHA
-n, --number intOverride the pull request number

relctl release

Manage GitHub releases.

relctl release [flags]

Shared flags (available on release, release create, and release publish):

FlagDescription
-b, --body stringCustom release message — markdown string or path to a file
--dry-runSimulate without writing to Git
--hotfixCreate a hotfix release
--merge-sha stringOverride the merge commit SHA
-l, --patch-level stringOverride the SemVer bump: major, minor, or patch
--prnumber intOverride the pull request number
--release-branch stringOverride the release branch (default: repo default branch)
--release-prefix stringCustom release title prefix (default: Release / Hotfix)
--version stringOverride the computed version
-v, --verboseVerbose output

relctl release create

Compute the next SemVer version from the branch name and PR metadata, then create a GitHub release draft.

relctl release create [flags]

All shared release flags apply.

Step outputs (written to $GITHUB_OUTPUT in GitHub Actions):

VariableDescription
RELCTL_NEXT_VERSIONComputed next version
RELCTL_RELEASE_IDGitHub release ID of the draft
RELCTL_PR_SHAFull merge commit SHA
RELCTL_PR_SHA_SHORTShort (7-char) merge commit SHA

relctl release publish

Publish a previously created draft release and upload assets.

relctl release publish [flags]
FlagDescription
-a, --asset stringArrayAsset to upload. Repeatable. See formats below.
--release-id intRelease ID to publish. Falls back to RELCTL_RELEASE_ID env var.

Asset formats:

FormatDescription
file=<path>Upload a single file
zip=<dir>Zip a directory, upload as <dirname>.zip
tgz=<dir>Tar+gzip a directory, upload as <dirname>.tgz

Examples:

# Upload individual files
relctl release publish \
--release-id 12345 \
--asset "file=out/relctl_v1.2.0_linux-amd64" \
--asset "file=out/relctl_v1.2.0_darwin-arm64"

# Use env var for release ID
export RELCTL_RELEASE_ID=12345
relctl release publish \
--asset "file=out/relctl_v1.2.0_linux-amd64" \
--asset "zip=out/dist"

relctl parse

Inspect and parse JSON or YAML input. Similar to jq with additional features.

relctl parse [flags]

relctl parse json

relctl parse json [flags]
FlagDescription
-f, --file stringFile to parse
-s, --string stringInline JSON string to parse
-q, --query string(required) Query expression

relctl parse yaml

relctl parse yaml [flags]
FlagDescription
-f, --file stringFile to parse
-s, --string stringInline YAML string to parse
-q, --query string(required) Query expression

relctl parse version

Validate a version string against SemVer syntax.

relctl parse version [flags]

relctl transform

Transform input data to JSON.

relctl transform [flags]

relctl transform group-by

Group a string array by a common prefix into a JSON object.

relctl transform group-by [flags]
FlagDescription
-p, --prefix intGroup by prefix until this character index (default: 3)
--sub-prefix intStrip prefix characters up to this index from each item value

Example:

relctl transform group-by -p 3 --sub-prefix 4 \
st1_infrastructure-base st2_ubi9-openjdk-11 st2_ubi9-openjdk-17
# → {"st1":["infrastructure-base"],"st2":["ubi9-openjdk-11","ubi9-openjdk-17"]}