= JReleaser CLI

Executes a JReleaser workflow as a command-line interface (CLI).

[source]
----
$ jreleaser -h
Usage: jreleaser [-hV] [COMMAND]
jreleaser
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  init          Create a jreleaser config file.
  config        Display current configuration.
  template      Generate a tool/announcer template.
  assemble      Assemble distributions.
  changelog     Calculate the changelog.
  checksum      Calculate checksums.
  sign          Sign release artifacts.
  upload        Uploads all artifacts.
  release       Create or update a release..
  prepare       Prepare all distributions.
  package       Package all distributions.
  publish       Publish all distributions.
  announce      Announce a release.
  full-release  Perform a full release.
----

== Install

[tabs]
====
Windows::
+
--
*sdkman*
[source]
----
sdk install jreleaser
----

*manually*

Download the pre-compiled binary from the link:https://github.com/jreleaser/jreleaser/releases[releases page],
uncompress and copy to the desired location.
--
Linux::
+
--
*sdkman*
[source]
----
sdk install jreleaser
----

*manually*

Download the pre-compiled binary from the link:https://github.com/jreleaser/jreleaser/releases[releases page],
uncompress and copy to the desired location.
--
Mac::
+
--
*homebrew tap*
[source]
----
brew install jreleaser/tap/jreleaser
----

*sdkman*
[source]
----
sdk install jreleaser
----

*manually*

Download the pre-compiled binary from the link:https://github.com/jreleaser/jreleaser/releases[releases page],
uncompress and copy to the desired location.
--
====

== Configuration

JReleaser must be configured using the YAML, TOML, or JSON DSLs shown at xref:configuration:index.adoc[].

== Commands

The following commands are supported:

=== init

[source]
----
$ jreleaser init -h
Usage: jreleaser init [-dhioqVw] [-b=<basedir>] [-f=<format>]
Create a jreleaser config file.
  -b, --basedir=<basedir>   Base directory.
  -d, --debug               Set log level to debug.
  -f, --format=<format>     Configuration file format.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
  -o, --overwrite           Overwrite existing files.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
----

Currently supported formats are: `yml`, `json`.

The file will be generated at `<basedir>` if specified, otherwise at the current directory.

=== config

[source]
----
$ jreleaser config -h
Usage: jreleaser config [-adfhiqVw] [-b=<basedir>] [-c=<configFile>]
Display current configuration.
  -a, --assembly            Display assembly configuration.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
  -f, --full                Display full configuration.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

=== template

[source]
----
$ jreleaser template -h
Usage: jreleaser template [-dhioqsVw] [-b=<basedir>] ([-an=<announcerName>] |
                          [-dn=<distributionName> -tn=<toolName>
                          [-dt=<distributionType>]])
Generate a tool/announcer template.
  -b, --basedir=<basedir>   Base directory.
  -d, --debug               Set log level to debug.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
  -o, --overwrite           Overwrite existing files.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -s, --snapshot            Use snapshot templates.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
Announcer templates
      -an, --announcer-name=<announcerName>
                            The name of the announcer.
Tool templates
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
      -dt, --distribution-type=<distributionType>
                            The type of the distribution.
      -tn, --tool-name=<toolName>
                            The name of the tool.
----

If `--basedir` is undefined then the command assumes it's the current directory.

Announcer and tool settings are mutually exclusive.

The value of `--announcer-name` must match any of the available xref:configuration:announce/index.adoc[announcers].

The value of `--distribution-name` must match the name of a configured
xref:configuration:distributions.adoc[distribution].

The value of `--distribution-type` must match any of the available
xref:ROOT:distributions/index.adoc[distribution types].

The value of `--tool-name` must match any of the available xref:configuration:packagers/index.adoc[].

=== assemble

[source]
----
$ jreleaser assemble -h
Usage: jreleaser assemble [-dhiqVw] [-an=<assemblerName>] [-b=<basedir>]
                          [-c=<configFile>] [-dn=<distributionName>]
Assemble distributions.
      -an, --assembler-name=<assemblerName>
                            The name of the assembler.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

The value of `--assembler-name` must match any of the available xref:configuration:assemble/index.adoc[assemblers].

The value of `--distribution-name` must match the name of a configured found in the
xref:configuration:assemble/index.adoc[assemblers] section.

This command must be invoked separatedly from the others as some of the assmeblers are platform specific.

=== changelog

[source]
----
$ jreleaser changelog -h
Usage: jreleaser changelog [-dhiqVw] [-b=<basedir>] [-c=<configFile>]
Calculate the changelog.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

=== checksum

[source]
----
$ jreleaser checksum -h
Usage: jreleaser checksum [-dhiqVw] [-b=<basedir>] [-c=<configFile>]
Calculate checksums.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

=== sign

[source]
----
$ jreleaser sign -h
Usage: jreleaser sign [-dhiqVw] [-b=<basedir>] [-c=<configFile>]
Sign release artifacts.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

=== upload

[source]
----
Usage: jreleaser upload [-dhiqVwy] [-b=<basedir>] [-c=<configFile>]
                        [-un=<uploaderName>] [-ut=<uploaderType>]
Uploads all artifacts.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
      -un, --uploader-name=<uploaderName>
                            The name of the uploader.
      -ut, --uploader-type=<uploaderType>
                            The type of the uploader.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

The value of `--uploader-type` must match the type of a configured xref:configuration:upload/index.adoc[uploader].

The value of `--uploader-name` must match any of the available xref:configuration:upload/index.adoc[uploaders].

NOTE: Use `-y` or `--dryrun` during development to verify your configuration settings. No network uploads nor repository
mutations should occur when this mode is activated.

You may invoke this command in the following ways:

Upload all artifacts:
[source]
----
$ jreleaser upload
----

Upload all artifacts to all configured Artifactory uploaders:
[source]
----
$ jreleaser upload --uploader-type artifactory
----

Upload all artifacts with all uploaders with matching name:
[source]
----
$ jreleaser upload --uploader-name mine
----

Upload all artifacts to a matching Artifactory uploader:
[source]
----
$ jreleaser upload --uploader-type artifactory --uploader-name mine
----

=== release

[source]
----
$ jreleaser release -h
Usage: jreleaser release [-dhiqVwy] [--auto-config] [--changelog-formatted]
                         [--draft] [--overwrite] [--prerelease]
                         [--signing-armored] [--signing-enabled] [--skip-tag]
                         [--update] [-b=<basedir>] [--branch=<branch>]
                         [-c=<configFile>] [--changelog=<changelog>]
                         [--commit-author-email=<commitAuthorEmail>]
                         [--commit-author-name=<commitAuthorName>]
                         [--milestone-name=<milestoneName>] [-od=<outputdir>]
                         [--project-name=<projectName>]
                         [--project-snapshot-pattern=<projectSnapshotPattern>]
                         [--project-version=<projectVersion>]
                         [--project-version-pattern=<projectVersionPattern>]
                         [--release-name=<releaseName>] [--tag-name=<tagName>]
                         [--username=<username>] [--file=<files>]...
                         [--glob=<globs>]...
                         [--update-section=<updateSections>]...
Create or update a release..
      --auto-config          Model auto configuration..
  -b, --basedir=<basedir>    Base directory.
      --branch=<branch>      The release branch.
  -c, --config-file=<configFile>
                             The config file
      --changelog=<changelog>
                             Path to changelog file.
      --changelog-formatted  Format generated changelog.
      --commit-author-email=<commitAuthorEmail>
                             Commit author e-mail.
      --commit-author-name=<commitAuthorName>
                             Commit author name.
  -d, --debug                Set log level to debug.
      --draft                If the release is a draft.
      --file=<files>         Input file(s) to be uploaded.
      --glob=<globs>         Input file(s) to be uploaded (as globs).
  -h, --help                 Show this help message and exit.
  -i, --info                 Set log level to info.
      --milestone-name=<milestoneName>
                             The milestone name.
      -od, --output-directory=<outputdir>
                             Output directory.
      --overwrite            Overwrite an existing release.
      --prerelease           If the release is a prerelease.
      --project-name=<projectName>
                             The project name.
      --project-snapshot-pattern=<projectSnapshotPattern>
                             The project snapshot pattern.
      --project-version=<projectVersion>
                             The project version.
      --project-version-pattern=<projectVersionPattern>
                             The project version pattern.
  -q, --quiet                Log errors only.
      --release-name=<releaseName>
                             The release name.
      --signing-armored      Generate ascii armored signatures.
      --signing-enabled      Sign files.
      --skip-tag             Skip tagging the release.
      --tag-name=<tagName>   The release tag.
      --update               Update an existing release.
      --update-section=<updateSections>
                             Release section to be updated.
      --username=<username>  Git username.
  -V, --version              Print version information and exit.
  -w, --warn                 Set log level to warn.
  -y, --dryrun               Skip remote operations.
----

There are two usage modes:

 * auto config
 * with explicit configuration file

*AutoConfig*

If `--basedir` is undefined then the command assumes it's the same directory where the command is run.

The `--file` parameter is repeatable.

The `--glob` parameter must be quote, for example `--glob "target/*.jar"`.

*Explicit Configuration file*

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

IMPORTANT: None of the command flags that override model properties can be used in this mode.

NOTE: Use `-y` or `--dryrun` during development to verify your configuration settings. No network uploads nor repository
mutations should occur when this mode is activated.

=== prepare

[source]
----
$ jreleaser prepare -h
Usage: jreleaser prepare [-dhiqVw] [-b=<basedir>] [-c=<configFile>]
                         [-dn=<distributionName>] [-tn=<toolName>]
Prepare all distributions.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
      -tn, --tool-name=<toolName>
                            The name of the tool.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

The value of `--distribution-name` must match the name of a configured xref:configuration:distributions.adoc[distribution].

The value of `--tool-name` must match any of the available xref:configuration:packagers/index.adoc[].

You may invoke this command in the following ways:

Prepare all distributions:
[source]
----
$ jreleaser prepare
----

Prepare a single distribution with all configured tools:
[source]
----
$ jreleaser prepare --distribution-name app
----

Prepare all distributions with a single tool:
[source]
----
$ jreleaser prepare --tool-name brew
----

Prepare a single distribution with a single tool:
[source]
----
$ jreleaser prepare --distribution-name app --tool-name brew
----

=== package

[source]
----
$ jreleaser package -h
Usage: jreleaser package [-dhiqVwy] [-b=<basedir>] [-c=<configFile>]
                         [-dn=<distributionName>] [-tn=<toolName>]
Package all distributions.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
      -tn, --tool-name=<toolName>
                            The name of the tool.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

The value of `--distribution-name` must match the name of a configured xref:configuration:distributions.adoc[distribution].

The value of `--tool-name` must match any of the available xref:configuration:packagers/index.adoc[].

You may invoke this command in the following ways:

Package all distributions:
[source]
----
$ jreleaser package
----

Package a single distribution with all configured tools:
[source]
----
$ jreleaser package --distribution-name app
----

Package all distributions with a single tool:
[source]
----
$ jreleaser package --tool-name brew
----

Package a single distribution with a single tool:
[source]
----
$ jreleaser package --distribution-name app --tool-name brew
----

NOTE: Use `-y` or `--dryrun` during development to verify your configuration settings. No network uploads nor repository
mutations should occur when this mode is activated.

=== publish

[source]
----
$ jreleaser publish -h
Usage: jreleaser publish [-dhiqVwy] [-b=<basedir>] [-c=<configFile>]
                        [-dn=<distributionName>] [-tn=<toolName>]
Publish all distributions.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
      -dn, --distribution-name=<distributionName>
                            The name of the distribution.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
      -tn, --tool-name=<toolName>
                            The name of the tool.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.
----
 
If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

The value of `--distribution-name` must match the name of a configured xref:configuration:distributions.adoc[distribution].

The value of `--tool-name` must match any of the available xref:configuration:packagers/index.adoc[].

You may invoke this command in the following ways:

Publish all distributions:
[source]
----
$ jreleaser publish
----

Publish a single distribution with all configured tools:
[source]
----
$ jreleaser publish --distribution-name app
----

Publish all distributions with a single tool:
[source]
----
$ jreleaser publish --tool-name brew
----

Publish a single distribution with a single tool:
[source]
----
$ jreleaser publish --distribution-name app --tool-name brew
----

NOTE: Use `-y` or `--dryrun` during development to verify your configuration settings. No network uploads nor repository
mutations should occur when this mode is activated.

=== announce

[source]
----
$ jreleaser announce -h
Usage: jreleaser announce [-dhiqVwy] [-an=<announcerName>] [-b=<basedir>]
                          [-c=<configFile>]
Announce a release.
      -an, --announcer-name=<announcerName>
                            The name of the announcer.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

The value of `--announcer-name` must match any of the available xref:configuration:announce/index.adoc[announcers].

You may invoke this command in the following ways:

Announce with all configured announcers:
[source]
----
$ jreleaser announce
----

Announce with a single announcer:
[source]
----
$ jreleaser announce --announcer-name brew
----

NOTE: Use `-y` or `--dryrun` during development to verify your configuration settings. No network uploads nor repository
mutations should occur when this mode is activated.

=== full-release

[source]
----
$ jreleaser full-release -h
Usage: jreleaser full-release [-dhiqVwy] [-b=<basedir>] [-c=<configFile>]
Perform a full release.
  -b, --basedir=<basedir>   Base directory.
  -c, --config-file=<configFile>
                            The config file
  -d, --debug               Set log level to debug.
  -h, --help                Show this help message and exit.
  -i, --info                Set log level to info.
      -od, --output-directory=<outputdir>
                            Output directory.
  -q, --quiet               Log errors only.
  -V, --version             Print version information and exit.
  -w, --warn                Set log level to warn.
  -y, --dryrun              Skip remote operations.
----

If `--config-file` is undefined then the command assumes the file is named `jreleaser.[yml|toml|json]` and it's
found at the current directory.

If `--basedir` is undefined then the command assumes it's the same directory that contains the resolved config file.

NOTE: Use `-y` or `--dryrun` during development to verify your configuration settings. No network uploads nor repository
mutations should occur when this mode is activated.

